From 0b85b09f627031aa00fcc64bd0a72d1a863dca22 Mon Sep 17 00:00:00 2001 From: metacodes Date: Thu, 17 Mar 2022 17:33:41 +0800 Subject: [PATCH] fix: show window of some apps like jetbrains apps (#1249 #1079 #1392) I am able to reproduce the issue by reinstall JetBrains AppCode. The first time I open AppCode after reinstall it, AltTab never show AppCode window. I debug the code on my Mac, I find that AltTab can get the event of app launched but never get the event of finishedLaunching. So I just remove the code runningApplication.isFinishedLaunching. After that, AltTab work well and the issue is fixed. --- src/logic/Application.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logic/Application.swift b/src/logic/Application.swift index 486cab08..933156e6 100644 --- a/src/logic/Application.swift +++ b/src/logic/Application.swift @@ -72,7 +72,7 @@ class Application: NSObject { } func addAndObserveWindows() { - if runningApplication.isFinishedLaunching && runningApplication.activationPolicy != .prohibited && axUiElement == nil { + if runningApplication.activationPolicy != .prohibited && axUiElement == nil { axUiElement = AXUIElementCreateApplication(pid) AXObserverCreate(pid, axObserverCallback, &axObserver) debugPrint("Adding app", pid ?? "nil", runningApplication.bundleIdentifier ?? "nil")