diff options
author | wm4 <wm4@nowhere> | 2015-10-11 16:13:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-11 16:19:08 +0200 |
commit | 94b6a1054e6cd72b016d8a23fca56d76eaca629b (patch) | |
tree | 4fe394d9d5b46b455473da323ea4fd2a1e51c6f7 | |
parent | d714c8380abec5bfc6b0a9aa3e5ee82979860cf1 (diff) | |
download | mpv-94b6a1054e6cd72b016d8a23fca56d76eaca629b.tar.bz2 mpv-94b6a1054e6cd72b016d8a23fca56d76eaca629b.tar.xz |
cocoa: set application policy before creating window
This fixes a regression since commit f4d62da8. The original code run
vo_cocoa_config_window() once without creating the window, which had the
effect that the last part of the function was run at least once before
the actual window was created. Fix the regression by moving it to before
the window is created.
The regression itself is hard to describe. One test case: start mpv from
a fullscreened terminal window. It should switch to another desktop,
with the mpv window visible. This didn't happen anymore.
-rw-r--r-- | video/out/cocoa_common.m | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index d4f70c9f90..022520665a 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -265,6 +265,10 @@ void vo_cocoa_init(struct vo *vo) pthread_cond_init(&s->wakeup, NULL); vo->cocoa = s; cocoa_init_light_sensor(vo); + if (!s->embedded) { + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + set_application_icon(NSApp); + } } static int vo_cocoa_set_cursor_visibility(struct vo *vo, bool *visible) @@ -592,11 +596,6 @@ int vo_cocoa_config_window(struct vo *vo) vo->dheight = s->vo_dheight = frame.size.height; [s->nsgl_ctx update]; - - if (!s->embedded) { - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; - set_application_icon(NSApp); - } }); return 0; } |