cocoa: don't change Space on quit in fullscreen

circumvent undefined behavior when quitting in
fullscreen.

Fixes #3957
This commit is contained in:
Akemi
2017-01-11 15:00:47 +01:00
parent 449eb208f4
commit fee5ceccad
+10 -6
View File
@@ -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];