commit 8717aee74a6ca27c66506dfc69c195534bb176cc
parent 322b5f92161a253db5120f452de1b995f212413d
Author: Sam Johnson <sam@scj.me>
Date: Tue, 7 Oct 2025 07:27:47 +0000
Bug 1991240 - Restore unified toolbar appearance in macOS Tahoe. r=desktop-theme-reviewers,emilio
In Tahoe, the titlebar material is no longer used on the titlebar itself, rather, the window background material is used. Therefore, no titlebar material needs to be drawn in the toolbar.
The titlebar separator is removed in Tahoe by making the titlebar transparent, as NSTitlebarSeparatorStyleNone no longer removes it. Due to the above, this does not change the titlebar appearance other than removing the separator.
Differential Revision: https://phabricator.services.mozilla.com/D267166
Diffstat:
4 files changed, 48 insertions(+), 16 deletions(-)
diff --git a/browser/themes/osx/places/organizer.css b/browser/themes/osx/places/organizer.css
@@ -11,13 +11,15 @@
padding: 4px 4px 3px;
border-bottom: 1px solid ThreeDShadow;
- &::after {
- content: "";
- position: absolute;
- inset: 0;
- appearance: auto;
- -moz-default-appearance: -moz-window-titlebar;
- z-index: -1;
+ @media not (-moz-mac-tahoe-theme) {
+ &::after {
+ content: "";
+ position: absolute;
+ inset: 0;
+ appearance: auto;
+ -moz-default-appearance: -moz-window-titlebar;
+ z-index: -1;
+ }
}
}
diff --git a/browser/themes/shared/pageInfo.css b/browser/themes/shared/pageInfo.css
@@ -14,13 +14,15 @@
align-items: center;
justify-content: center;
- &::after {
- content: "";
- position: absolute;
- inset: 0;
- appearance: auto;
- -moz-default-appearance: -moz-window-titlebar;
- z-index: -1;
+ @media not (-moz-mac-tahoe-theme) {
+ &::after {
+ content: "";
+ position: absolute;
+ inset: 0;
+ appearance: auto;
+ -moz-default-appearance: -moz-window-titlebar;
+ z-index: -1;
+ }
}
}
}
diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h
@@ -111,6 +111,9 @@ class TextInputHandler;
- (void)setEffectViewWrapperForStyle:(mozilla::WindowShadow)aStyle;
@property(nonatomic) mozilla::WindowShadow shadowStyle;
+- (void)updateTitlebarTransparency;
+- (void)setTitlebarSeparatorStyle:(NSTitlebarSeparatorStyle)aStyle API_AVAILABLE(macos(11.0));
+
- (void)releaseJSObjects;
@end
diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm
@@ -7721,6 +7721,7 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
mDrawsIntoWindowFrame = aState;
if (changed) {
[self reflowTitlebarElements];
+ [self updateTitlebarTransparency];
}
}
@@ -7850,6 +7851,32 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
}
}
+- (void)updateTitlebarTransparency {
+ if (self.drawsContentsIntoWindowFrame) {
+ // Hide the titlebar if we are drawing into it
+ self.titlebarAppearsTransparent = true;
+ return;
+ }
+
+ if (@available(macOS 26.0, *)) {
+ // On macOS 26, the titlebar must be transparent to hide the separator.
+ // This does not affect the titlebar background on macOS 26, as it
+ // already matches the window background even when not transparent.
+ if (self.titlebarSeparatorStyle == NSTitlebarSeparatorStyleNone) {
+ self.titlebarAppearsTransparent = true;
+ return;
+ }
+ }
+
+ // Show the titlebar otherwise.
+ self.titlebarAppearsTransparent = false;
+}
+
+- (void)setTitlebarSeparatorStyle:(NSTitlebarSeparatorStyle)aStyle {
+ [super setTitlebarSeparatorStyle:aStyle];
+ [self updateTitlebarTransparency];
+}
+
- (BOOL)respondsToSelector:(SEL)aSelector {
// Claim the window doesn't respond to this so that the system
// doesn't steal keyboard equivalents for it. Bug 613710.
@@ -8166,8 +8193,6 @@ static CGFloat DefaultTitlebarHeight() {
BOOL stateChanged = self.drawsContentsIntoWindowFrame != aState;
[super setDrawsContentsIntoWindowFrame:aState];
if (stateChanged && [self.delegate isKindOfClass:[WindowDelegate class]]) {
- // Hide the titlebar if we are drawing into it
- self.titlebarAppearsTransparent = aState;
self.titleVisibility = aState ? NSWindowTitleHidden : NSWindowTitleVisible;
// Here we extend / shrink our mainChildView.