gh-8643: Fixed dragging tabs between windows not hiding sidebar (gh-13430)

This commit is contained in:
mr. m
2026-04-27 00:32:12 +02:00
committed by GitHub
parent 6d3a59ac04
commit 040bed5ce5
4 changed files with 13 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/drag-and-drop.js b/browser/components/tabbrowser/content/drag-and-drop.js
index b93a8fcc8b76ed888524959cbe7d6865fe830f2f..fa192837d06e28bb847acbbd462ad3229ebdc2d2 100644
index b93a8fcc8b76ed888524959cbe7d6865fe830f2f..9f39316e33daa8a272e48c84d9e07ad9df197586 100644
--- a/browser/components/tabbrowser/content/drag-and-drop.js
+++ b/browser/components/tabbrowser/content/drag-and-drop.js
@@ -35,6 +35,9 @@
@@ -47,7 +47,7 @@ index b93a8fcc8b76ed888524959cbe7d6865fe830f2f..fa192837d06e28bb847acbbd462ad322
event.stopPropagation();
+ if (draggedTab && dropEffect == "move") {
+ this.handle_drop_transition?.(draggedTab._dragData.dropElement, draggedTab, movingTabs, draggedTab._dragData.dropBefore);
+ gZenPinnedTabManager.moveToAnotherTabContainerIfNecessary(event, draggedTab, movingTabs, this._getDropIndex(event));
+ [draggedTab, movingTabs] = gZenPinnedTabManager.moveToAnotherTabContainerIfNecessary(event, draggedTab, movingTabs, this._getDropIndex(event));
+ }
if (draggedTab && dropEffect == "copy") {
let duplicatedDraggedTab;

View File

@@ -148,6 +148,7 @@ window.gZenCompactModeManager = {
// We dont want the user to be able to spam the button
return;
}
delete this._isTabBeingDragged;
this.sidebar.removeAttribute("zen-user-show");
// We use this element in order to make it persis across restarts, by using the XULStore.
// main-window can't store attributes other than window sizes, so we use this instead

View File

@@ -944,6 +944,15 @@
}
handle_drop(event) {
const ownerGlobal = event.dataTransfer.mozGetDataAt(
TAB_DROP_TYPE,
0
)?.ownerGlobal;
if (ownerGlobal?.gZenCompactModeManager) {
// Sometimes, dragend doesn't always get called when dragging
// to different windows, see gh-8643.
delete ownerGlobal.gZenCompactModeManager._isTabBeingDragged;
}
this.clearSpaceSwitchTimer();
gZenFolders.highlightGroupOnDragOver(null);
super.handle_drop(event);

View File

@@ -819,11 +819,10 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
}
}
}
return moved;
} catch (ex) {
console.error("Error moving tabs:", ex);
return false;
}
return [draggedTab, movingTabs];
}
onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI) {