From 37c83abe61b468810624f12374e5faced4efb70b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 3 Feb 2013 14:00:11 +0100 Subject: cocoa_common: fix `--ontop` behaviour when windowed Apply setLevel hacks for fullscreen switching with ontop active only in fullscreen. This keeps the window correctly on top even when losing focus. Fixes #21 I also reverted NSScreenSaverWindowLevel to NSNormalWindowLevel + 1, so that the cmd-tab UI is visible --- video/out/cocoa_common.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video') diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 9ac1334c7f..15ccaac4c6 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -301,7 +301,7 @@ static void vo_set_level(struct vo *vo, int ontop) { struct vo_cocoa_state *s = vo->cocoa; if (ontop) { - s->window_level = NSScreenSaverWindowLevel; + s->window_level = NSNormalWindowLevel + 1; } else { s->window_level = NSNormalWindowLevel; } @@ -824,9 +824,9 @@ void create_menu() - (void)applicationWillBecomeActive:(NSNotification *)aNotification { - struct vo_cocoa_state *s = _vo->cocoa; - [self setLevel:s->window_level]; if (vo_fs && current_screen_has_dock_or_menubar(_vo)) { + struct vo_cocoa_state *s = _vo->cocoa; + [self setLevel:s->window_level]; [NSApp setPresentationOptions:NSApplicationPresentationHideDock| NSApplicationPresentationHideMenuBar]; } @@ -834,8 +834,8 @@ void create_menu() - (void)applicationWillResignActive:(NSNotification *)aNotification { - [self setLevel:NSNormalWindowLevel]; if (vo_fs) { + [self setLevel:NSNormalWindowLevel]; [NSApp setPresentationOptions:NSApplicationPresentationDefault]; } } -- cgit v1.2.3