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

Use _NET_VIRTUAL_ROOTS for querying virtual roots #1875

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

Caellian
Copy link
Collaborator

@Caellian Caellian commented Apr 29, 2024

VRootWindowOfScreen which was frequently called from event propagation code used to query window properties (XGetWindowProperty) on every event, for all top level windows. This PR addresses this by querrying only _NET_VIRTUAL_ROOTS atom once per call.

image

image

Fixes #1852.

Testing

  • Behaves correctly on WMs that use virtual roots (swm, tvtwm, amiwm, enlightenment)
    • Test by checking whether _NET_CURRENT_DESKTOP index matches current vroot index in _NET_VIRTUAL_ROOTS list.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@github-actions github-actions bot added sources PR modifies project sources display: x11 Issue related to X11 backend labels Apr 29, 2024
Copy link

netlify bot commented Apr 29, 2024

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit 4edeb37
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/66302886aea37b0008dce361

@brndnmtthws brndnmtthws added the bug Bug report or bug fix PR label Apr 30, 2024
@Caellian
Copy link
Collaborator Author

Can't get any WMs that use virtual roots to compile and most aren't maintained anymore. Except enlightenment, which doesn't use virtual roots anymore. I'll assume _NET_CURRENT_DESKTOP index matches current vroot index in _NET_VIRTUAL_ROOTS list and merge this as the current implementation is horribly slow.

It will be less pressure to fix vroots not working as it affects far fewer people, and when they create an issue I can ask them to provide details I'm missing atm.

@Caellian Caellian merged commit 384bbed into main Apr 30, 2024
62 checks passed
@Caellian Caellian deleted the fix/vroot-perf branch April 30, 2024 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report or bug fix PR display: x11 Issue related to X11 backend sources PR modifies project sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Querying windows every event causes significant CPU usage
2 participants