window_filter: track applications by PID #3745
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
apps
andpendingApps
lists inwindow_filter.lua
are indexed by app name. The window filter will reject a new app if it has the same name as an existing app. This can be an issue because there's nothing in MacOS that prevents two apps from having the same name. For example, in Firefox, if you select "Launch profile in new browser", Firefox will open a new Firefox application with the same name, bundleID, and path. Two separate Firefox icons in the Dock will confirm that these are unique applications.Switch the window filter to track applications by PID instead of name. Fetch the application PID in
startAppWatcher()
and stash it in theApp
object to reference later. Change the function signature ofwindowEvent()
andappWindowEvent()
to receive a PID instead of app name and lookup theApp
object by PID.Both Firefox applications are recognized and tracked separately now. No regressions in window filter event processing have been observed.