diff options
author | Akemi <der.richter@gmx.de> | 2017-01-19 20:51:35 +0100 |
---|---|---|
committer | Akemi <der.richter@gmx.de> | 2017-01-29 19:46:53 +0100 |
commit | 954625c1655ae9e0c016d6c5ea902ed369510c71 (patch) | |
tree | 786b67caceb13e8648e2d5171e611bf5bae56254 /video/out/cocoa_common.m | |
parent | bed94df52186ab27e62746f5b849ec2e0f320ff3 (diff) | |
download | mpv-954625c1655ae9e0c016d6c5ea902ed369510c71.tar.bz2 mpv-954625c1655ae9e0c016d6c5ea902ed369510c71.tar.xz |
cocoa: fix unwanted behavior with window level other than the default
setting a window level other than NSNormalWindowLevel always sets
NSWindowCollectionBehaviorTransient, which prevents certain things to
work properly. examples are automatic switching to the active Space when
mpv is made active and (de-)miniaturizing. latter always lead to a
vanishing window.
Fixes #1757 #1884
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 2d4a4c517c..7eeb7163a1 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -478,8 +478,10 @@ static void vo_set_level(struct vo *vo, int ontop) s->window_level = NSNormalWindowLevel; } - [[s->view window] setLevel:s->window_level]; - [s->window setLevel:s->window_level]; + [s->window setLevel:s->window_level]; + NSWindowCollectionBehavior behavior = [s->window collectionBehavior] & + ~NSWindowCollectionBehaviorTransient; + [s->window setCollectionBehavior:behavior|NSWindowCollectionBehaviorManaged]; } static int vo_cocoa_ontop(struct vo *vo) |