example compositor: only iterate over wl_shell and xdg_shell surfaces

This commit is contained in:
Dominique Martinet 2017-08-15 02:08:32 +02:00
parent f4e6b138fb
commit 5dae8e1be8
5 changed files with 42 additions and 20 deletions

View file

@ -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;
}
}