mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-01 01:40:39 -05:00
Add support for server allocated object IDs
We set aside a range of the object ID space for use by the server. This allows the server to bind an object to an ID for a client and pass that object to the client. The client can use the object immediately and the server can emit events to the object immdiately.
This commit is contained in:
parent
190492b97c
commit
bdbd6ef80b
5 changed files with 108 additions and 30 deletions
|
|
@ -336,9 +336,15 @@ wl_resource_destroy(struct wl_resource *resource, uint32_t time)
|
|||
{
|
||||
struct wl_client *client = resource->client;
|
||||
|
||||
wl_resource_queue_event(resource->client->display_resource,
|
||||
WL_DISPLAY_DELETE_ID, resource->object.id);
|
||||
wl_map_insert_at(&client->objects, resource->object.id, NULL);
|
||||
if (resource->object.id < WL_SERVER_ID_START) {
|
||||
wl_resource_queue_event(resource->client->display_resource,
|
||||
WL_DISPLAY_DELETE_ID,
|
||||
resource->object.id);
|
||||
wl_map_insert_at(&client->objects, resource->object.id, NULL);
|
||||
} else {
|
||||
wl_map_remove(&client->objects, resource->object.id);
|
||||
}
|
||||
|
||||
destroy_resource(resource, &time);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue