From 5758ab5c89a6f2a6deebdf3f068489023e591441 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 27 Jun 2013 14:45:01 +0100 Subject: [PATCH] wayland: Do not poll the Wayland socket for events Since Cogl also polls on this file descriptor we can get into situations where our event source is woken up to handle events but those events have instead been handled by Cogl resulting in the source sitting in poll(). We can safely rely on Cogl to handle the polling on the event source and to dispatch those events. https://bugzilla.gnome.org/show_bug.cgi?id=702202 --- clutter/wayland/clutter-event-wayland.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/clutter/wayland/clutter-event-wayland.c b/clutter/wayland/clutter-event-wayland.c index 8ba2f3cb4..08dfbeed3 100644 --- a/clutter/wayland/clutter-event-wayland.c +++ b/clutter/wayland/clutter-event-wayland.c @@ -41,7 +41,6 @@ typedef struct _ClutterEventSourceWayland { GSource source; - GPollFD pfd; struct wl_display *display; } ClutterEventSourceWayland; @@ -70,12 +69,11 @@ clutter_event_source_wayland_prepare (GSource *base, gint *timeout) static gboolean clutter_event_source_wayland_check (GSource *base) { - ClutterEventSourceWayland *source = (ClutterEventSourceWayland *) base; gboolean retval; _clutter_threads_acquire_lock (); - retval = clutter_events_pending () || source->pfd.revents; + retval = clutter_events_pending (); _clutter_threads_release_lock (); @@ -87,17 +85,10 @@ clutter_event_source_wayland_dispatch (GSource *base, GSourceFunc callback, gpointer data) { - ClutterEventSourceWayland *source = (ClutterEventSourceWayland *) base; ClutterEvent *event; _clutter_threads_acquire_lock (); - if (source->pfd.revents) - { - wl_display_dispatch (source->display); - source->pfd.revents = 0; - } - event = clutter_event_get (); if (event) @@ -129,10 +120,6 @@ _clutter_event_source_wayland_new (struct wl_display *display) g_source_new (&clutter_event_source_wayland_funcs, sizeof (ClutterEventSourceWayland)); source->display = display; - source->pfd.fd = - wl_display_get_fd (display); - source->pfd.events = G_IO_IN | G_IO_ERR; - g_source_add_poll (&source->source, &source->pfd); return &source->source; }