diff --git a/src/widget/cocoa/nsCocoaWindow-mm.patch b/src/widget/cocoa/nsCocoaWindow-mm.patch new file mode 100644 index 000000000..f508116d8 --- /dev/null +++ b/src/widget/cocoa/nsCocoaWindow-mm.patch @@ -0,0 +1,14 @@ +diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm +index 3e58a40d747fb3e05bd67518b41b6467725cfe42..995419b6390e8abe663f71f8fb26281eae56aa84 100644 +--- a/widget/cocoa/nsCocoaWindow.mm ++++ b/widget/cocoa/nsCocoaWindow.mm +@@ -5329,6 +5329,9 @@ static unsigned int WindowMaskForBorderStyle(BorderStyle aBorderStyle) { + case nsIWidget::eDocumentWindowAnimation: + behavior = NSWindowAnimationBehaviorDocumentWindow; + break; ++ case nsIWidget::eZenUtilityWindowAnimation: ++ behavior = NSWindowAnimationBehaviorUtilityWindow; ++ break; + default: + MOZ_FALLTHROUGH_ASSERT("unexpected mAnimationType value"); + case nsIWidget::eGenericWindowAnimation: diff --git a/src/widget/nsIWidget-h.patch b/src/widget/nsIWidget-h.patch new file mode 100644 index 000000000..be7e62916 --- /dev/null +++ b/src/widget/nsIWidget-h.patch @@ -0,0 +1,12 @@ +diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h +index 4a5d933d865585ea772bafd233f7d4ebce3ac02b..3eae20d579330a71196c83eeb20d8fb2cd9f5fae 100644 +--- a/widget/nsIWidget.h ++++ b/widget/nsIWidget.h +@@ -1118,6 +1118,7 @@ class nsIWidget : public nsSupportsWeakReference { + virtual void SetSupportsNativeFullscreen(bool aSupportsNativeFullscreen) {} + + enum WindowAnimationType { ++ eZenUtilityWindowAnimation, + eGenericWindowAnimation, + eDocumentWindowAnimation + }; diff --git a/src/xpfe/appshell/AppWindow-cpp.patch b/src/xpfe/appshell/AppWindow-cpp.patch index a3b335610..4ae078885 100644 --- a/src/xpfe/appshell/AppWindow-cpp.patch +++ b/src/xpfe/appshell/AppWindow-cpp.patch @@ -1,8 +1,17 @@ diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp -index d980bca7b42bb8d81817756215067771d2793bfe..94992e9d96348e4c88e089e4cdc3234076efb656 100644 +index d980bca7b42bb8d81817756215067771d2793bfe..06818048ce6752a8b55faa3144c934fadbc46a68 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp -@@ -1847,7 +1847,7 @@ nsresult AppWindow::MaybeSaveEarlyWindowPersistentValues( +@@ -1564,6 +1564,8 @@ void AppWindow::SyncAttributesToWidget() { + windowElement->GetAttribute(u"macanimationtype"_ns, attr); + if (attr.EqualsLiteral("document")) { + mWindow->SetWindowAnimationType(nsIWidget::eDocumentWindowAnimation); ++ } else if (attr.EqualsLiteral("zen:utilities")) { ++ mWindow->SetWindowAnimationType(nsIWidget::eZenUtilityWindowAnimation); + } + + // Check if the client size did change and if we want to restore it. +@@ -1847,7 +1849,7 @@ nsresult AppWindow::MaybeSaveEarlyWindowPersistentValues( } } diff --git a/src/zen/boosts/ZenBoostsManager.sys.mjs b/src/zen/boosts/ZenBoostsManager.sys.mjs index 0a84833d1..fc4b293d9 100644 --- a/src/zen/boosts/ZenBoostsManager.sys.mjs +++ b/src/zen/boosts/ZenBoostsManager.sys.mjs @@ -640,21 +640,10 @@ class nsZenBoostsManager { } } - const editor = Services.ww.openWindow( - parentWindow, + const editor = parentWindow.openDialog( "chrome://browser/content/zen-components/windows/zen-boost-editor.xhtml", - null, - `left=${left},top=${top},chrome,alwaysontop,resizable=no,minimizable=no,dependent,dialog=yes`, - null - ); - - // Close the editor if the tab is switched - parentWindow.gBrowser.tabContainer.addEventListener( - "TabSelect", - editor.close.bind(editor), - { - once: true, - } + "", + `left=${left},top=${top},chrome,alwaysontop,resizable=no,minimizable=no,dependent,dialog=yes` ); const progressListener = { @@ -671,7 +660,6 @@ class nsZenBoostsManager { // Give the domain editor.domain = domain; editor.openerWindow = parentWindow; - editor.focus(); // Make boost active this.makeBoostActiveForDomain(domain, boost.id); diff --git a/src/zen/boosts/zen-boost-editor.inc.xhtml b/src/zen/boosts/zen-boost-editor.inc.xhtml index 9cd64e411..b4651f0bc 100644 --- a/src/zen/boosts/zen-boost-editor.inc.xhtml +++ b/src/zen/boosts/zen-boost-editor.inc.xhtml @@ -18,7 +18,7 @@ customtitlebar="true" sizemode="normal" scrolling="false" - macanimationtype="document" + macanimationtype="zen:utilities" windowsmica="true" data-l10n-sync="true"> diff --git a/src/zen/urlbar/ZenSiteDataPanel.sys.mjs b/src/zen/urlbar/ZenSiteDataPanel.sys.mjs index 90e037b09..f22b69094 100644 --- a/src/zen/urlbar/ZenSiteDataPanel.sys.mjs +++ b/src/zen/urlbar/ZenSiteDataPanel.sys.mjs @@ -887,8 +887,8 @@ export class nsZenSiteDataPanel { domain, boostId ); - lazy.gZenBoostsManager.openBoostWindow(this.window, boost, uri); this.unifiedPanel.hidePopup(); + lazy.gZenBoostsManager.openBoostWindow(this.window, boost, uri); break; } }