From ad7292faef39bdf1cb2a5ccb5b5de270bf9f8e2f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 15 Dec 2014 14:42:33 -0800 Subject: [PATCH] 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 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 5d2c526e0..4521b41a3 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; @@ -75,13 +74,6 @@ wayland_event_source_prepare (GSource *base, int *timeout) return FALSE; } -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, @@ -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; }