mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-03 09:01:42 -05:00
Make ack event signal that the requests have been composited.
This commit is contained in:
parent
f3723fe79e
commit
44f36e3585
5 changed files with 111 additions and 74 deletions
34
wayland.c
34
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue