summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-06-24 23:03:56 +0200
committerwm4 <wm4@nowhere>2012-09-18 21:08:20 +0200
commit09c5324314d941355523dd5e78842495877d5696 (patch)
tree27e4149cb4e070e218da65181c66cba3260ab3fb
parentf5b8b6ac126d8cef3860db16d3db8e72507a2258 (diff)
downloadmpv-09c5324314d941355523dd5e78842495877d5696.tar.bz2
mpv-09c5324314d941355523dd5e78842495877d5696.tar.xz
cocoa_common: make fullscreen menubar/dock hiding conditional
cocoa_common was hiding the dock and menubar unconditionally when going fullscreen. This means they were hidden even if they weren't on the screen mplayer2 was going fullscreen on, resulting in poor user experience. Change the fullscreen function in the cocoa backend to check that mplayer2 is on the same screen as the menubar/dock before hiding them.
-rw-r--r--libvo/cocoa_common.m10
1 files changed, 9 insertions, 1 deletions
diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m
index d1e835105e..331072afcf 100644
--- a/libvo/cocoa_common.m
+++ b/libvo/cocoa_common.m
@@ -189,6 +189,13 @@ void vo_cocoa_uninit(struct vo *vo)
s = nil;
}
+static int current_screen_has_dock_or_menubar(void)
+{
+ NSRect f = s->screen_frame;
+ NSRect vf = [s->screen_handle visibleFrame];
+ return f.size.height > vf.size.height || f.size.width > vf.size.width;
+}
+
void update_screen_info(void)
{
s->screen_array = [NSScreen screens];
@@ -510,7 +517,8 @@ void create_menu()
{
if (!vo_fs) {
update_screen_info();
- [NSApp setPresentationOptions:NSApplicationPresentationHideDock|NSApplicationPresentationHideMenuBar];
+ if (current_screen_has_dock_or_menubar())
+ [NSApp setPresentationOptions:NSApplicationPresentationHideDock|NSApplicationPresentationHideMenuBar];
s->windowed_frame = [self frame];
[self setHasShadow:NO];
[self setStyleMask:s->fullscreen_mask];