mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
wayland: Use g_source_add_unix_fd instead of g_source_add_poll
g_source_add_poll is deprecated.
This commit is contained in:
parent
2f7843b295
commit
ad7292faef
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user