diff options
author | Brian Smith <brian@dbsoft.org> | 2023-03-29 02:46:32 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2023-03-29 02:46:32 -0500 |
commit | c09fb2cd971e276eab401e52e9ed0a4ebd613c65 (patch) | |
tree | 6c1fe93f924a306748c9eb823ab7c35033b7ac3b /widget | |
parent | ad7ffc05250bda780a9fb7a368405b5880c1e7dd (diff) | |
download | uxp-c09fb2cd971e276eab401e52e9ed0a4ebd613c65.tar.gz |
No Issue - Fix drawing in titlebar on Mac when building with the Big Sur 11.0 SDK.
On Intel we build with the 10.12 SDK so this problem is avoided.
Also Pale Moon no longer supports drawing in the titlebar in the front end.
However Basilisk does and built for ARM the tabs were cut off by the native titlebar.
This uses the new APIs introduced in SDK 10.10 and 11.0 to draw in the titlebar.
Diffstat (limited to 'widget')
-rw-r--r-- | widget/cocoa/nsCocoaWindow.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index 47c65dc620..870e5f2647 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -3351,6 +3351,15 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior"; if ([self respondsToSelector:@selector(setBottomCornerRounded:)]) [self setBottomCornerRounded:YES]; + // setTitlebarAppearsTransparent is only on 10.10+ so make sure it responds + if ([self respondsToSelector:@selector(setTitlebarAppearsTransparent:)]) + [self setTitlebarAppearsTransparent:YES]; +#if defined(MAC_OS_VERSION_11_0) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 + if (nsCocoaFeatures::OnBigSurOrLater()) { + self.titlebarSeparatorStyle = NSTitlebarSeparatorStyleNone; + } +#endif + [self setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge]; [self setContentBorderThickness:0.0f forEdge:NSMaxYEdge]; } @@ -3527,6 +3536,11 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior"; BOOL stateChanged = ([self drawsContentsIntoWindowFrame] != aState); [super setDrawsContentsIntoWindowFrame:aState]; if (stateChanged && [[self delegate] isKindOfClass:[WindowDelegate class]]) { +#if defined(MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10 + // Also need to hide the window title, or it will draw over the custom titlebar + if ([self respondsToSelector:@selector(setTitleVisibility:)]) + [self setTitleVisibility:(aState ? NSWindowTitleHidden : NSWindowTitleVisible)]; +#endif // Here we extend / shrink our mainChildView. We do that by firing a resize // event which will cause the ChildView to be resized to the rect returned // by nsCocoaWindow::GetClientBounds. GetClientBounds bases its return |