Skip to content

Commit 70aeeba

Browse files
committed
fix: Fixed moving folders to different spaces, b=no-bug, c=folders, workspaces
1 parent f9ca9cc commit 70aeeba

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/browser/components/tabbrowser/content/tabbrowser-js.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
2-
index d80a66a01002e78a9c65545d08fe786328ddf124..e644946134c7e5a4b3232f674880eab596d5fa15 100644
2+
index d80a66a01002e78a9c65545d08fe786328ddf124..c5c079ac5218f051407b27c6edbd4ba6fe685e62 100644
33
--- a/browser/components/tabbrowser/content/tabbrowser.js
44
+++ b/browser/components/tabbrowser/content/tabbrowser.js
55
@@ -422,15 +422,60 @@
@@ -623,11 +623,13 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..e644946134c7e5a4b3232f674880eab5
623623
}
624624

625625
/**
626-
@@ -6049,7 +6181,7 @@
626+
@@ -6048,8 +6180,8 @@
627+
}
627628

628629
// Don't allow mixing pinned and unpinned tabs.
629-
if (this.isTab(element) && element.pinned) {
630+
- if (this.isTab(element) && element.pinned) {
630631
- tabIndex = Math.min(tabIndex, this.pinnedTabCount - 1);
632+
+ if (element.pinned) {
631633
+ tabIndex = element.hasAttribute('zen-essential') ? Math.min(tabIndex, this._numZenEssentials - 1) : Math.min(Math.max(tabIndex, this._numZenEssentials), this.pinnedTabCount - 1);
632634
} else {
633635
tabIndex = Math.max(tabIndex, this.pinnedTabCount);

src/zen/folders/ZenFolders.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,9 @@
771771
}
772772
}
773773
folder.dispatchEvent(new CustomEvent('ZenFolderChangedWorkspace', { bubbles: true }));
774-
gZenWorkspaces.changeWorkspaceWithID(workspaceId);
774+
gZenWorkspaces.changeWorkspaceWithID(workspaceId).then(() => {
775+
gBrowser.moveTabTo(folder, { elementIndex: gBrowser.pinnedTabCount, forceUngrouped: true });
776+
});
775777
}
776778

777779
canDropElement(element, targetElement) {
@@ -1306,6 +1308,11 @@
13061308
}
13071309
}
13081310

1311+
if (group.activeTabs.length === 0) {
1312+
group.removeAttribute('has-active');
1313+
this.updateFolderIcon(group, 'close', false);
1314+
}
1315+
13091316
this.on_TabGroupExpand({ target: group, forExpandVisible: true });
13101317

13111318
gBrowser.tabContainer._invalidateCachedVisibleTabs();

src/zen/workspaces/ZenWorkspaces.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
15411541

15421542
async changeWorkspaceWithID(workspaceID, ...args) {
15431543
const workspace = this.getWorkspaceFromId(workspaceID);
1544-
return await this.changeWorkspace(workspace, ...args);
1544+
await this.changeWorkspace(workspace, ...args);
15451545
}
15461546

15471547
async changeWorkspace(workspace, ...args) {
@@ -1624,7 +1624,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
16241624
}
16251625

16261626
#fixTabPositions() {
1627-
gBrowser.tabContainer._invalidateCachedTabs();
1627+
this.tabContainer._invalidateCachedTabs();
16281628
// Fix tabs _tPos values relative to the actual order
16291629
const tabs = gBrowser.tabs;
16301630
const usedGroups = new Set();

0 commit comments

Comments
 (0)