[mutter] wayland: Use g_source_add_unix_fd instead of g_source_add_poll



commit ad7292faef39bdf1cb2a5ccb5b5de270bf9f8e2f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Dec 15 14:42:33 2014 -0800

    wayland: Use g_source_add_unix_fd instead of g_source_add_poll
    
    g_source_add_poll is deprecated.

 src/wayland/meta-wayland.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 5d2c526..4521b41 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -59,7 +59,6 @@ get_time (void)
 typedef struct
 {
   GSource source;
-  GPollFD pfd;
   struct wl_display *display;
 } WaylandEventSource;
 
@@ -76,13 +75,6 @@ wayland_event_source_prepare (GSource *base, int *timeout)
 }
 
 static gboolean
-wayland_event_source_check (GSource *base)
-{
-  WaylandEventSource *source = (WaylandEventSource *)base;
-  return source->pfd.revents;
-}
-
-static gboolean
 wayland_event_source_dispatch (GSource *base,
                                GSourceFunc callback,
                                void *data)
@@ -98,7 +90,7 @@ wayland_event_source_dispatch (GSource *base,
 static GSourceFuncs wayland_event_source_funcs =
 {
   wayland_event_source_prepare,
-  wayland_event_source_check,
+  NULL,
   wayland_event_source_dispatch,
   NULL
 };
@@ -112,9 +104,9 @@ wayland_event_source_new (struct wl_display *display)
   source = (WaylandEventSource *) g_source_new (&wayland_event_source_funcs,
                                                 sizeof (WaylandEventSource));
   source->display = display;
-  source->pfd.fd = wl_event_loop_get_fd (loop);
-  source->pfd.events = G_IO_IN | G_IO_ERR;
-  g_source_add_poll (&source->source, &source->pfd);
+  g_source_add_unix_fd (&source->source,
+                        wl_event_loop_get_fd (loop),
+                        G_IO_IN | G_IO_ERR);
 
   return &source->source;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]