no-bug: Open boosts editor with util window animations

This commit is contained in:
mr. m
2026-06-08 12:22:58 +02:00
parent 965bb9391d
commit c3aba894bb
6 changed files with 42 additions and 19 deletions

View File

@@ -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:

View File

@@ -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
};

View File

@@ -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(
}
}

View File

@@ -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);

View File

@@ -18,7 +18,7 @@
customtitlebar="true"
sizemode="normal"
scrolling="false"
macanimationtype="document"
macanimationtype="zen:utilities"
windowsmica="true"
data-l10n-sync="true">
<head>

View File

@@ -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;
}
}