fix: Fixed resizing workspaces at startup, b=(no-bug), c=workspaces

This commit is contained in:
Mr. M
2025-05-19 01:32:49 +02:00
parent e3193c54f4
commit d9c9e74cc8
2 changed files with 15 additions and 10 deletions

View File

@@ -102,9 +102,13 @@
// height. For tab group labels, the number won't exactly match, but
// that shouldn't be a problem in practice since the arrowscrollbox
// stops at element bounds when finishing scrolling.
Object.defineProperty(this.scrollbox, 'lineScrollAmount', {
get: () => 36,
});
try {
Object.defineProperty(this.scrollbox, 'lineScrollAmount', {
get: () => 36,
});
} catch (e) {
console.warn('Failed to set lineScrollAmount', e);
}
// Add them manually since attribute inheritance doesn't work
// for multiple layers of shadow DOM.

View File

@@ -809,13 +809,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
this._initializeWorkspaceTabContextMenus();
await this.workspaceBookmarks();
window.addEventListener('TabBrowserInserted', this.onTabBrowserInserted.bind(this));
const tabUpdateListener = this.updateTabsContainers.bind(this);
window.addEventListener('TabOpen', tabUpdateListener);
window.addEventListener('TabClose', tabUpdateListener);
window.addEventListener('TabAddedToEssentials', tabUpdateListener);
window.addEventListener('TabRemovedFromEssentials', tabUpdateListener);
window.addEventListener('TabPinned', tabUpdateListener);
window.addEventListener('TabUnpinned', tabUpdateListener);
let activeWorkspace = await this.getActiveWorkspace();
this.activeWorkspace = activeWorkspace?.uuid;
try {
@@ -832,6 +825,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
this._fixTabPositions();
this._resolveInitialized();
this._clearAnyZombieTabs(); // Dont call with await
const tabUpdateListener = this.updateTabsContainers.bind(this);
window.addEventListener('TabOpen', tabUpdateListener);
window.addEventListener('TabClose', tabUpdateListener);
window.addEventListener('TabAddedToEssentials', tabUpdateListener);
window.addEventListener('TabRemovedFromEssentials', tabUpdateListener);
window.addEventListener('TabPinned', tabUpdateListener);
window.addEventListener('TabUnpinned', tabUpdateListener);
}
}