Bug 1069658 - The slide-down titlebar in fullscreen mode is transparent on Yosemite. r=mstange

This commit is contained in:
Steven Michaud 2014-10-13 17:05:59 -05:00
parent b8f030ed40
commit 3820df645b
2 changed files with 32 additions and 0 deletions

View File

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

View File

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