summaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-11-26 12:57:31 -0500
committerKristian Høgsberg <krh@redhat.com>2008-11-26 12:57:31 -0500
commit44f36e3585cf7bb1ba8e73febabb7facf5cd6151 (patch)
tree5a9de67f6de5443613b1d380dd9bd3d6fced2461 /wayland.c
parentf3723fe79e7bafcd663160ee8f7798faf9a2c2f9 (diff)
Make ack event signal that the requests have been composited.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/wayland.c b/wayland.c
index 766dc0a..c33d135 100644
--- a/wayland.c
+++ b/wayland.c
@@ -19,6 +19,8 @@ struct wl_client {
struct wl_display *display;
struct wl_list object_list;
struct wl_list link;
+ uint32_t pending_acknowledge;
+ uint32_t acknowledge_key;
};
struct wl_display {
@@ -500,12 +502,8 @@ static int
wl_display_commit(struct wl_client *client,
struct wl_display *display, uint32_t key)
{
- uint32_t event[3];
-
- event[0] = display->base.id;
- event[1] = WL_DISPLAY_ACKNOWLEDGE | ((sizeof event) << 16);
- event[2] = key;
- wl_connection_write(client->connection, event, sizeof event);
+ client->pending_acknowledge = 1;
+ client->acknowledge_key = key;
return 0;
}
@@ -687,6 +685,30 @@ wl_display_post_key_event(struct wl_display *display,
wl_display_send_event(display, p, sizeof p);
}
+WL_EXPORT void
+wl_display_post_acknowledge(struct wl_display *display)
+{
+ struct wl_client *client;
+ uint32_t event[3];
+
+ event[0] = display->base.id;
+ event[1] = WL_DISPLAY_ACKNOWLEDGE | ((sizeof event) << 16);
+
+ client = container_of(display->client_list.next,
+ struct wl_client, link);
+
+ while (&client->link != &display->client_list) {
+ if (client->pending_acknowledge) {
+ event[2] = client->acknowledge_key;
+ wl_connection_write(client->connection,
+ event, sizeof event);
+ client->pending_acknowledge = 0;
+ }
+ client = container_of(client->link.next,
+ struct wl_client, link);
+ }
+}
+
void
wl_display_set_compositor(struct wl_display *display,
struct wl_compositor *compositor)