mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 14:29:25 +08:00
cocoa: don't change Space on quit in fullscreen
circumvent undefined behavior when quitting in fullscreen. Fixes #3957
This commit is contained in:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user