mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-07 13:29:49 -05:00
example compositor: only iterate over wl_shell and xdg_shell surfaces
This commit is contained in:
parent
f4e6b138fb
commit
5dae8e1be8
5 changed files with 42 additions and 20 deletions
|
|
@ -9,11 +9,12 @@
|
|||
static void destroy_surface_listener(struct wl_listener *listener, void *data) {
|
||||
struct wlr_surface *surface = wl_resource_get_user_data(data);
|
||||
struct wl_compositor_state *state = surface->compositor_data;
|
||||
assert(data == surface->resource);
|
||||
|
||||
struct wl_resource *res = NULL;
|
||||
wl_list_for_each(res, &state->surfaces, link) {
|
||||
if (res == surface->resource) {
|
||||
wl_list_remove(&res->link);
|
||||
wl_list_remove(wl_resource_get_link(res));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue