[clutter] wayland: Do not poll the Wayland socket for events
- From: Rob Bradford <rbradford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] wayland: Do not poll the Wayland socket for events
- Date: Fri, 28 Jun 2013 10:39:00 +0000 (UTC)
commit cba63dd93f725159091e4b4b19b8e4498c3ef42c
Author: Rob Bradford <rob linux intel com>
Date: Thu Jun 27 14:45:01 2013 +0100
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 files changed, 1 insertions(+), 14 deletions(-)
---
diff --git a/clutter/wayland/clutter-event-wayland.c b/clutter/wayland/clutter-event-wayland.c
index 8ba2f3c..08dfbee 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]