cocoa-cb: don't active window when minimized or hidden on file change

Fixes #7195
This commit is contained in:
der richter 2019-12-15 20:13:28 +01:00
parent ea9f9af76c
commit 28609cc498
1 changed files with 6 additions and 1 deletions

View File

@ -81,6 +81,7 @@ class CocoaCB: NSObject {
func uninit() {
window?.orderOut(nil)
window?.close()
mpv = nil
}
@ -129,6 +130,7 @@ class CocoaCB: NSObject {
titleBar = TitleBar(frame: wr, window: window, cocoaCB: self)
window.isRestorable = false
window.isReleasedWhenClosed = false
window.makeMain()
window.makeKeyAndOrderFront(nil)
NSApp.activate(ignoringOtherApps: true)
@ -153,7 +155,10 @@ class CocoaCB: NSObject {
}
let wr = getWindowGeometry(forScreen: targetScreen, videoOut: vo)
if !(window?.isVisible ?? false) {
if !(window?.isVisible ?? false) &&
!(window?.isMiniaturized ?? false) &&
!NSApp.isHidden
{
window?.makeKeyAndOrderFront(nil)
}
layer?.atomicDrawingStart()