Commit eb2cff60 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

Revert "gl/wayland: fix glib mainloop integration"

This reverts commit 85c9b767.

This caused regressions in master which have not been resolved
yet, so removing backport from 1.14 branch.

See !241 and #603.

Fixes #607
parent 8676e30a
...@@ -128,13 +128,19 @@ wayland_event_source_prepare (GSource * base, gint * timeout) ...@@ -128,13 +128,19 @@ wayland_event_source_prepare (GSource * base, gint * timeout)
wl_display_cancel_read (source->display); wl_display_cancel_read (source->display);
if (source->queue) { if (source->queue) {
if (wl_display_prepare_read_queue (source->display, source->queue) != 0) while (wl_display_prepare_read_queue (source->display, source->queue) != 0) {
return TRUE; if (wl_display_dispatch_queue_pending (source->display,
source->queue) < 0) {
g_critical ("Failed to dispatch pending events\n");
}
}
} else { } else {
if (wl_display_prepare_read (source->display) != 0) while (wl_display_prepare_read (source->display) != 0) {
return TRUE; if (wl_display_dispatch_pending (source->display) < 0) {
g_critical ("Failed to dispatch pending events\n");
}
}
} }
source->reading = TRUE; source->reading = TRUE;
/* FIXME: this may return EAGAIN if the fd is full */ /* FIXME: this may return EAGAIN if the fd is full */
...@@ -148,13 +154,18 @@ static gboolean ...@@ -148,13 +154,18 @@ static gboolean
wayland_event_source_check (GSource * base) wayland_event_source_check (GSource * base)
{ {
WaylandEventSource *source = (WaylandEventSource *) base; WaylandEventSource *source = (WaylandEventSource *) base;
gboolean retval;
source->reading = FALSE; retval = source->pfd.revents;
if (wl_display_read_events (source->display) == 0) if (source->pfd.revents & G_IO_IN) {
return TRUE; wl_display_read_events (source->display);
} else {
wl_display_cancel_read (source->display);
}
source->reading = FALSE;
return FALSE; return retval;
} }
static gboolean static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment