Skip to content

Commit

Permalink
fix: windows from the iina app would not show sometimes (closes #1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Sep 18, 2021
1 parent 194e726 commit 47d283e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/api-wrappers/AXUIElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand All @@ -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
Expand Down

0 comments on commit 47d283e

Please sign in to comment.