Commit e568e69e authored by David Fuhrmann's avatar David Fuhrmann

macosx: add workaround to avoid grey or transparent top bars in fullscreen mode

close #9469
parent 2477d7d0
......@@ -229,6 +229,39 @@
return nil;
}
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
{
if (!screen)
screen = [self screen];
NSRect screenRect = [screen frame];
NSRect constrainedRect = [super constrainFrameRect:frameRect toScreen:screen];
/*
* Ugly workaround!
* With Mavericks, there is a nasty bug resulting in grey bars on top in fullscreen mode.
* It looks like this is enforced by the os because the window is in the way for the menu bar.
*
* According to the documentation, this constraining can be changed by overwriting this
* method. But in this situation, even the received frameRect is already contrained with the
* menu bars height substracted. This case is detected here, and the full height is
* enforced again.
*
* See #9469 and radar://15583566
*/
BOOL b_inFullscreen = [self fullscreen] || ([self respondsToSelector:@selector(inFullscreenTransition)] && [(VLCVideoWindowCommon *)self inFullscreenTransition]);
if(OSX_MAVERICKS && b_inFullscreen && constrainedRect.size.width == screenRect.size.width
&& constrainedRect.size.height != screenRect.size.height
&& abs(screenRect.size.height - constrainedRect.size.height) <= 25.) {
msg_Dbg(VLCIntf, "Contrain window height %.1f to screen height %.1f",
constrainedRect.size.height, screenRect.size.height);
constrainedRect.size.height = screenRect.size.height;
}
return constrainedRect;
}
@end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment