summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-06-29 11:43:11 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-06-29 11:43:11 -0400
commit40b0a6bf630b45550ec1e5e62395006cbf4223aa (patch)
tree6b568b0aada8ce69cec880d55fd46acf77cb33b2
parentff20a0417af35a1614ec761a67160963de6471e0 (diff)
server: Add wl_client_flush()
Flush output queue up for the specified client.
-rw-r--r--wayland/wayland-server.c9
-rw-r--r--wayland/wayland-server.h1
2 files changed, 10 insertions, 0 deletions
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;