Commit 7b8fc744 authored by Lucas Stach's avatar Lucas Stach Committed by Tim-Philipp Müller

gl/wayland: fix wayland event source burning CPU

Commit c71dd72b "gl/wayland: fix glib mainloop integration" was overeager
in removing the poll result test from the check function. This caused
dispatch to be called even if no new events are available on the
Wayland connection, which in turn would wake up the glib mainloop,
causing effectively a tight loop without ever blocking on the poll.

Fixes #603
parent d8d4904e
......@@ -151,8 +151,12 @@ wayland_event_source_check (GSource * base)
source->reading = FALSE;
if (wl_display_read_events (source->display) == 0)
return TRUE;
if (source->pfd.revents & G_IO_IN) {
if (wl_display_read_events (source->display) == 0)
return TRUE;
} else {
wl_display_cancel_read (source->display);
return FALSE;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment