From 954625c1655ae9e0c016d6c5ea902ed369510c71 Mon Sep 17 00:00:00 2001 From: Akemi Date: Thu, 19 Jan 2017 20:51:35 +0100 Subject: 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 --- video/out/cocoa_common.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'video') 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) -- cgit v1.2.3