mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
view: Refactor view destruction
Consolidates all of the view destruction code for xwl + xdg into one function. Fixes several notable bugs along the way: - Fixes a crash when alt tabbing when a selected view gets destroyed. - Fixes the OSD not updating to reflect a view has been destroyed.
This commit is contained in:
parent
dee370f1b4
commit
d0b9680d00
4 changed files with 64 additions and 36 deletions
16
src/xdg.c
16
src/xdg.c
|
|
@ -78,21 +78,7 @@ static void
|
|||
handle_destroy(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct view *view = wl_container_of(listener, view, destroy);
|
||||
if (view->toplevel_handle) {
|
||||
wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle);
|
||||
}
|
||||
interactive_end(view);
|
||||
if (view->server->seat.active_view == view) {
|
||||
view->server->seat.active_view = NULL;
|
||||
}
|
||||
wl_list_remove(&view->link);
|
||||
wl_list_remove(&view->destroy.link);
|
||||
if (view->scene_tree) {
|
||||
ssd_destroy(view);
|
||||
wlr_scene_node_destroy(&view->scene_tree->node);
|
||||
view->scene_tree = NULL;
|
||||
}
|
||||
free(view);
|
||||
view_handle_destroy(view);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue