This commit is contained in:
mr. M
2025-02-20 17:02:28 +01:00
17 changed files with 115 additions and 66 deletions

View File

@@ -164,14 +164,14 @@ jobs:
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
run: |
cd engine/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.80
source $HOME/.cargo/env
if test "${{ matrix.arch }}" = "aarch64"; then
rustup target add aarch64-pc-windows-msvc
else
rustup target add x86_64-pc-windows-msvc
fi
cargo install cargo-download
cargo install cargo-download --locked
cargo download -x windows=0.58.0
export CARGO_INCREMENTAL=0
echo "" >> ../configs/common/mozconfig

View File

@@ -9,7 +9,7 @@ fi
if test "$SURFER_COMPAT" = "x86_64"; then
ac_add_options --target=x86_64-pc-linux
ac_add_options --enable-eme=widevine
ac_add_options --enable-eme=widevine,wmfcdm
# Enable Profile Guided Optimization
if test "$ZEN_GA_DISABLE_PGO"; then

View File

@@ -1,7 +1,7 @@
unset MOZ_STDCXX_COMPAT
ac_add_options --disable-dmd
ac_add_options --enable-eme=widevine
ac_add_options --enable-eme=widevine,wmfcdm
export MOZ_MACBUNDLE_ID=${appId}
export MOZ_MACBUNDLE_NAME="Zen Browser.app"

View File

@@ -30,7 +30,7 @@ ac_add_options --disable-clang-plugin
if test "$SURFER_COMPAT" = "x86_64"; then
ac_add_options --target=x86_64-pc-windows-msvc
ac_add_options --enable-eme=widevine
ac_add_options --enable-eme=widevine,wmfcdm
ac_add_options --enable-optimize="-O3 -w -ftree-vectorize -Qvec -mfpmath=sse -mprfchw -msse3 -mcx16 -msahf"
@@ -38,7 +38,7 @@ if test "$SURFER_COMPAT" = "x86_64"; then
export RUSTFLAGS="-Clink-args=--icf=safe"
elif test "$SURFER_COMPAT" = "aarch64"; then
ac_add_options --target=aarch64-pc-windows-msvc
ac_add_options --enable-eme=widevine
ac_add_options --enable-eme=widevine,wmfcdm
ac_add_options --enable-optimize="-O2 -mtune=cortex-a55 -march=armv8.2-a+simd"

View File

@@ -58,10 +58,6 @@
&:not([zen-right-side='true']) #nav-bar {
margin-left: 0 !important;
}
& #urlbar[open]:not([zen-floating-urlbar='true']) {
top: 0 !important;
}
}
&:not([zen-right-side='true']) #navigator-toolbox {
@@ -109,11 +105,12 @@
background: var(--zen-main-browser-background-toolbar) !important;
background-attachment: fixed !important;
background-size: 2000px !important; /* Dont ask me why */
backdrop-filter: blur(5px) !important;
/* NOTE: We MUST not add a backdrop-filter if we want the URL
* bar to be floating correctly:
* https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_display/Containing_block#identifying_the_containing_block */
}
& #urlbar[open][zen-floating-urlbar='true'] {
--zen-urlbar-offset: var(--zen-sidebar-width);
transition: left 0.05s ease;
#navigator-toolbox:has(&) {
@@ -136,7 +133,6 @@
}
}
#navigator-toolbox:hover,
#navigator-toolbox[zen-has-hover],
#navigator-toolbox[zen-user-show],
#navigator-toolbox[flash-popup],
@@ -261,10 +257,6 @@
right: -1px;
left: auto;
}
& #urlbar[open][zen-floating-urlbar='true'] {
--zen-urlbar-offset: 0px;
}
}
}
}
@@ -332,7 +324,6 @@
}
}
& #zen-appcontent-navbar-container:hover,
& #zen-appcontent-navbar-container[zen-has-hover],
& #zen-appcontent-navbar-container:focus-within,
& #zen-appcontent-navbar-container[zen-user-show],
@@ -347,10 +338,6 @@
& #urlbar {
transform: translateY(0);
&[open]:not([zen-floating-urlbar='true']) {
top: 0 !important;
}
}
&::before {

View File

@@ -43,12 +43,13 @@
#PanelUI-zen-gradient-generator-custom-input {
position: relative;
padding-right: 6px !important;
}
#PanelUI-zen-gradient-generator-color-custom-add {
position: absolute;
right: 0px;
top: 0px;
right: 2px;
top: 4px;
cursor: pointer;
}
@@ -187,7 +188,7 @@
transition: transform 0.2s;
transform: translate(-50%, -50%);
&.primary {
&:first-of-type {
width: 28px;
height: 28px;
border-width: 3px;

View File

@@ -127,7 +127,7 @@
}
:root[zen-single-toolbar='true'] {
.urlbar-page-action:not([open]),
.urlbar-page-action:not([open]):not(#identity-permission-box),
#tracking-protection-icon-container {
display: none;
}
@@ -142,7 +142,10 @@
visibility: collapse;
}
#urlbar[open] :is(#tracking-protection-icon-container, .urlbar-page-action, .identity-box-button):not([hidden='true']),
#urlbar[open]
:is(#tracking-protection-icon-container, .urlbar-page-action, .identity-box-button):not([hidden='true']):not(
#identity-permission-box
),
#urlbar:hover #identity-icon-box {
opacity: 1;
margin-inline-end: 0 !important;
@@ -413,22 +416,21 @@ button.popup-notification-dropmarker {
min-width: 45vw !important;
--urlbar-container-height: 55px !important;
--urlbar-margin-inline: 10px !important;
position: absolute;
position: fixed;
font-size: 1.15em !important;
@media (-moz-platform: macos) {
font-size: 1.5em !important;
}
top: calc(var(--zen-toolbar-height) * 2) !important;
--zen-urlbar-center: calc(var(--zen-urlbar-offset, 0px) + 28vw);
top: 50% !important;
transform: translate(-50%, -50%);
:root[zen-right-side='true'] & {
right: var(--zen-urlbar-center) !important;
right: 50% !important;
}
:root:not([zen-right-side='true']) & {
left: var(--zen-urlbar-center) !important;
left: 50% !important;
}
#urlbar-container:has(&) {

View File

@@ -455,15 +455,16 @@
}
.zen-current-workspace-indicator {
padding: 15px calc(6px + var(--tab-inline-padding));
padding: 15px calc(4px + var(--tab-inline-padding));
font-weight: 600;
position: absolute;
max-height: var(--zen-workspace-indicator-height);
min-height: var(--zen-workspace-indicator-height);
gap: 10px;
gap: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
align-items: center;
flex-direction: row !important;
&::before {
@@ -492,7 +493,6 @@
}
.zen-current-workspace-indicator-name {
font-size: 13px;
opacity: 0.5;
display: block;
}

File diff suppressed because one or more lines are too long

View File

@@ -309,7 +309,6 @@
existingPrimaryDot.ID = this.dots.length;
existingPrimaryDot.element.classList.remove('primary');
}
dot.classList.add('primary');
}
const colorFromPos = this.getColorFromPosition(relativePosition.x, relativePosition.y);

View File

@@ -631,6 +631,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
* @param {string} gridType - The type of grid layout.
*/
splitTabs(tabs, gridType) {
tabs = tabs.filter((tab) => !tab.hasAttribute('zen-empty-tab'));
if (tabs.length < 2) {
return;
}

View File

@@ -50,10 +50,12 @@
}
function openWelcomeTab() {
const currentSelectedTab = window.gBrowser.selectedTab;
const tab = window.gBrowser.addTrustedTab('https://zen-browser.app/welcome', {
inBackground: true,
});
gBrowser.selectedTab = tab;
gBrowser.removeTab(currentSelectedTab);
}
class ZenWelcomePages {
@@ -425,6 +427,8 @@
});
gZenPinnedTabManager.addToEssentials(createdTab);
}
openInitialPinTab();
openWelcomeTab();
},
},
{
@@ -513,8 +517,6 @@
centerWindowOnScreen();
initializeZenWelcome();
animateInitialStage();
openInitialPinTab();
openWelcomeTab();
}
startZenWelcome();

View File

@@ -115,18 +115,15 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
selectEmptyTab() {
if (this._emptyTab) {
if (!Services.prefs.getBoolPref('zen.urlbar.replace-newtab')) {
let tab = gZenUIManager.openAndChangeToTab(Services.prefs.getStringPref('browser.startup.homepage'));
if (window.uuid) {
tab.setAttribute('zen-workspace-id', this.activeWorkspace);
}
return tab;
}
if (this._emptyTab && Services.prefs.getBoolPref('zen.urlbar.replace-newtab')) {
gBrowser.selectedTab = this._emptyTab;
return this._emptyTab;
}
return null;
let tab = gZenUIManager.openAndChangeToTab(Services.prefs.getStringPref('browser.startup.homepage'));
if (window.uuid) {
tab.setAttribute('zen-workspace-id', this.activeWorkspace);
}
return tab;
}
async delayedStartup() {
@@ -176,15 +173,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
get tabboxChildren() {
const childs = Array.from(this.tabboxChildrenWithoutEmpty);
if (this._emptyTab) {
childs.unshift(this._emptyTab);
}
return childs;
return Array.from(this.activeWorkspaceStrip?.children || []);
}
get tabboxChildrenWithoutEmpty() {
return this.activeWorkspaceStrip?.children || [];
return this.tabboxChildren.filter((child) => !child.hasAttribute('zen-empty-tab'));
}
get pinnedTabsContainer() {
@@ -1135,6 +1128,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (!ignoreStrip) {
await browser.ZenWorkspaces._expandWorkspacesStrip(browser);
browser.ZenWorkspaces._fixIndicatorsNames(workspaces);
}
});
}
@@ -1493,11 +1487,18 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
// First pass: Handle tab visibility and workspace ID assignment
this._processTabVisibility(window.uuid, containerId, workspaces);
const prevTabUsed = this._processTabVisibility(window.uuid, containerId, workspaces);
// Second pass: Handle tab selection
this.tabContainer._invalidateCachedTabs();
const tabToSelect = await this._handleTabSelection(window, onInit, containerId, workspaces, previousWorkspace.uuid);
const tabToSelect = await this._handleTabSelection(
window,
onInit,
containerId,
workspaces,
previousWorkspace.uuid,
prevTabUsed
);
// Update UI and state
await this._updateWorkspaceState(window, onInit, tabToSelect);
@@ -1615,16 +1616,19 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
// If there's no more visible tabs, make a new tab visible
// or if ALL the visible tabs are essentials or we have our selected
// tab hidden, select a new tab
let prevTabUsed = null;
if (
hiddenTabs.length === visibleTabs.length ||
visibleTabs.every((tab) => tab.getAttribute('zen-essential') === 'true') ||
hiddenTabs.includes(gBrowser.selectedTab)
) {
prevTabUsed = gBrowser.selectedTab;
this.selectEmptyTab();
}
for (const tab of hiddenTabs) {
gBrowser.hideTab(tab, undefined, true);
}
return prevTabUsed;
}
_shouldShowTab(tab, workspaceUuid, containerId, workspaces) {
@@ -1663,8 +1667,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
return tabWorkspaceId === workspaceUuid;
}
async _handleTabSelection(window, onInit, containerId, workspaces, previousWorkspaceId) {
const currentSelectedTab = gBrowser.selectedTab;
async _handleTabSelection(window, onInit, containerId, workspaces, previousWorkspaceId, prevTabUsed) {
const currentSelectedTab = prevTabUsed || gBrowser.selectedTab;
const oldWorkspaceId = previousWorkspaceId;
const lastSelectedTab = this._lastSelectedWorkspaceTabs[window.uuid];
@@ -1738,6 +1742,14 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
// Update workspace indicator
await this.updateWorkspaceIndicator(window, this.workspaceIndicator);
// Fix ctrl+tab behavior. Note, we dont call it with "await" because we dont want to wait for it
this._fixCtrlTabBehavior();
}
async _fixCtrlTabBehavior() {
ctrlTab.uninit();
ctrlTab.readPref();
}
_invalidateBookmarkContainers() {
@@ -1911,6 +1923,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const contaienr = document.querySelector(
`#vertical-pinned-tabs-container .zen-workspace-tabs-section[zen-workspace-id="${workspaceId}"]`
);
console.log(tab);
contaienr.insertBefore(tab, contaienr.firstChild);
changed = true;
}
@@ -1980,6 +1993,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
this._contextMenuId = null;
}
findTabToBlur(tab) {
return tab.hasAttribute('zen-essential') && this._emptyTab ? this._emptyTab : tab;
}
async setDefaultWorkspace() {
await ZenWorkspacesStorage.setDefaultWorkspace(this._contextMenuId);
await this._propagateWorkspaceData();
@@ -2156,7 +2173,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
// Session restore functions
get allStoredTabs() {
if (!this._hasInitializedTabsStrip) {
const children = Array.from(this.tabboxChildren);
const children = this.tabboxChildren;
children.pop(); // Remove the last child which is the new tab button
return children;
}

View File

@@ -0,0 +1,13 @@
diff --git a/browser/components/tabbrowser/content/browser-ctrlTab.js b/browser/components/tabbrowser/content/browser-ctrlTab.js
index e5d16e605b7edf11fc9f52b93e415087b76398f1..feb7ccfc0562efda56177a75454a9f83a332e8d1 100644
--- a/browser/components/tabbrowser/content/browser-ctrlTab.js
+++ b/browser/components/tabbrowser/content/browser-ctrlTab.js
@@ -761,7 +761,7 @@ var ctrlTab = {
_initRecentlyUsedTabs() {
this._recentlyUsedTabs = Array.prototype.filter.call(
gBrowser.tabs,
- tab => !tab.closing && !tab.hidden
+ tab => !tab.closing && !tab.hidden && !tab.hasAttribute("zen-empty-tab")
);
this._sortRecentlyUsedTabs();
},

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..cb4a77fa5992b9890dfc55cb3c3c558d07912bb1 100644
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5ae4351d7438c0e03c0a24551c910d43a2c676bd 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -406,11 +406,52 @@
@@ -365,6 +365,24 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..cb4a77fa5992b9890dfc55cb3c3c558d
if (!this._windowIsClosing) {
if (wasPinned) {
this.tabContainer._positionPinnedTabs();
@@ -5025,7 +5132,7 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
- return aTab.owner;
+ return ZenWorkspaces.findTabToBlur(aTab.owner);
}
// Try to find a remaining tab that comes after the given tab
@@ -5047,7 +5154,7 @@
}
if (tab) {
- return tab;
+ return ZenWorkspaces.findTabToBlur(tab);
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5465,10 +5572,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index 8aeb244ffca9f48661805f5b7d860b5896055562..b2e3b6c9c37eb1a070bbea72d629f9f72676f5bf 100644
index 8aeb244ffca9f48661805f5b7d860b5896055562..c96e563a31b4c32c855cc2d250d702361b427f88 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -94,7 +94,7 @@
@@ -151,6 +151,15 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..b2e3b6c9c37eb1a070bbea72d629f9f7
return children.filter(node => node.tagName == "tab-group");
}
@@ -1540,7 +1568,7 @@
*/
get visibleTabs() {
if (!this.#visibleTabs) {
- this.#visibleTabs = this.openTabs.filter(tab => tab.visible);
+ this.#visibleTabs = this.openTabs.filter(tab => tab.visible && !tab.hasAttribute("zen-empty-tab"));
}
return this.#visibleTabs;
}
@@ -1574,10 +1602,8 @@
return this.#focusableItems;
}
@@ -160,7 +169,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..b2e3b6c9c37eb1a070bbea72d629f9f7
- );
- let children = Array.from(this.arrowScrollbox.children);
+ let verticalPinnedTabsContainer = this.verticalPinnedTabsContainer;
+ let children = Array.from(ZenWorkspaces.tabboxChildrenWithoutEmpty);
+ let children = ZenWorkspaces.tabboxChildrenWithoutEmpty;
let focusableItems = [];
for (let child of children) {

View File

@@ -1,8 +1,8 @@
diff --git a/browser/themes/shared/identity-block/identity-block.css b/browser/themes/shared/identity-block/identity-block.css
index 11ff8f62c9e40fd2f523387a4325518f383f5d11..d6563e2ddf963caa34bee716c42f9d440c327b61 100644
index 13b1659ed5a3b9bb0342b601998d0fd5c9760e22..4f13c401f23f51962986fe8caf197aa5306fc276 100644
--- a/browser/themes/shared/identity-block/identity-block.css
+++ b/browser/themes/shared/identity-block/identity-block.css
@@ -80,7 +80,7 @@
@@ -81,7 +81,7 @@
#identity-box[pageproxystate="valid"]:is(.notSecureText, .chromeUI, .extensionPage) > .identity-box-button,
#urlbar-label-box {
@@ -11,7 +11,7 @@ index 11ff8f62c9e40fd2f523387a4325518f383f5d11..d6563e2ddf963caa34bee716c42f9d44
color: var(--urlbar-box-text-color);
padding-inline: 8px;
border-radius: var(--urlbar-icon-border-radius);
@@ -174,16 +174,17 @@
@@ -175,16 +175,17 @@
}
#identity-icon {