diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index 6c7bbf089ce0..46a0c13f552e 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -141,6 +141,15 @@ class APZCTreeManager; // format since at least OS X 10.5. - (void)_tileTitlebarAndRedisplay:(BOOL)redisplay; +// The following undocumented methods are used to work around bug 1069658, +// which is an Apple bug or design flaw that effects Yosemite. None of them +// were present prior to Yosemite (OS X 10.10). +- (NSView *)titlebarView; // Method of NSThemeFrame +- (NSView *)titlebarContainerView; // Method of NSThemeFrame +- (BOOL)transparent; // Method of NSTitlebarView and NSTitlebarContainerView +- (void)setTransparent:(BOOL)transparent; // Method of NSTitlebarView and + // NSTitlebarContainerView + @end #if !defined(MAC_OS_X_VERSION_10_6) || \ diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index 477368dbd6d1..d83c9050df73 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -2256,6 +2256,29 @@ nsCocoaWindow::ExecuteNativeKeyBinding(NativeKeyBindingsType aType, } mGeckoWindow->EnteredFullScreen(true); + + // On Yosemite, the NSThemeFrame class has two new properties -- + // titlebarView (an NSTitlebarView object) and titlebarContainerView (an + // NSTitlebarContainerView object). These are used to display the titlebar + // in fullscreen mode. In Safari they're not transparent. But in Firefox + // for some reason they are, which causes bug 1069658. The following code + // works around this Apple bug or design flaw. + NSWindow *window = (NSWindow *) [notification object]; + NSView *frameView = [[window contentView] superview]; + NSView *titlebarView = nil; + NSView *titlebarContainerView = nil; + if ([frameView respondsToSelector:@selector(titlebarView)]) { + titlebarView = [frameView titlebarView]; + } + if ([frameView respondsToSelector:@selector(titlebarContainerView)]) { + titlebarContainerView = [frameView titlebarContainerView]; + } + if ([titlebarView respondsToSelector:@selector(setTransparent:)]) { + [titlebarView setTransparent:NO]; + } + if ([titlebarContainerView respondsToSelector:@selector(setTransparent:)]) { + [titlebarContainerView setTransparent:NO]; + } } - (void)windowDidExitFullScreen:(NSNotification *)notification