From e31d91282b6487a1ffe461f0be7354ba6f6da69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20G=C3=A4rtner?= <111643632+lmnek@users.noreply.github.com> Date: Mon, 2 Mar 2026 19:35:58 +0100 Subject: [PATCH 1/9] feat: add specific toast for copying URL as Markdown, p=#12588 --- locales/en-US/browser/browser/zen-general.ftl | 1 + src/zen/common/modules/ZenCommonUtils.mjs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/locales/en-US/browser/browser/zen-general.ftl b/locales/en-US/browser/browser/zen-general.ftl index f75f7b10a..ef3bbe3c5 100644 --- a/locales/en-US/browser/browser/zen-general.ftl +++ b/locales/en-US/browser/browser/zen-general.ftl @@ -47,6 +47,7 @@ pictureinpicture-minimize-btn = zen-panel-ui-gradient-generator-custom-color = Custom Color zen-copy-current-url-confirmation = Copied current URL! +zen-copy-current-url-as-markdown-confirmation = Copied current URL as Markdown! zen-general-cancel-label = .label = Cancel diff --git a/src/zen/common/modules/ZenCommonUtils.mjs b/src/zen/common/modules/ZenCommonUtils.mjs index cfa7f90e5..f4e7b8867 100644 --- a/src/zen/common/modules/ZenCommonUtils.mjs +++ b/src/zen/common/modules/ZenCommonUtils.mjs @@ -115,7 +115,7 @@ window.gZenCommonActions = { const tabTitle = gBrowser.selectedTab.label; const markdownLink = `[${tabTitle}](${currentUrl.displaySpec})`; ClipboardHelper.copyString(markdownLink); - gZenUIManager.showToast("zen-copy-current-url-confirmation", { timeout: 3000 }); + gZenUIManager.showToast("zen-copy-current-url-as-markdown-confirmation", { timeout: 3000 }); }, throttle(f, delay) { From ee5c1894ebf9a171257f1607cab429fb24e52580 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Tue, 3 Mar 2026 00:14:13 +0100 Subject: [PATCH 2/9] chore: Streamline surfer implementation to newer versions for win signs, b=no-bug, c=no-component --- build/windows/sign.ps1 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/build/windows/sign.ps1 b/build/windows/sign.ps1 index 5e5fc6645..749c33503 100644 --- a/build/windows/sign.ps1 +++ b/build/windows/sign.ps1 @@ -23,6 +23,9 @@ mkdir windsign-temp -ErrorAction SilentlyContinue # echo "Downloaded git objects repo to" #} -Verbose -ArgumentList $PWD -Debug +$env:SURFER_MOZCONFIG_ONLY="1" +$env:SURFER_SIGNING_MODE="" + Start-Job -Name "DownloadGitl10n" -ScriptBlock { param($PWD) cd $PWD @@ -31,14 +34,11 @@ Start-Job -Name "DownloadGitl10n" -ScriptBlock { echo "Fetched l10n and Firefox's one" } -Verbose -ArgumentList $PWD -Debug -Start-Job -Name "SurferInit" -ScriptBlock { - param($PWD) - cd $PWD - npm run import -- --verbose - $surferJson = Get-Content surfer.json | ConvertFrom-Json - $version = $surferJson.brands.release.release.displayVersion - npm run ci -- $version -} -Verbose -ArgumentList $PWD -Debug +$surferJson = Get-Content surfer.json | ConvertFrom-Json +$version = $surferJson.brands.release.release.displayVersion +npm run ci -- $version +npm run import -- --verbose +npm run build echo "Downloading artifacts info" $artifactsInfo=gh api repos/zen-browser/desktop/actions/runs/$GithubRunId/artifacts @@ -120,7 +120,6 @@ signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $fi $env:ZEN_RELEASE="true" $env:SURFER_SIGNING_MODE="true" $env:SCCACHE_GHA_ENABLED="false" -Wait-Job -Name "SurferInit" Wait-Job -Name "DownloadGitl10n" function SignAndPackage($name) { From 3831af027e2f48ca821bdb6bec91395e8818229f Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Tue, 3 Mar 2026 00:46:30 +0100 Subject: [PATCH 3/9] feat: Fixed wrong rendering when animating popover opens, b=no-bug, c=common --- .../firefox/native_macos_popovers.patch | 25 ++++++++----------- src/zen/common/styles/zen-panel-ui.css | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/external-patches/firefox/native_macos_popovers.patch b/src/external-patches/firefox/native_macos_popovers.patch index 687cf9106..d317b9764 100644 --- a/src/external-patches/firefox/native_macos_popovers.patch +++ b/src/external-patches/firefox/native_macos_popovers.patch @@ -118,7 +118,7 @@ diff --git a/toolkit/themes/shared/global-shared.css b/toolkit/themes/shared/glo +/* stylelint-disable-next-line media-query-no-invalid */ +@media -moz-pref("widget.macos.native-popovers") and (-moz-platform: macos) { -+ panel:where([nativepopover="true"]) { ++ panel:not(:where([nonnativepopover="true"])) { + background-color: transparent; + --panel-background: transparent; + --panel-shadow: none; @@ -281,22 +281,19 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm NS_OBJC_BEGIN_TRY_IGNORE_BLOCK; if (!mWindow) { -@@ -5227,10 +5282,65 @@ +@@ -5227,10 +5282,63 @@ mWindow.contentView.needsDisplay = YES; if (!nativeParentWindow || mPopupLevel != PopupLevel::Parent) { [mWindow orderFront:nil]; } NS_OBJC_END_TRY_IGNORE_BLOCK; + nsMenuPopupFrame* popupFrame = GetPopupFrame(); -+ mozilla::ErrorResult rv; + if ([mWindow isKindOfClass:[PopupWindow class]] && + [(PopupWindow*)mWindow usePopover] && popupFrame && + popupFrame->ShouldFollowAnchor() && + !popupFrame->PopupElement().GetBoolAttr( + nsGkAtoms::nonnativepopover)) { + if (nativeParentWindow) { -+ popupFrame->PopupElement().SetXULBoolAttr(nsGkAtoms::nativepopover, -+ true, rv); + NSRectEdge preferredEdge = + AlignmentPositionToNSRectEdge(popupFrame->GetAlignmentPosition()); + nsRect anchorRectAppUnits = popupFrame->GetUntransformedAnchorRect(); @@ -339,15 +336,16 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm + return; + } + if (popupFrame) { -+ popupFrame->PopupElement().SetXULBoolAttr(nsGkAtoms::nativepopover, -+ false, rv); ++ mozilla::ErrorResult rv; ++ popupFrame->PopupElement().SetXULBoolAttr(nsGkAtoms::nonnativepopover, ++ true, rv); + } // If our popup window is a non-native context menu, tell the OS (and // other programs) that a menu has opened. This is how the OS knows to // close other programs' context menus when ours open. if ([mWindow isKindOfClass:[PopupWindow class]] && [(PopupWindow*)mWindow isContextMenu]) { -@@ -5301,10 +5411,15 @@ +@@ -5301,10 +5409,15 @@ // of a window it hides the parent window. if (mWindowType == WindowType::Popup && nativeParentWindow) { [nativeParentWindow removeChildWindow:mWindow]; @@ -363,7 +361,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm // other programs) that a menu has closed. if ([mWindow isKindOfClass:[PopupWindow class]] && [(PopupWindow*)mWindow isContextMenu]) { -@@ -5351,10 +5466,17 @@ +@@ -5351,10 +5464,17 @@ return false; } return nsIWidget::ShouldUseOffMainThreadCompositing(); @@ -381,7 +379,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm return mWindow.isOpaque ? TransparencyMode::Opaque : TransparencyMode::Transparent; -@@ -6313,10 +6435,20 @@ +@@ -6313,10 +6433,20 @@ // We ignore aRepaint -- we have to call display:YES, otherwise the // title bar doesn't immediately get repainted and is displayed in // the wrong place, leading to a visual jump. @@ -402,7 +400,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm void nsCocoaWindow::Resize(const DesktopRect& aRect, bool aRepaint) { DoResize(aRect.x, aRect.y, aRect.width, aRect.height, aRepaint, false); -@@ -8277,18 +8409,27 @@ +@@ -8277,18 +8407,27 @@ backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation { NS_OBJC_BEGIN_TRY_BLOCK_RETURN; @@ -430,7 +428,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm // Return 0 in order to match what the system does for sheet windows and // _NSPopoverWindows. - (CGFloat)_backdropBleedAmount { -@@ -8342,10 +8483,120 @@ +@@ -8342,10 +8481,120 @@ - (void)setIsContextMenu:(BOOL)flag { mIsContextMenu = flag; @@ -566,14 +564,13 @@ diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py Atom("highest", "highest"), Atom("horizontal", "horizontal"), Atom("hover", "hover"), -@@ -756,10 +757,12 @@ +@@ -756,10 +757,11 @@ Atom("nohref", "nohref"), Atom("noinitialselection", "noinitialselection"), Atom("nomodule", "nomodule"), Atom("nonce", "nonce"), Atom("none", "none"), + Atom("nonnativepopover", "nonnativepopover"), -+ Atom("nativepopover", "nativepopover"), Atom("noresize", "noresize"), Atom("normal", "normal"), Atom("normalizeSpace", "normalize-space"), diff --git a/src/zen/common/styles/zen-panel-ui.css b/src/zen/common/styles/zen-panel-ui.css index 10788b3d0..e232d68ff 100644 --- a/src/zen/common/styles/zen-panel-ui.css +++ b/src/zen/common/styles/zen-panel-ui.css @@ -30,7 +30,7 @@ panel[type="arrow"]:not(#feature-callout) { } @media (-moz-platform: macos) { - &:where(:not([nativepopover="true"])) { + &:where([nonnativepopover="true"]) { appearance: auto !important; -moz-default-appearance: menupopup; /* We set the default background here, rather than on ::part(content), From 5a91c0c70bd7786133d8f92ef2070a6175d20fcc Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Tue, 3 Mar 2026 00:49:55 +0100 Subject: [PATCH 4/9] feat: Add more spacings between the essentials paddings, b=no-bug, c=tabs --- src/zen/tabs/zen-tabs/vertical-tabs.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index 000b0ab22..6e9591802 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -1137,7 +1137,8 @@ position: absolute; :root[zen-single-toolbar="true"] &:not(:empty) { - padding-top: 4px; + padding-top: 6px; + padding-bottom: 2px; } &[hidden="true"] { From 5ffb2d8d6997537ed4ec43f688dfac5ed87544c5 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Tue, 3 Mar 2026 01:01:19 +0100 Subject: [PATCH 5/9] feat: Don't search clipboard content when middle clicking the sidebar, b=no-bug, c=no-component --- .../base/content/navigator-toolbox-js.patch | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/browser/base/content/navigator-toolbox-js.patch b/src/browser/base/content/navigator-toolbox-js.patch index e29a351e4..15afc4341 100644 --- a/src/browser/base/content/navigator-toolbox-js.patch +++ b/src/browser/base/content/navigator-toolbox-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/base/content/navigator-toolbox.js b/browser/base/content/navigator-toolbox.js -index 15469e9d9b91c1eaef2578c9e43b6999edac3392..553402b41bc15f7cd99bf87c54416dc66d7c03e7 100644 +index 15469e9d9b91c1eaef2578c9e43b6999edac3392..95ae5036b57baeb5237603c0921f1e9252af6919 100644 --- a/browser/base/content/navigator-toolbox.js +++ b/browser/base/content/navigator-toolbox.js @@ -6,7 +6,7 @@ @@ -19,15 +19,25 @@ index 15469e9d9b91c1eaef2578c9e43b6999edac3392..553402b41bc15f7cd99bf87c54416dc6 #picture-in-picture-button, #urlbar-zoom-button, #star-button-box, -@@ -206,6 +207,7 @@ document.addEventListener( - case "vertical-tabs-newtab-button": - case "tabs-newtab-button": - case "new-tab-button": -+ case "zen-tabs-wrapper": +@@ -209,6 +210,17 @@ document.addEventListener( gBrowser.handleNewTabMiddleClick(element, event); break; -@@ -318,6 +320,7 @@ document.addEventListener( ++ case "zen-tabs-wrapper": ++ if (event.button == 1) { ++ BrowserCommands.openTab(); ++ // Stop the propagation of the click event, to prevent the event from being ++ // handled more than once. ++ // E.g. see https://bugzilla.mozilla.org/show_bug.cgi?id=1657992#c4 ++ event.stopPropagation(); ++ event.preventDefault(); ++ } ++ break; ++ + case "back-button": + case "forward-button": + case "reload-button": +@@ -318,6 +330,7 @@ document.addEventListener( #downloads-button, #fxa-toolbar-menu-button, #unified-extensions-button, @@ -35,7 +45,7 @@ index 15469e9d9b91c1eaef2578c9e43b6999edac3392..553402b41bc15f7cd99bf87c54416dc6 #library-button, #split-view-button `); -@@ -401,6 +404,16 @@ document.addEventListener( +@@ -401,6 +414,16 @@ document.addEventListener( gUnifiedExtensions.togglePanel(event); break; From ad74b55dbfe44ea5760932b3f582e396dcb6c8d5 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:28:32 +0100 Subject: [PATCH 6/9] Revert "fix: github folder not getting pr list, p=#12578, c=folders", p=#12599 --- .../browser/browser/zen-live-folders.ftl | 3 ++ .../base/content/zen-panels/popups.inc | 4 ++ src/zen/live-folders/ZenLiveFolder.sys.mjs | 2 + .../ZenLiveFoldersManager.sys.mjs | 4 ++ .../providers/GithubLiveFolder.sys.mjs | 42 ++++++++++++------- 5 files changed, 39 insertions(+), 16 deletions(-) diff --git a/locales/en-US/browser/browser/zen-live-folders.ftl b/locales/en-US/browser/browser/zen-live-folders.ftl index bf02ed00e..79988c1dc 100644 --- a/locales/en-US/browser/browser/zen-live-folders.ftl +++ b/locales/en-US/browser/browser/zen-live-folders.ftl @@ -91,6 +91,9 @@ zen-live-folder-github-option-repo = zen-live-folder-github-pull-requests = .label = Pull Requests +zen-live-folder-github-issues = + .label = Issues + zen-live-folder-github-option-repo-list-note = .label = This list is generated based on your currently active pull requests. diff --git a/src/browser/base/content/zen-panels/popups.inc b/src/browser/base/content/zen-panels/popups.inc index b98b0cdb9..42dcbe14d 100644 --- a/src/browser/base/content/zen-panels/popups.inc +++ b/src/browser/base/content/zen-panels/popups.inc @@ -9,6 +9,10 @@ data-l10n-id="zen-live-folder-github-pull-requests" command="cmd_zenNewLiveFolder" image="chrome://browser/skin/zen-icons/selectable/logo-github.svg" /> + Date: Tue, 3 Mar 2026 11:52:12 +0100 Subject: [PATCH 7/9] feat: Make sure to trim down parameters before fetching github PRs, b=no-bug, c=folders --- src/zen/live-folders/providers/GithubLiveFolder.sys.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zen/live-folders/providers/GithubLiveFolder.sys.mjs b/src/zen/live-folders/providers/GithubLiveFolder.sys.mjs index 834738c9d..4667905c0 100644 --- a/src/zen/live-folders/providers/GithubLiveFolder.sys.mjs +++ b/src/zen/live-folders/providers/GithubLiveFolder.sys.mjs @@ -143,7 +143,7 @@ export class nsGithubLiveFolderProvider extends nsZenLiveFolderProvider { } } - searchParams.set("q", outputString); + searchParams.set("q", outputString.trim().replace(/ +(?= )/g, "")); return searchParams.toString(); } From 0d816b3cc2918324007d0f948a4c92a3034f909a Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Tue, 3 Mar 2026 22:51:57 +0100 Subject: [PATCH 8/9] chore: Sync external patches, p=#12607 --- .../firefox/native_macos_popovers.patch | 140 +++++++++++++++--- 1 file changed, 119 insertions(+), 21 deletions(-) diff --git a/src/external-patches/firefox/native_macos_popovers.patch b/src/external-patches/firefox/native_macos_popovers.patch index d317b9764..fa21c5dc9 100644 --- a/src/external-patches/firefox/native_macos_popovers.patch +++ b/src/external-patches/firefox/native_macos_popovers.patch @@ -1,7 +1,31 @@ diff --git a/browser/base/content/main-popupset.inc.xhtml b/browser/base/content/main-popupset.inc.xhtml --- a/browser/base/content/main-popupset.inc.xhtml +++ b/browser/base/content/main-popupset.inc.xhtml -@@ -556,10 +556,11 @@ +@@ -193,10 +193,11 @@ + + + + + + +@@ -204,10 +205,11 @@ + + + + + + + +@@ -556,10 +558,11 @@ type="arrow" orient="vertical" noautofocus="true" @@ -43,6 +67,40 @@ diff --git a/browser/components/customizableui/content/panelUI.inc.xhtml b/brows viewCacheId="appMenu-viewCache"> +diff --git a/dom/xul/XULPopupElement.cpp b/dom/xul/XULPopupElement.cpp +--- a/dom/xul/XULPopupElement.cpp ++++ b/dom/xul/XULPopupElement.cpp +@@ -84,10 +84,15 @@ + + void XULPopupElement::OpenPopupAtScreen(int32_t aXPos, int32_t aYPos, + bool aIsContextMenu, + Event* aTriggerEvent) { + nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); ++ // TODO(cheff): We do the same at nsCocoaWindow::Show but it doesn't seem ++ // to trigger a restyle so `appearance: auto` doesn't apply the native ++ // popover style. We should remove this and use the other implementation ++ // because this is a bit of a hack, not sure how reliable it is. ++ SetXULBoolAttr(nsGkAtoms::nonnativepopover, true, IgnoreErrors()); + if (pm) { + pm->ShowPopupAtScreen(this, aXPos, aYPos, aIsContextMenu, aTriggerEvent); + } + } + +@@ -96,10 +101,14 @@ + int32_t aWidth, int32_t aHeight, + bool aIsContextMenu, + bool aAttributesOverride, + Event* aTriggerEvent) { + nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); ++ // TODO: See OpenPopupAtScreen. We should remove this and use the other ++ // implementation because this is a bit of a hacky way to determine whether to ++ // use a native popover or not. ++ SetXULBoolAttr(nsGkAtoms::nonnativepopover, true, IgnoreErrors()); + if (pm) { + pm->ShowPopupAtScreenRect( + this, aPosition, nsIntRect(aXPos, aYPos, aWidth, aHeight), + aIsContextMenu, aAttributesOverride, aTriggerEvent); + } diff --git a/layout/xul/nsMenuPopupFrame.h b/layout/xul/nsMenuPopupFrame.h --- a/layout/xul/nsMenuPopupFrame.h +++ b/layout/xul/nsMenuPopupFrame.h @@ -176,7 +234,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h @interface BorderlessWindow : BaseWindow { } -@@ -201,10 +216,13 @@ +@@ -201,10 +216,14 @@ typedef nsIWidget Inherited; public: @@ -184,6 +242,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h + // Check if this window should use NSPopover for popup/menu display + bool ShouldUseNSPopover() const; ++ bool ShouldShowAsNSPopover() const override; + [[nodiscard]] nsresult Create(nsIWidget* aParent, const DesktopIntRect& aRect, const InitData&) override; @@ -281,18 +340,32 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm NS_OBJC_BEGIN_TRY_IGNORE_BLOCK; if (!mWindow) { -@@ -5227,10 +5282,63 @@ +@@ -5185,10 +5240,17 @@ + } + + NSWindow* nativeParentWindow = + mParent ? (NSWindow*)mParent->GetNativeData(NS_NATIVE_WINDOW) : nil; + ++ bool shouldUseNativePopover = false; ++ if (mWindowType == WindowType::Popup && aState) { ++ nsMenuPopupFrame* popupFrame = GetPopupFrame(); ++ popupFrame->PopupElement().SetXULBoolAttr( ++ nsGkAtoms::nonnativepopover, !ShouldShowAsNSPopover(), IgnoreErrors()); ++ } ++ + if (aState && !mBounds.IsEmpty()) { + // If we had set the activationPolicy to accessory, then right now we won't + // have a dock icon. Make sure that we undo that and show a dock icon now + // that we're going to show a window. + if (NSApp.activationPolicy != NSApplicationActivationPolicyRegular) { +@@ -5227,10 +5289,54 @@ mWindow.contentView.needsDisplay = YES; if (!nativeParentWindow || mPopupLevel != PopupLevel::Parent) { [mWindow orderFront:nil]; } NS_OBJC_END_TRY_IGNORE_BLOCK; -+ nsMenuPopupFrame* popupFrame = GetPopupFrame(); -+ if ([mWindow isKindOfClass:[PopupWindow class]] && -+ [(PopupWindow*)mWindow usePopover] && popupFrame && -+ popupFrame->ShouldFollowAnchor() && -+ !popupFrame->PopupElement().GetBoolAttr( -+ nsGkAtoms::nonnativepopover)) { ++ if (ShouldShowAsNSPopover()) { ++ nsMenuPopupFrame* popupFrame = GetPopupFrame(); + if (nativeParentWindow) { + NSRectEdge preferredEdge = + AlignmentPositionToNSRectEdge(popupFrame->GetAlignmentPosition()); @@ -334,18 +407,13 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm + SyncPopoverBounds([(PopupWindow*)mWindow popover], popupFrame); + } + return; -+ } -+ if (popupFrame) { -+ mozilla::ErrorResult rv; -+ popupFrame->PopupElement().SetXULBoolAttr(nsGkAtoms::nonnativepopover, -+ true, rv); + } // If our popup window is a non-native context menu, tell the OS (and // other programs) that a menu has opened. This is how the OS knows to // close other programs' context menus when ours open. if ([mWindow isKindOfClass:[PopupWindow class]] && [(PopupWindow*)mWindow isContextMenu]) { -@@ -5301,10 +5409,15 @@ +@@ -5301,10 +5407,15 @@ // of a window it hides the parent window. if (mWindowType == WindowType::Popup && nativeParentWindow) { [nativeParentWindow removeChildWindow:mWindow]; @@ -361,7 +429,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm // other programs) that a menu has closed. if ([mWindow isKindOfClass:[PopupWindow class]] && [(PopupWindow*)mWindow isContextMenu]) { -@@ -5351,10 +5464,17 @@ +@@ -5351,10 +5462,28 @@ return false; } return nsIWidget::ShouldUseOffMainThreadCompositing(); @@ -370,8 +438,19 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm +bool nsCocoaWindow::ShouldUseNSPopover() const { + // Use NSPopover for panel popups when the preference is enabled + // But not for detached popups - they should use traditional window logic -+ return mWindowType == WindowType::Popup && mPopupType == PopupType::Panel && -+ mozilla::StaticPrefs::widget_macos_native_popovers(); ++ return (mWindowType == WindowType::Popup && mPopupType == PopupType::Panel && ++ mozilla::StaticPrefs::widget_macos_native_popovers()); ++} ++ ++bool nsCocoaWindow::ShouldShowAsNSPopover() const { ++ if (!ShouldUseNSPopover()) { ++ return false; ++ } ++ nsMenuPopupFrame* popupFrame = GetPopupFrame(); ++ return [mWindow isKindOfClass:[PopupWindow class]] && ++ [(PopupWindow*)mWindow usePopover] && popupFrame && ++ popupFrame->ShouldFollowAnchor() && ++ !popupFrame->PopupElement().GetBoolAttr(nsGkAtoms::nonnativepopover); +} + TransparencyMode nsCocoaWindow::GetTransparencyMode() { @@ -379,7 +458,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm return mWindow.isOpaque ? TransparencyMode::Opaque : TransparencyMode::Transparent; -@@ -6313,10 +6433,20 @@ +@@ -6313,10 +6442,20 @@ // We ignore aRepaint -- we have to call display:YES, otherwise the // title bar doesn't immediately get repainted and is displayed in // the wrong place, leading to a visual jump. @@ -400,7 +479,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm void nsCocoaWindow::Resize(const DesktopRect& aRect, bool aRepaint) { DoResize(aRect.x, aRect.y, aRect.width, aRect.height, aRepaint, false); -@@ -8277,18 +8407,27 @@ +@@ -8277,18 +8416,27 @@ backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation { NS_OBJC_BEGIN_TRY_BLOCK_RETURN; @@ -428,7 +507,7 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm // Return 0 in order to match what the system does for sheet windows and // _NSPopoverWindows. - (CGFloat)_backdropBleedAmount { -@@ -8342,10 +8481,120 @@ +@@ -8342,10 +8490,120 @@ - (void)setIsContextMenu:(BOOL)flag { mIsContextMenu = flag; @@ -549,6 +628,25 @@ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm return NO; } +diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h +--- a/widget/nsIWidget.h ++++ b/widget/nsIWidget.h +@@ -836,10 +836,15 @@ + virtual void SuppressAnimation(bool aSuppress) {} + + /** Sets windows-specific mica backdrop on this widget. */ + virtual void SetMicaBackdrop(bool) {} + ++ /** ++ * Determine whether this widget should be shown as an NSPopover. ++ */ ++ virtual bool ShouldShowAsNSPopover() const { return false; } ++ + /** + * Return size mode (minimized, maximized, normalized). + * Returns a value from nsSizeMode (see nsIWidgetListener.h) + */ + virtual nsSizeMode SizeMode() = 0; diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py --- a/xpcom/ds/StaticAtoms.py +++ b/xpcom/ds/StaticAtoms.py From 84b7cf8ddd7b8c6fd4308b679acfff57612fba22 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Wed, 4 Mar 2026 07:31:01 +0100 Subject: [PATCH 9/9] fix: Also apply auto appearance to non arrow popups, b=no-bug, c=common --- src/zen/common/styles/zen-panel-ui.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zen/common/styles/zen-panel-ui.css b/src/zen/common/styles/zen-panel-ui.css index e232d68ff..a73437832 100644 --- a/src/zen/common/styles/zen-panel-ui.css +++ b/src/zen/common/styles/zen-panel-ui.css @@ -30,7 +30,7 @@ panel[type="arrow"]:not(#feature-callout) { } @media (-moz-platform: macos) { - &:where([nonnativepopover="true"]) { + &:where([nonnativepopover="true"], :not([type="arrow"])) { appearance: auto !important; -moz-default-appearance: menupopup; /* We set the default background here, rather than on ::part(content),