diff options
Diffstat (limited to 'rootston/xdg_shell.c')
-rw-r--r-- | rootston/xdg_shell.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c index 1733eb4e..24c57bd5 100644 --- a/rootston/xdg_shell.c +++ b/rootston/xdg_shell.c @@ -180,6 +180,18 @@ static void close(struct roots_view *view) { } } +static void destroy(struct roots_view *view) { + struct roots_xdg_surface *roots_xdg_surface = view->roots_xdg_surface; + wl_list_remove(&roots_xdg_surface->surface_commit.link); + wl_list_remove(&roots_xdg_surface->destroy.link); + wl_list_remove(&roots_xdg_surface->new_popup.link); + wl_list_remove(&roots_xdg_surface->request_move.link); + wl_list_remove(&roots_xdg_surface->request_resize.link); + wl_list_remove(&roots_xdg_surface->request_maximize.link); + wl_list_remove(&roots_xdg_surface->request_fullscreen.link); + free(roots_xdg_surface); +} + static void handle_request_move(struct wl_listener *listener, void *data) { struct roots_xdg_surface *roots_xdg_surface = wl_container_of(listener, roots_xdg_surface, request_move); @@ -280,15 +292,7 @@ static void handle_new_popup(struct wl_listener *listener, void *data) { static void handle_destroy(struct wl_listener *listener, void *data) { struct roots_xdg_surface *roots_xdg_surface = wl_container_of(listener, roots_xdg_surface, destroy); - wl_list_remove(&roots_xdg_surface->surface_commit.link); - wl_list_remove(&roots_xdg_surface->destroy.link); - wl_list_remove(&roots_xdg_surface->new_popup.link); - wl_list_remove(&roots_xdg_surface->request_move.link); - wl_list_remove(&roots_xdg_surface->request_resize.link); - wl_list_remove(&roots_xdg_surface->request_maximize.link); - wl_list_remove(&roots_xdg_surface->request_fullscreen.link); view_destroy(roots_xdg_surface->view); - free(roots_xdg_surface); } void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { @@ -346,6 +350,7 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { view->maximize = maximize; view->set_fullscreen = set_fullscreen; view->close = close; + view->destroy = destroy; roots_surface->view = view; struct wlr_box box; |