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

addProcessWithPSN: should not assume a process was launched #1756

Closed
skurfer opened this issue Jan 22, 2014 · 3 comments
Closed

addProcessWithPSN: should not assume a process was launched #1756

skurfer opened this issue Jan 22, 2014 · 3 comments
Assignees
Labels

Comments

@skurfer
Copy link
Member

@skurfer skurfer commented Jan 22, 2014

Currently, -[QSProcessMonitor addProcessWithPSN:] posts a notification with QSApplicationLaunchEvent. This isn’t always true.

When Quicksilver launches, all running applications are found and added using that method. They may have been running for hours, but the notification claims they just launched.

This causes a problem for any “Application Launched” event triggers.

@ghost ghost assigned skurfer Jan 22, 2014
@tiennou
Copy link
Member

@tiennou tiennou commented Jan 22, 2014

Oh, fun ;-).

Either there's a way to temporarily stop the notification from being sent when first registering, and then reenable it.

Or, as stated by this, we can find a way to do what ps does (reference here) (I'm looking at it, but hey BSD code).

@skurfer
Copy link
Member Author

@skurfer skurfer commented Jan 22, 2014

There are (I think) 4 places that call addProcessWithPSN:. All we need to do is post the notification from those places (when it makes sense) instead of doing it in the method itself.

@tiennou
Copy link
Member

@tiennou tiennou commented Jan 22, 2014

That sounds easier actually ;-).

ps uses sysctl(3) with a CTL_KERN/KERN_PROC + pid to get back a proc structure, which has a struct timeval __p_starttime; member. Cake !

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

No branches or pull requests

2 participants