diff --git a/configs/macos/mozconfig b/configs/macos/mozconfig index 1cc417ce..9c1f488f 100644 --- a/configs/macos/mozconfig +++ b/configs/macos/mozconfig @@ -7,8 +7,18 @@ export MOZ_MACBUNDLE_ID=${appId} export MOZ_MACBUNDLE_NAME="Zen Browser.app" # override LTO settings -# TODO: Dont +# TODO: Dont use LTO for now, it's causing a lot of issues +export MOZ_LTO=cross,thin +ac_add_options --enable-lto=cross,thin +if test "$ZEN_RELEASE"; then + if test "$ZEN_GA_DISABLE_PGO"; then + export ZEN_DUMMY=1 + else + export MOZ_PGO=1 + ac_add_options MOZ_PGO=1 + fi +fi if test "$SURFER_COMPAT" = "x86_64"; then ac_add_options --target=x86_64-apple-darwin diff --git a/src/browser/base/content/ZenCustomizableUI.sys.mjs b/src/browser/base/content/ZenCustomizableUI.sys.mjs index abd8112d..a2969225 100644 --- a/src/browser/base/content/ZenCustomizableUI.sys.mjs +++ b/src/browser/base/content/ZenCustomizableUI.sys.mjs @@ -125,12 +125,5 @@ export var ZenCustomizableUI = new (class { registerToolbarNodes(window) { window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons')); window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-bottom-buttons')); - window.addEventListener( - 'DOMContentLoaded', - () => { - this._dispatchResizeEvent(window); - }, - { once: true } - ); } })(); diff --git a/src/browser/base/content/ZenStartup.mjs b/src/browser/base/content/ZenStartup.mjs index 4de69a3d..662afbd5 100644 --- a/src/browser/base/content/ZenStartup.mjs +++ b/src/browser/base/content/ZenStartup.mjs @@ -58,6 +58,7 @@ closeWatermark() { document.documentElement.removeAttribute('zen-before-loaded'); + window.dispatchEvent(new window.Event('resize')); // To recalculate the layout if (Services.prefs.getBoolPref('zen.watermark.enabled', false)) { gZenUIManager.motion .animate( diff --git a/src/browser/base/content/ZenUIManager.mjs b/src/browser/base/content/ZenUIManager.mjs index e1866c2a..5a3089c5 100644 --- a/src/browser/base/content/ZenUIManager.mjs +++ b/src/browser/base/content/ZenUIManager.mjs @@ -372,12 +372,16 @@ var gZenVerticalTabsManager = { aTab.style.removeProperty('opacity'); }); gZenUIManager.motion - .animate(aTab.querySelector('.tab-content'), { - filter: ['blur(1px)', 'blur(0px)'], - }, { - duration: 0.12, - easing: 'ease-out', - }) + .animate( + aTab.querySelector('.tab-content'), + { + filter: ['blur(1px)', 'blur(0px)'], + }, + { + duration: 0.12, + easing: 'ease-out', + } + ) .then(() => { aTab.querySelector('.tab-stack').style.removeProperty('filter'); }); diff --git a/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch b/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch index 35657acb..20662d9f 100644 --- a/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch +++ b/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs -index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc3174ae5260b 100644 +index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded349732ffc6 100644 --- a/browser/components/customizableui/CustomizableUI.sys.mjs +++ b/browser/components/customizableui/CustomizableUI.sys.mjs @@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, { @@ -116,7 +116,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317 win.setToolbarVisibility( areaNode, typeof defaultCollapsed == "string" -@@ -4658,6 +4656,7 @@ export var CustomizableUI = { +@@ -4857,6 +4855,7 @@ export var CustomizableUI = { unregisterArea(aName, aDestroyPlacements) { CustomizableUIInternal.unregisterArea(aName, aDestroyPlacements); }, @@ -124,7 +124,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317 /** * Add a widget to an area. * If the area to which you try to add is not known to CustomizableUI, -@@ -6483,11 +6482,11 @@ class OverflowableToolbar { +@@ -6840,11 +6839,11 @@ class OverflowableToolbar { parseFloat(style.paddingLeft) - parseFloat(style.paddingRight) - toolbarChildrenWidth; @@ -134,11 +134,11 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317 this.#target == this.#toolbar ? toolbarChildrenWidth - : sumChildrenInlineSize(this.#target); -+ : sumChildrenInlineSize(this.#target, win.gZenVerticalTabsManager._topButtonsSeparatorElement); ++ : sumChildrenInlineSize((win.gZenVerticalTabsManager._hasSetSingleToolbar && this.#target.id == 'nav-bar-customization-target') ? win.document.getElementById("zen-sidebar-top-buttons-customization-target") : this.#target, win.gZenVerticalTabsManager._topButtonsSeparatorElement); }); lazy.log.debug( -@@ -6497,7 +6496,8 @@ class OverflowableToolbar { +@@ -6854,7 +6853,8 @@ class OverflowableToolbar { // If the target has min-width: 0, their children might actually overflow // it, so check for both cases explicitly. let targetContentWidth = Math.max(targetWidth, targetChildrenWidth); @@ -148,7 +148,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317 return { isOverflowing, targetContentWidth, totalAvailWidth }; } -@@ -6591,7 +6591,7 @@ class OverflowableToolbar { +@@ -6948,7 +6948,7 @@ class OverflowableToolbar { } } if (!inserted) { @@ -157,7 +157,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317 } child.removeAttribute("cui-anchorid"); child.removeAttribute("overflowedItem"); -@@ -6753,6 +6753,9 @@ class OverflowableToolbar { +@@ -7110,6 +7110,9 @@ class OverflowableToolbar { * @param {MouseEvent} aEvent the click event. */ #onClickDefaultListButton(aEvent) { diff --git a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch index f6f9a953..ced98537 100644 --- a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs -index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb0bee29ea 100644 +index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b62e85eed4 100644 --- a/browser/components/urlbar/UrlbarInput.sys.mjs +++ b/browser/components/urlbar/UrlbarInput.sys.mjs @@ -67,6 +67,13 @@ XPCOMUtils.defineLazyPreferenceGetter( @@ -52,7 +52,18 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb } /** -@@ -1098,7 +1116,11 @@ export class UrlbarInput { +@@ -943,6 +961,10 @@ export class UrlbarInput { + // Nullify search mode before setURI so it won't try to restore it. + this.searchMode = null; + this.setURI(null, true, false, true); ++ if (this.hasAttribute("zen-floating-urlbar")) { ++ this.window.gBrowser.selectedBrowser.focus(); ++ return; ++ } + if (this.value && this.focused) { + this.select(); + } +@@ -1098,7 +1120,11 @@ export class UrlbarInput { } if (!this.#providesSearchMode(result)) { @@ -65,7 +76,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb } this.controller.recordSelectedResult(event, result); -@@ -2157,6 +2179,11 @@ export class UrlbarInput { +@@ -2157,6 +2183,11 @@ export class UrlbarInput { this.setAttribute("breakout-extend", "true"); @@ -77,7 +88,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb // Enable the animation only after the first extend call to ensure it // doesn't run when opening a new window. if (!this.hasAttribute("breakout-extend-animate")) { -@@ -2176,6 +2203,11 @@ export class UrlbarInput { +@@ -2176,6 +2207,11 @@ export class UrlbarInput { return; } @@ -89,7 +100,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb this.removeAttribute("breakout-extend"); this.#updateTextboxPosition(); } -@@ -2998,7 +3030,7 @@ export class UrlbarInput { +@@ -2998,7 +3034,7 @@ export class UrlbarInput { */ _trimValue(val) { let trimmedValue = lazy.UrlbarPrefs.get("trimURLs") @@ -98,7 +109,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb : val; // Only trim value if the directionality doesn't change to RTL and we're not // showing a strikeout https protocol. -@@ -3365,7 +3397,7 @@ export class UrlbarInput { +@@ -3365,7 +3401,7 @@ export class UrlbarInput { } else { where = lazy.BrowserUtils.whereToOpenLink(event, false, false); } @@ -107,7 +118,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb if (where == "current") { where = "tab"; } else if (where == "tab") { -@@ -3380,6 +3412,9 @@ export class UrlbarInput { +@@ -3380,6 +3416,9 @@ export class UrlbarInput { ) { where = "current"; } @@ -117,7 +128,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb return where; } -@@ -3921,6 +3956,11 @@ export class UrlbarInput { +@@ -3921,6 +3960,11 @@ export class UrlbarInput { } _on_click(event) { @@ -129,7 +140,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb if ( event.target == this.inputField || event.target == this._inputContainer || -@@ -3992,7 +4032,7 @@ export class UrlbarInput { +@@ -3992,7 +4036,7 @@ export class UrlbarInput { } } @@ -138,7 +149,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb this.view.autoOpen({ event }); } else { if (this._untrimOnFocusAfterKeydown) { -@@ -4032,9 +4072,12 @@ export class UrlbarInput { +@@ -4032,9 +4076,12 @@ export class UrlbarInput { } _on_mousedown(event) { @@ -152,7 +163,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb if ( event.target != this.inputField && -@@ -4044,8 +4087,8 @@ export class UrlbarInput { +@@ -4044,8 +4091,8 @@ export class UrlbarInput { break; }