summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2019-02-10 17:20:01 +0100
committerJan Ekström <jeebjp@gmail.com>2019-04-02 01:59:52 +0300
commit9aa0905c10dcf2c9152b0cca7805070b111a6bb2 (patch)
tree6a6fc16222ecd444f44c46b216d12d59b6f8b8e6
parent0caaa1a37c32fcb61c66d9221395d925a79432c8 (diff)
downloadmpv-9aa0905c10dcf2c9152b0cca7805070b111a6bb2.tar.bz2
mpv-9aa0905c10dcf2c9152b0cca7805070b111a6bb2.tar.xz
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.
-rw-r--r--video/out/cocoa_cb_common.swift10
1 files changed, 6 insertions, 4 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index 305766c9f6..d5cc9671af 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -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 {