This commit is contained in:
mr. m
2025-05-19 09:22:43 +02:00
8 changed files with 43 additions and 21 deletions

View File

@@ -86,6 +86,13 @@
);
};
this.scrollbox._canScrollToElement = (element) => {
if (gBrowser.isTab(element)) {
return !element.hasAttribute('zen-essential') || !this.hasAttribute('positionpinnedtabs');
}
return true;
};
// Override for performance reasons. This is the size of a single element
// that can be scrolled when using mouse wheel scrolling. If we don't do
// this then arrowscrollbox computes this value by calling
@@ -95,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

@@ -808,13 +808,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 {
@@ -831,6 +824,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);
}
}