wayland: Use g_source_add_unix_fd instead of g_source_add_poll

g_source_add_poll is deprecated.
This commit is contained in:
Jasper St. Pierre 2014-12-15 14:42:33 -08:00
parent 2f7843b295
commit ad7292faef

View File

@ -59,7 +59,6 @@ get_time (void)
typedef struct typedef struct
{ {
GSource source; GSource source;
GPollFD pfd;
struct wl_display *display; struct wl_display *display;
} WaylandEventSource; } WaylandEventSource;
@ -75,13 +74,6 @@ wayland_event_source_prepare (GSource *base, int *timeout)
return FALSE; return FALSE;
} }
static gboolean
wayland_event_source_check (GSource *base)
{
WaylandEventSource *source = (WaylandEventSource *)base;
return source->pfd.revents;
}
static gboolean static gboolean
wayland_event_source_dispatch (GSource *base, wayland_event_source_dispatch (GSource *base,
GSourceFunc callback, GSourceFunc callback,
@ -98,7 +90,7 @@ wayland_event_source_dispatch (GSource *base,
static GSourceFuncs wayland_event_source_funcs = static GSourceFuncs wayland_event_source_funcs =
{ {
wayland_event_source_prepare, wayland_event_source_prepare,
wayland_event_source_check, NULL,
wayland_event_source_dispatch, wayland_event_source_dispatch,
NULL NULL
}; };
@ -112,9 +104,9 @@ wayland_event_source_new (struct wl_display *display)
source = (WaylandEventSource *) g_source_new (&wayland_event_source_funcs, source = (WaylandEventSource *) g_source_new (&wayland_event_source_funcs,
sizeof (WaylandEventSource)); sizeof (WaylandEventSource));
source->display = display; source->display = display;
source->pfd.fd = wl_event_loop_get_fd (loop); g_source_add_unix_fd (&source->source,
source->pfd.events = G_IO_IN | G_IO_ERR; wl_event_loop_get_fd (loop),
g_source_add_poll (&source->source, &source->pfd); G_IO_IN | G_IO_ERR);
return &source->source; return &source->source;
} }