0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

cocoa: don't constrain window frame for fullscreen

our constrainFrameRect prevents our window from positioning itself ontop
of the menubar, which is unwanted for a fullscreen window. this always
positioned our window vertically at -22/-23pt when going into fullscreen
because of the menubar. this bug doesn't show on newer versions of OS X
since the various flags we set force the window position. on OS X 10.9
though the fullscreen window was shifted 22pt downwards. even though
this bug doesn't show on newer OS X versions, it should still be fixed
for a possible behaviour changes in future version.

Fixes #4044
This commit is contained in:
Akemi 2017-01-16 17:51:16 +01:00
parent 9490b628c5
commit 717ee3ddba

View File

@ -299,11 +299,12 @@
- (NSRect)constrainFrameRect:(NSRect)nf toScreen:(NSScreen *)screen
{
if (_is_animating)
screen = [self targetScreen];
if (_is_animating && ![self.adapter isInFullScreenMode])
return nf;
screen = screen ?: self.screen ?: [NSScreen mainScreen];
NSRect of = [self frame];
NSRect vf = [screen ?: self.screen ?: [NSScreen mainScreen] visibleFrame];
NSRect vf = [_is_animating ? [self targetScreen] : screen visibleFrame];
NSRect ncf = [self contentRectForFrameRect:nf];
// Prevent the window's titlebar from exiting the screen on the top edge.