Skip to content

Conversation

@kennylevinsen
Copy link
Member

wl_display_dispatch is a convenience function intended to poll the socket and wait for events to be dispatched, and may block indefinitely. This function is primarily intended for simple clients that do not use event loops.

swayidle uses wl_event_loop to monitor the display socket, and only calls the event handler if there is something to read. Instead of polling again and possibly blocking, read whatever is available directly.

Fixes: #193
Alternative to: #196

(I don't have a reproduction of the original issue.)

wl_display_dispatch is a convenience function intended to poll the
socket and wait for events to be dispatched, and may block indefinitely.
This function is primarily intended for simple clients that do not use
event loops.

swayidle uses wl_event_loop to monitor the display socket, and only
calls the event handler if there is something to read. Instead of
polling again and possibly blocking, read whatever is available
directly.

Fixes: swaywm#193
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@emersion emersion merged commit 95cf9ef into swaywm:master Nov 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

SIGUSR1 to swayidle works only sometimes after upgrade

2 participants