mirror of https://github.com/mpv-player/mpv
cocoa-cb: fix Space switching when quitting fs
when quitting mpv in fullscreen the System always switchs to Space 1 regardless of which Space mpv was on previous to switching to fs. to fix this we close the window before quitting fs. that way the System switches back the the Space mpv was previous on before fs.
This commit is contained in:
parent
0caaa1a37c
commit
9aa0905c10
|
@ -459,6 +459,12 @@ class CocoaCB: NSObject {
|
|||
}
|
||||
|
||||
func shutdown(_ destroy: Bool = false) {
|
||||
isShuttingDown = window?.isAnimating ?? false || window?.isInFullscreen ?? false
|
||||
if window?.isInFullscreen ?? false && !(window?.isAnimating ?? false) {
|
||||
window.close()
|
||||
}
|
||||
if isShuttingDown { return }
|
||||
|
||||
setCursorVisiblility(true)
|
||||
stopDisplaylink()
|
||||
uninitLightSensor()
|
||||
|
@ -476,10 +482,6 @@ class CocoaCB: NSObject {
|
|||
func processEvent(_ event: UnsafePointer<mpv_event>) {
|
||||
switch event.pointee.event_id {
|
||||
case MPV_EVENT_SHUTDOWN:
|
||||
if window != nil && window.isAnimating {
|
||||
isShuttingDown = true
|
||||
return
|
||||
}
|
||||
shutdown()
|
||||
case MPV_EVENT_PROPERTY_CHANGE:
|
||||
if backendState == .initialized {
|
||||
|
|
Loading…
Reference in New Issue