diff --git a/src/api-wrappers/AXUIElement.swift b/src/api-wrappers/AXUIElement.swift index 676bddd5c..8f20fff80 100644 --- a/src/api-wrappers/AXUIElement.swift +++ b/src/api-wrappers/AXUIElement.swift @@ -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