fix: windows from the iina app would not show sometimes (closes #1037)

This commit is contained in:
Louis Pontoise
2021-09-18 23:06:37 +09:00
committed by lwouis
parent 194e7266bd
commit 47d283eb61
+7 -1
View File
@@ -82,7 +82,7 @@ extension AXUIElement {
// Some non-windows have cgWindowId == 0 (e.g. windows of apps starting at login with the checkbox "Hidden" checked)
return wid != 0 &&
size != nil && size!.width > 100 && size!.height > 100 &&
(books(runningApp) || keynote(runningApp) || (
(books(runningApp) || keynote(runningApp) || iina(runningApp) || (
// CGWindowLevel == .normalWindow helps filter out iStats Pro and other top-level pop-overs, and floating windows
level == AXUIElement.normalLevel &&
jetbrainApp(runningApp, title, subrole) &&
@@ -107,6 +107,12 @@ extension AXUIElement {
(subrole == kAXStandardWindowSubrole || title != nil && title != "")
}
private static func iina(_ runningApp: NSRunningApplication) -> Bool {
// IINA.app can have videos float (level == 2 instead of 0)
// there is also complex animations during which we may or may not consider the window not a window
return runningApp.bundleIdentifier == "com.colliderli.iina"
}
private static func keynote(_ runningApp: NSRunningApplication) -> Bool {
// apple Keynote has a fake fullscreen window when in presentation mode
// it covers the screen with a AXUnknown window instead of using standard fullscreen mode