server: Add wl_client_flush()

Flush output queue up for the specified client.
This commit is contained in:
Kristian Høgsberg 2011-06-29 11:43:11 -04:00
parent ff20a0417a
commit 40b0a6bf63
2 changed files with 10 additions and 0 deletions

View File

@ -58,6 +58,7 @@ struct wl_client {
struct wl_display *display; struct wl_display *display;
struct wl_list resource_list; struct wl_list resource_list;
uint32_t id_count; uint32_t id_count;
uint32_t mask;
struct wl_list link; struct wl_list link;
}; };
@ -219,6 +220,7 @@ wl_client_connection_update(struct wl_connection *connection,
struct wl_client *client = data; struct wl_client *client = data;
uint32_t emask = 0; uint32_t emask = 0;
client->mask = mask;
if (mask & WL_CONNECTION_READABLE) if (mask & WL_CONNECTION_READABLE)
emask |= WL_EVENT_READABLE; emask |= WL_EVENT_READABLE;
if (mask & WL_CONNECTION_WRITABLE) 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); 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_EXPORT struct wl_display *
wl_client_get_display(struct wl_client *client) wl_client_get_display(struct wl_client *client)
{ {

View File

@ -102,6 +102,7 @@ void wl_client_post_error(struct wl_client *client, struct wl_object *object,
uint32_t code, const char *msg, ...); uint32_t code, const char *msg, ...);
void wl_client_post_no_memory(struct wl_client *client); 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_post_global(struct wl_client *client, struct wl_object *object);
void wl_client_flush(struct wl_client *client);
struct wl_visual { struct wl_visual {
struct wl_object object; struct wl_object object;