Fixed crash on overflow menu in macos and fixed elements shifting on macos fullscreen

This commit is contained in:
mr. M
2025-01-24 17:41:03 +01:00
parent 952c02d3d6
commit a3bebadff8
3 changed files with 34 additions and 10 deletions

View File

@@ -11,7 +11,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
cumulativeDelta: 0,
direction: null,
};
_hoveringSidebar = false;
_lastScrollTime = 0;
bookmarkMenus = [
'PlacesToolbar',
@@ -114,6 +113,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
window.addEventListener('AppCommand', HandleAppCommandEvent, true);
}
get _hoveringSidebar() {
return document.getElementById('navigator-toolbox').hasAttribute('zen-has-hover');
}
_handleAppCommand(event) {
if (!this.workspaceEnabled || !this._hoveringSidebar) {
return;
@@ -138,14 +141,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
_setupSidebarHandlers() {
const toolbox = document.getElementById('navigator-toolbox');
toolbox.addEventListener('mouseenter', () => {
this._hoveringSidebar = true;
});
toolbox.addEventListener('mouseleave', () => {
this._hoveringSidebar = false;
});
const scrollCooldown = 200; // Milliseconds to wait before allowing another scroll
const scrollThreshold = 2; // Minimum scroll delta to trigger workspace change