diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-01-04 22:32:00 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-01-04 22:32:00 +0000 |
| commit | d243a836ce55dff647f8e744441fbd2c3343cfa1 (patch) | |
| tree | c69575ed6285f6e503d41aa0cf6c14317d37d3dd | |
| parent | wayland: use a low priority FDM hook to flush the wayland socket (diff) | |
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.
| -rw-r--r-- | wayland.c | 7 |
1 files changed, 4 insertions, 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"); |
