diff options
| author | Simon Ser <contact@emersion.fr> | 2022-05-12 19:29:11 +0200 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2022-06-15 07:53:19 +0000 |
| commit | 1b00df864c6816905628a8eae49c24d2aed287af (patch) | |
| tree | 877e0b3b6afbd780a1b7a1e2012441aa74e5f4dc /src/wayland-server.c | |
| parent | cursor/os-compatibility: handle EINTR gracefully (diff) | |
| download | wayland-1b00df864c6816905628a8eae49c24d2aed287af.tar wayland-1b00df864c6816905628a8eae49c24d2aed287af.tar.gz wayland-1b00df864c6816905628a8eae49c24d2aed287af.tar.bz2 wayland-1b00df864c6816905628a8eae49c24d2aed287af.tar.lz wayland-1b00df864c6816905628a8eae49c24d2aed287af.tar.xz wayland-1b00df864c6816905628a8eae49c24d2aed287af.tar.zst wayland-1b00df864c6816905628a8eae49c24d2aed287af.zip | |
server: check visibility before sending global/global_remove
See the previous discussion at [1]: libwayland incorrectly skips
the visibility checks when sending global/global_remove events.
The check is only performed when a client performs a
wl_display.get_registry request.
[1]: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/148
Signed-off-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'src/wayland-server.c')
| -rw-r--r-- | src/wayland-server.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c index 00cfc27..732f153 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -1252,11 +1252,12 @@ wl_global_create(struct wl_display *display, wl_list_insert(display->global_list.prev, &global->link); wl_list_for_each(resource, &display->registry_resource_list, link) - wl_resource_post_event(resource, - WL_REGISTRY_GLOBAL, - global->name, - global->interface->name, - global->version); + if (wl_global_is_visible(resource->client, global)) + wl_resource_post_event(resource, + WL_REGISTRY_GLOBAL, + global->name, + global->interface->name, + global->version); return global; } @@ -1294,8 +1295,9 @@ wl_global_remove(struct wl_global *global) global->name); wl_list_for_each(resource, &display->registry_resource_list, link) - wl_resource_post_event(resource, WL_REGISTRY_GLOBAL_REMOVE, - global->name); + if (wl_global_is_visible(resource->client, global)) + wl_resource_post_event(resource, WL_REGISTRY_GLOBAL_REMOVE, + global->name); global->removed = true; } |
