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

Fix High CPU utilization #25

Merged
merged 5 commits into from
Feb 18, 2022
Merged

Conversation

Raffy23
Copy link
Contributor

@Raffy23 Raffy23 commented Feb 16, 2022

This PR fixes Issue #24. Now tasks are only loaded if changes are detected (opening / closing windows or modifying the UI). I have not fully tested everything, so it is possible that not all state changes are tracked correctly and may result in an inconsistent state of the user interface.

Replace busy polling on the USR1 signal with a channel
[WIP] Subscribe to events from sway to avoid polling
@nwg-piotr
Copy link
Owner

Tested with my two presets that use dock, it seems to behave perfectly well.

@nwg-piotr
Copy link
Owner

nwg-piotr commented Feb 16, 2022

...apart from the workspaces button not being refreshed.

@Raffy23
Copy link
Contributor Author

Raffy23 commented Feb 17, 2022

With the latest commit the workspace button should be refreshed. I also had to fix some functions that handled showing images, otherwise in my debug environment only app images would be displayed ...
I'm not sure if the workspace button works currently correctly since I'm unable to trigger the scroll event for the button and the workspace value may reset while the user scrolls thought it, if the currently focused workspace changes.

Btw it seems like the sway ipc dependency doesn't map the subscribe event correctly for workspaces, so my solution needs to re-query the workspace information from sway to get the number of the focused workspace.

@nwg-piotr nwg-piotr linked an issue Feb 17, 2022 that may be closed by this pull request
@nwg-piotr
Copy link
Owner

Workspaces button behaves well for me.

There's still one minor issue: unpinned items do not disappear from the dock right after being unpinned. You need to start the application and then close it. Especially well visible if you keep the dock permanently on the screen.

@Raffy23
Copy link
Contributor Author

Raffy23 commented Feb 18, 2022

Pin/Unpin actions should now work

@nwg-piotr
Copy link
Owner

Yes, everything seems to work just well. Thank you for your work.

@nwg-piotr nwg-piotr merged commit e068742 into nwg-piotr:main Feb 18, 2022
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.

High CPU utilisation
2 participants