Prevent creating new window for dragging pinned tab out of the window.

This commit is contained in:
Kristijan Ribarić
2024-11-20 09:55:50 +01:00
parent 47a8e8e9fd
commit 245f477760

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a9865299561a6cc 100644
index f3a2f226a9056c5a75023281fdeb704cec49b4a6..ae808f0f16466edc3d5f70271cc40c80deb7ab07 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -894,7 +894,7 @@
@@ -20,7 +20,17 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
postTransitionCleanup();
} else {
let onTransitionEnd = transitionendEvent => {
@@ -1284,7 +1284,7 @@
@@ -1044,7 +1044,8 @@
if (
dt.mozUserCancelled ||
dt.dropEffect != "none" ||
- this._isCustomizing
+ this._isCustomizing ||
+ draggedTab.pinned
) {
delete draggedTab._dragData;
return;
@@ -1284,7 +1285,7 @@
}
}
@@ -29,7 +39,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
this._allTabs = allChildren;
return allChildren;
}
@@ -1480,7 +1480,7 @@
@@ -1480,7 +1481,7 @@
let rect = ele => {
return window.windowUtils.getBoundsWithoutFlushing(ele);
};
@@ -38,7 +48,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
if (tab && rect(tab).width <= this._tabClipWidth) {
this.setAttribute("closebuttons", "activetab");
} else {
@@ -1499,10 +1499,12 @@
@@ -1499,10 +1500,12 @@
_handleTabSelect(aInstant) {
let selectedTab = this.selectedItem;
@@ -54,7 +64,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
selectedTab._notselectedsinceload = false;
}
@@ -1550,7 +1552,7 @@
@@ -1550,7 +1553,7 @@
if (isEndTab && !this._hasTabTempMaxWidth) {
return;
}
@@ -63,7 +73,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
// Force tabs to stay the same width, unless we're closing the last tab,
// which case we need to let them expand just enough so that the overall
// tabbar width is the same.
@@ -1565,7 +1567,7 @@
@@ -1565,7 +1568,7 @@
let tabsToReset = [];
for (let i = numPinned; i < tabs.length; i++) {
let tab = tabs[i];
@@ -72,7 +82,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
if (!isEndTab) {
// keep tabs the same width
tab.style.transition = "none";
@@ -1630,13 +1632,13 @@
@@ -1630,13 +1633,13 @@
let verticalTabsContainer = document.getElementById(
"vertical-pinned-tabs-container"
);
@@ -89,7 +99,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
}
}
@@ -1660,7 +1662,7 @@
@@ -1660,7 +1663,7 @@
_positionPinnedTabs() {
let tabs = this._getVisibleTabs();
@@ -98,7 +108,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
let absPositionHorizontalTabs =
this.overflowing && tabs.length > numPinned && numPinned > 0;
@@ -1934,7 +1936,7 @@
@@ -1934,7 +1937,7 @@
}
let pinned = draggedTab.pinned;
@@ -107,7 +117,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
let tabs = this._getVisibleTabs().slice(
pinned ? 0 : numPinned,
pinned ? numPinned : undefined
@@ -2059,8 +2061,8 @@
@@ -2059,8 +2062,8 @@
}
}
@@ -118,7 +128,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a986529
return;
}
@@ -2218,9 +2220,9 @@
@@ -2218,9 +2221,9 @@
function newIndex(aTab, index) {
// Don't allow mixing pinned and unpinned tabs.
if (aTab.pinned) {