Skip to content

Conversation

@kmod-midori
Copy link
Contributor

Update the Windows implementation to use native Windows APIs instead of WMI, which does not consume much CPU (barely noticeable when polling with an interval of 1 second).

This should also remove the dependency on wmi package, but I am having difficulty using Poetry, so that change is not made.

@ErikBjare
Copy link
Member

ErikBjare commented Dec 26, 2022

This is awesome.

Great work, thanks @chengyuhui! ❤️

@ErikBjare ErikBjare changed the title Use Win32 API to query process information perf: use win32 API instead of WMI to query process information Dec 26, 2022
@ErikBjare ErikBjare merged commit 6e0778d into ActivityWatch:master Dec 26, 2022
@ErikBjare
Copy link
Member

@chengyuhui This created a regression for applications run as administrator, which you can read about in ActivityWatch/activitywatch#873

Are you interested in working on a fix? Namely to use the newer method, but in the cases that it fails, fallback to using wmi.

I've asked @BelKed about it here, thought I'd ask you too :)

@kmod-midori
Copy link
Contributor Author

I no longer use AW on my Windows system since I have migrated my main desktop to Arch. You guys can go ahead and fix this :)

@ErikBjare
Copy link
Member

Congratulations on Arch-maxing! 🤩

I guess I'll make a PR myself and find someone to test it later :)

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.

2 participants