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: Long delay in listDisplays() xrandr call #302 #303

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

mrtumnus
Copy link
Contributor

Fixes #302

Call xrandr with the --current switch, which skips hardware polling and uses the current screen configuration directly. This eliminates a long (~1.6 second) delay that locks up the system.

Benchmark of listDisplays() before:

real    0m1.672s
user    0m0.034s
sys     0m0.013s

After fix:

real    0m0.085s
user    0m0.054s
sys     0m0.033s

Call xrandr with the `--current` switch, which skips hardware polling and uses the current screen configuration directly.  This eliminates a long (~1.6 second) delay that locks up the system.

Co-authored by: Elliott Partridge <[email protected]>
@bencevans bencevans force-pushed the fix/listdisplays-xrandr-delay branch from 30345bd to 9185055 Compare December 24, 2024 11:23
@bencevans bencevans merged commit e00415a into bencevans:main Dec 24, 2024
7 checks passed
@bencevans
Copy link
Owner

Wow, much faster! Released in v1.15.1.

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.

Long delay in listDisplays() xrandr call
2 participants