From 40b0a6bf630b45550ec1e5e62395006cbf4223aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 29 Jun 2011 11:43:11 -0400 Subject: [PATCH] server: Add wl_client_flush() Flush output queue up for the specified client. --- wayland/wayland-server.c | 9 +++++++++ wayland/wayland-server.h | 1 + 2 files changed, 10 insertions(+) diff --git a/wayland/wayland-server.c b/wayland/wayland-server.c index 5875656..176859b 100644 --- a/wayland/wayland-server.c +++ b/wayland/wayland-server.c @@ -58,6 +58,7 @@ struct wl_client { struct wl_display *display; struct wl_list resource_list; uint32_t id_count; + uint32_t mask; struct wl_list link; }; @@ -219,6 +220,7 @@ wl_client_connection_update(struct wl_connection *connection, struct wl_client *client = data; uint32_t emask = 0; + client->mask = mask; if (mask & WL_CONNECTION_READABLE) emask |= WL_EVENT_READABLE; if (mask & WL_CONNECTION_WRITABLE) @@ -227,6 +229,13 @@ wl_client_connection_update(struct wl_connection *connection, return wl_event_source_fd_update(client->source, emask); } +WL_EXPORT void +wl_client_flush(struct wl_client *client) +{ + if (client->mask & WL_CONNECTION_WRITABLE) + wl_connection_data(client->connection, WL_CONNECTION_WRITABLE); +} + WL_EXPORT struct wl_display * wl_client_get_display(struct wl_client *client) { diff --git a/wayland/wayland-server.h b/wayland/wayland-server.h index 1fd16eb..69d0d51 100644 --- a/wayland/wayland-server.h +++ b/wayland/wayland-server.h @@ -102,6 +102,7 @@ void wl_client_post_error(struct wl_client *client, struct wl_object *object, uint32_t code, const char *msg, ...); void wl_client_post_no_memory(struct wl_client *client); void wl_client_post_global(struct wl_client *client, struct wl_object *object); +void wl_client_flush(struct wl_client *client); struct wl_visual { struct wl_object object; -- 2.7.4