You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply put, if I open an app for the first time the focusedAppChanged event gets fired but the app doesn't get hidden as it should, since it looks like the event isn't propagated to focusedWindowChanged.
It works as intended if I switch away from it and then back to it, then focusedAppChanged is fired and focusedWindowChanged follows immediately, hiding the app.
My guess is that this call returns null in this circumstances, but I'm not sure why.
The text was updated successfully, but these errors were encountered:
I've run some tests and I've found that, indeed, when NSWorkspace.didActivateApplicationNotification is fired for a new app, this happens before any window has been created; this causes focusedWindow to be null, since of course it is.
I haven't found an elegant solution, but I have found a solution: dgfl-gh@05e4a88.
This simply calls focusedAppChanged over and over, until a window is finally found.
On my system (MBP16 M1 Pro, macOS 13.3.1), the call seems to be repeated ~100 times when opening NetNewsWire, but this will most likely depend heavily on the application.
Simply put, if I open an app for the first time the
focusedAppChanged
event gets fired but the app doesn't get hidden as it should, since it looks like the event isn't propagated tofocusedWindowChanged
.It works as intended if I switch away from it and then back to it, then
focusedAppChanged
is fired andfocusedWindowChanged
follows immediately, hiding the app.My guess is that this call returns null in this circumstances, but I'm not sure why.
The text was updated successfully, but these errors were encountered: