rootston: add roots_view_child::destroy

This commit is contained in:
emersion 2018-01-21 15:13:10 +01:00
parent a636d72fc7
commit d8b36357e4
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
3 changed files with 32 additions and 11 deletions

View file

@ -236,6 +236,12 @@ static void handle_map_notify(struct wl_listener *listener, void *data) {
view->y = xsurface->y;
wl_list_insert(&desktop->views, &view->link);
struct wlr_subsurface *subsurface;
wl_list_for_each(subsurface, &view->wlr_surface->subsurface_list,
parent_link) {
subsurface_create(view, subsurface);
}
view_damage_whole(view);
roots_surface->surface_commit.notify = handle_surface_commit;
@ -252,6 +258,11 @@ static void handle_unmap_notify(struct wl_listener *listener, void *data) {
view_damage_whole(view);
struct roots_view_child *child, *tmp;
wl_list_for_each_safe(child, tmp, &view->children, link) {
child->destroy(child);
}
view->wlr_surface = NULL;
wl_list_remove(&view->link);
}