mirror of https://github.com/mpv-player/mpv
cocoa-cb: don't active window when minimized or hidden on file change
Fixes #7195
This commit is contained in:
parent
ea9f9af76c
commit
28609cc498
|
@ -81,6 +81,7 @@ class CocoaCB: NSObject {
|
||||||
|
|
||||||
func uninit() {
|
func uninit() {
|
||||||
window?.orderOut(nil)
|
window?.orderOut(nil)
|
||||||
|
window?.close()
|
||||||
mpv = nil
|
mpv = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +130,7 @@ class CocoaCB: NSObject {
|
||||||
titleBar = TitleBar(frame: wr, window: window, cocoaCB: self)
|
titleBar = TitleBar(frame: wr, window: window, cocoaCB: self)
|
||||||
|
|
||||||
window.isRestorable = false
|
window.isRestorable = false
|
||||||
|
window.isReleasedWhenClosed = false
|
||||||
window.makeMain()
|
window.makeMain()
|
||||||
window.makeKeyAndOrderFront(nil)
|
window.makeKeyAndOrderFront(nil)
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
@ -153,7 +155,10 @@ class CocoaCB: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
let wr = getWindowGeometry(forScreen: targetScreen, videoOut: vo)
|
let wr = getWindowGeometry(forScreen: targetScreen, videoOut: vo)
|
||||||
if !(window?.isVisible ?? false) {
|
if !(window?.isVisible ?? false) &&
|
||||||
|
!(window?.isMiniaturized ?? false) &&
|
||||||
|
!NSApp.isHidden
|
||||||
|
{
|
||||||
window?.makeKeyAndOrderFront(nil)
|
window?.makeKeyAndOrderFront(nil)
|
||||||
}
|
}
|
||||||
layer?.atomicDrawingStart()
|
layer?.atomicDrawingStart()
|
||||||
|
|
Loading…
Reference in New Issue