mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
wayland: only call wl_display_prepare_read() if we read any events
That is, only call it if we have POLLIN. If not, then we never read any events and we still hold the read lock and thus we shouldn't try to acquire it again.
This commit is contained in:
parent
4cbd894803
commit
d243a836ce
1 changed files with 4 additions and 3 deletions
|
|
@ -569,11 +569,12 @@ fdm_wayl(struct fdm *fdm, int fd, int events, void *data)
|
|||
struct wayland *wayl = data;
|
||||
int event_count = 0;
|
||||
|
||||
if (events & EPOLLIN)
|
||||
if (events & EPOLLIN) {
|
||||
wl_display_read_events(wayl->display);
|
||||
|
||||
while (wl_display_prepare_read(wayl->display) != 0)
|
||||
wl_display_dispatch_pending(wayl->display);
|
||||
while (wl_display_prepare_read(wayl->display) != 0)
|
||||
wl_display_dispatch_pending(wayl->display);
|
||||
}
|
||||
|
||||
if (events & EPOLLHUP) {
|
||||
LOG_WARN("disconnected from Wayland");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue