Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window_filter: track applications by PID #3745

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mogenson
Copy link

The apps and pendingApps lists in window_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 the App object to reference later. Change the function signature of windowEvent() and appWindowEvent() to receive a PID instead of app name and lookup the App object by PID.

Both Firefox applications are recognized and tracked separately now. No regressions in window filter event processing have been observed.

The `apps` and `pendingApps` lists in `window_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 the
`App` object to reference later. Change the function signature of
`windowEvent()` and `appWindowEvent()` to receive a PID instead of app
name and lookup the `App` object by PID.

Both Firefox applications are recognized and tracked separately now. No
regressions in window filter event processing have been observed.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: ['pr-fix', 'pr-change', 'pr-feature', 'pr-maintenance']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant