kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

An Ability to receive events for an application after restart the application #264

Closed varp closed 3 years ago

varp commented 3 years ago

When an application was started before Phoenix's start, I receive events (ex. 'windowDidOpen') as expected. When I restart the application, I lose the ability to receive further events for the application. In Phoenix's logs appears: Error: Could not get process identifier for accessibility element (null). (-25201). I think, at the moment when the application starts, some Phoenix logic can not properly acquire permissions from tccd and therefore attach observer for AX events.

If I restart Phoenix, I get back the ability to receive events for the application.

kasper commented 3 years ago

@varp Hey! I’m sorry to hear about that! Does this happen with all apps for you or some particular app?

varp commented 3 years ago

@kasper Sorry for the delay. At the moment of the issue, I was working with the VS Code. Since then, because of lack of time, no made tests with other apps. Will come back, with more information ASAP.

kasper commented 3 years ago

@varp Thanks!

kasper commented 3 years ago

@varp Thanks for reporting this! The root cause for this was actually a pretty substantial issue. Phoenix was trying to register the window events too early for newly launched apps. This should now be fixed.