From 808e186dae811d45e0d4b488497d8e2e05ced3b3 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Tue, 6 May 2025 07:23:14 +0200 Subject: [PATCH] fix: Fixed ctrl+K into the urlbar having the wrong coordinates, b=(closes #8093), c=common, tabs, workspaces --- src/zen/common/ZenUIManager.mjs | 6 +++++- src/zen/common/styles/zen-theme.css | 4 ++++ src/zen/tabs/ZenPinnedTabManager.mjs | 8 +++++++- src/zen/workspaces/ZenWorkspaces.mjs | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/zen/common/ZenUIManager.mjs b/src/zen/common/ZenUIManager.mjs index c43a6f4b2..dc3ae2f8d 100644 --- a/src/zen/common/ZenUIManager.mjs +++ b/src/zen/common/ZenUIManager.mjs @@ -43,9 +43,10 @@ var gZenUIManager = { }, updateTabsToolbar() { + const kUrlbarHeight = 440; gURLBar.textbox.style.setProperty( '--zen-urlbar-top', - `${window.innerHeight / 2 - gURLBar.textbox.getBoundingClientRect().height / 2}px` + `${window.innerHeight / 2 - Math.max(kUrlbarHeight, gURLBar.textbox.getBoundingClientRect().height) / 2}px` ); gZenVerticalTabsManager.actualWindowButtons.removeAttribute('zen-has-hover'); gZenVerticalTabsManager.recalculateURLBarHeight(); @@ -83,6 +84,9 @@ var gZenUIManager = { onFloatingURLBarOpen() { requestAnimationFrame(() => { this.updateTabsToolbar(); + requestAnimationFrame(() => { + this.updateTabsToolbar(); + }); }); }, diff --git a/src/zen/common/styles/zen-theme.css b/src/zen/common/styles/zen-theme.css index 93ad532e6..6dfc57b51 100644 --- a/src/zen/common/styles/zen-theme.css +++ b/src/zen/common/styles/zen-theme.css @@ -208,6 +208,10 @@ Segoe UI Symbol, Noto Color Emoji; } + + &:not([chromehidden~='toolbar']) { + min-height: 495px !important; + } } @media (prefers-color-scheme: dark) { diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index 94b69370d..14f6072b6 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -47,6 +47,8 @@ } class ZenPinnedTabManager extends ZenDOMOperatedFeature { + MAX_ESSENTIALS_TABS = 12; + async init() { if (!this.enabled) { return; @@ -639,6 +641,10 @@ : [TabContextMenu.contextTab]; for (let i = 0; i < tabs.length; i++) { let tab = tabs[i]; + const section = ZenWorkspaces.getEssentialsSection(tab); + if (section.children.length >= this.MAX_ESSENTIALS_TABS) { + continue; + } if (tab.hasAttribute('zen-essential')) { continue; } @@ -658,7 +664,7 @@ }); tab.setAttribute('zen-essential', 'true'); } else { - ZenWorkspaces.getEssentialsSection(tab).appendChild(tab); + section.appendChild(tab); } gBrowser.tabContainer._invalidateCachedTabs(); } else { diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 2ba2aad2d..003e20f3c 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -2271,7 +2271,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { const containerId = workspace.containerTabId?.toString(); const workspaces = await this._workspaces(); - + // Save current tab as last selected for old workspace if it shouldn't be visible in new workspace if (oldWorkspaceId && oldWorkspaceId !== workspace.uuid) { this._lastSelectedWorkspaceTabs[oldWorkspaceId] = gZenGlanceManager.getTabOrGlanceParent(currentSelectedTab);