gh-14511: Prevent switching spaces when dragging outside (gh-14515)

fixed: https://github.com/zen-browser/desktop/issues/14511
This commit is contained in:
Andrey Bochkarev
2026-07-12 13:57:45 +03:00
committed by GitHub
parent 274b9f9f83
commit a1a2268f9b

View File

@@ -69,6 +69,7 @@
#changeSpaceTimer = null;
#isAnimatingTabMove = false;
#firstHapticFeedbackPlayed = false;
#lastDragOverTime = 0;
#dragOverSplit = {};
@@ -723,9 +724,11 @@
const { isNearLeftEdge, isNearRightEdge } =
this.#shouldSwitchSpace(event);
if (isNearLeftEdge || isNearRightEdge) {
if (!this.#changeSpaceTimer && !this.#isOutOfWindow) {
this.#lastDragOverTime = Date.now();
if (!this.#changeSpaceTimer) {
this.#changeSpaceTimer = setTimeout(() => {
if (this.#isOutOfWindow) {
const timeSinceLastDragOver = Date.now() - this.#lastDragOverTime;
if (timeSinceLastDragOver > 250) {
return;
}
this.clearDragOverVisuals();