mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-20 12:01:27 +00:00
gh-8643: Fixed dragging tabs between windows not hiding sidebar (gh-13430)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user