fix: Fixed moving tabs around with scrollbox overflowing, b=(no-bug), c=tabs, workspaces

This commit is contained in:
Mr. M
2025-05-18 15:34:44 +02:00
parent e4eb6d6fdd
commit 8b5e26759f
2 changed files with 17 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..62fcba41ec1976e24343a54f8dd146a430a6640e 100644
index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f326895a66dcbd4961cb1a4e8310ae80a181b60e 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -83,7 +83,7 @@
@@ -393,7 +393,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..62fcba41ec1976e24343a54f8dd146a4
let translateX = event.screenX - dragData.screenX;
let translateY = event.screenY - dragData.screenY;
@@ -2407,10 +2450,19 @@
@@ -2407,14 +2450,23 @@
let lastTab = tabs.at(-1);
let lastMovingTab = movingTabs.at(-1);
let firstMovingTab = movingTabs[0];
@@ -411,8 +411,14 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..62fcba41ec1976e24343a54f8dd146a4
+ shiftSize += 5; // A hack to allow more space for the group
+ }
let translate = screen - dragData[screenAxis];
if (!isPinned) {
- if (!isPinned) {
+ if (true) {
translate +=
- this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos;
+ gZenWorkspaces.activeScrollbox.scrollbox[scrollDirection] - dragData.scrollPos;
} else if (isPinned && this.verticalMode) {
translate +=
this.verticalPinnedTabsContainer.scrollTop - dragData.scrollPos;
@@ -2431,6 +2483,9 @@
// Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement;

View File

@@ -346,6 +346,13 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
return document.querySelector(`zen-workspace[active]`)?.indicator;
}
get activeScrollbox() {
return (
document.querySelector(`zen-workspace[active]`)?.scrollbox ??
gBrowser.tabContainer.arrowScrollbox
);
}
get tabboxChildren() {
return Array.from(this.activeWorkspaceStrip?.children || []);
}
@@ -2393,6 +2400,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
gZenThemePicker.onWorkspaceChange(workspace);
gZenUIManager.tabsWrapper.scrollbarWidth = 'none';
this.workspaceIcons.activeIndex = workspace.uuid;
await this._animateTabs(workspace, !onInit && !this._animatingChange, tabToSelect, {
previousWorkspaceIndex,
previousWorkspace,
@@ -2437,8 +2445,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
);
}
this.workspaceIcons.activeIndex = workspace.uuid;
setTimeout(gURLBar.formatValue.bind(gURLBar), 0);
}