Skip to content

Commit

Permalink
fix: Long delay in listDisplays() xrandr call #302 (#303)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mrtumnus authored Dec 24, 2024
1 parent a85b904 commit e00415a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/linux/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function parseDisplaysOutput (out) {

function listDisplays () {
return new Promise((resolve, reject) => {
exec('xrandr', (err, stdout) => {
exec('xrandr --current', (err, stdout) => {
if (err) {
return reject(err)
}
Expand Down

0 comments on commit e00415a

Please sign in to comment.