diff options
author | Akemi <der.richter@gmx.de> | 2016-12-29 20:04:44 +0100 |
---|---|---|
committer | Akemi <der.richter@gmx.de> | 2017-01-11 15:00:47 +0100 |
commit | fee5ceccad7d021503b278a7b5dd596efa030ba1 (patch) | |
tree | 76d2534e063cb4de02c46c0bd42f6786f13fca71 /video/out | |
parent | 449eb208f4d312c1bde616259d44d4d36112a603 (diff) | |
download | mpv-fee5ceccad7d021503b278a7b5dd596efa030ba1.tar.bz2 mpv-fee5ceccad7d021503b278a7b5dd596efa030ba1.tar.xz |
cocoa: don't change Space on quit in fullscreen
circumvent undefined behavior when quitting in
fullscreen.
Fixes #3957
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/cocoa_common.m | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 0b10217f80..d00d5d78c7 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -387,6 +387,16 @@ void vo_cocoa_uninit(struct vo *vo) pthread_cond_signal(&s->wakeup); pthread_mutex_unlock(&s->lock); + // close window beforehand to prevent undefined behavior when in fullscreen + // that resets the desktop to space 1 + run_on_main_thread(vo, ^{ + // if using --wid + libmpv there's no window to release + if (s->window) { + [s->window setDelegate:nil]; + [s->window close]; + } + }); + run_on_main_thread(vo, ^{ enable_power_management(s); vo_cocoa_uninit_displaylink(s); @@ -406,12 +416,6 @@ void vo_cocoa_uninit(struct vo *vo) [s->view removeFromSuperview]; [s->view release]; - // if using --wid + libmpv there's no window to release - if (s->window) { - [s->window setDelegate:nil]; - [s->window close]; - } - if (!s->embedded) [s->blankCursor release]; |