Files
nixpkgs/pkgs/build-support/build-mozilla-mach/139-wayland-drag-animation.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

54 lines
1.8 KiB
Diff

# HG changeset patch
# User Dão Gottwald <dao@mozilla.com>
# Date 1742828426 0
# Node ID aa8a29bd1fb9668c81475b534b4ceb220dd4fe55
# Parent 653a7b21210b5b61a36af11b99ccd51e6c85a905
Bug 1955112 - Finish tab moving animation when a drag session wasn't ended properly. r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242631
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -1012,18 +1012,39 @@
newMargin *= -1;
}
ind.style.transform = this.verticalMode
? "translateY(" + Math.round(newMargin) + "px)"
: "translateX(" + Math.round(newMargin) + "px)";
}
#setMovingTabMode(movingTab) {
+ if (movingTab == this.#isMovingTab()) {
+ return;
+ }
+
this.toggleAttribute("movingtab", movingTab);
gNavToolbox.toggleAttribute("movingtab", movingTab);
+
+ if (movingTab) {
+ // This is a bit of an escape hatch in case a tab drag & drop session
+ // wasn't ended properly, leaving behind the movingtab attribute, which
+ // may break the UI (bug 1954163). We don't get mousemove events while
+ // dragging tabs, so at that point it should be safe to assume that we
+ // should not be in drag and drop mode, and clean things up if needed.
+ requestAnimationFrame(() => {
+ this.addEventListener(
+ "mousemove",
+ () => {
+ this.finishAnimateTabMove();
+ },
+ { once: true }
+ );
+ });
+ }
}
#isMovingTab() {
return this.hasAttribute("movingtab");
}
#expandGroupOnDrop(draggedTab) {
if (