summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_common.m
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-02-03 14:00:11 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-02-03 14:04:13 +0100
commit37c83abe61b468810624f12374e5faced4efb70b (patch)
tree81a2923f0312ea6d6f7c8e5ea5a55e75686e78e5 /video/out/cocoa_common.m
parent530036e5b34788d23dabadb8896f8e41e8f612d8 (diff)
downloadmpv-37c83abe61b468810624f12374e5faced4efb70b.tar.bz2
mpv-37c83abe61b468810624f12374e5faced4efb70b.tar.xz
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
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r--video/out/cocoa_common.m8
1 files changed, 4 insertions, 4 deletions
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];
}
}