mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
rootston: add destroy to view interface
This commit is contained in:
parent
1f8854f217
commit
6ac3534df6
6 changed files with 59 additions and 33 deletions
|
|
@ -78,6 +78,19 @@ static void close(struct roots_view *view) {
|
|||
wl_client_destroy(surf->client);
|
||||
}
|
||||
|
||||
static void destroy(struct roots_view *view) {
|
||||
assert(view->type == ROOTS_WL_SHELL_VIEW);
|
||||
struct roots_wl_shell_surface *roots_surface = view->roots_wl_shell_surface;
|
||||
wl_list_remove(&roots_surface->destroy.link);
|
||||
wl_list_remove(&roots_surface->request_move.link);
|
||||
wl_list_remove(&roots_surface->request_resize.link);
|
||||
wl_list_remove(&roots_surface->request_maximize.link);
|
||||
wl_list_remove(&roots_surface->request_fullscreen.link);
|
||||
wl_list_remove(&roots_surface->set_state.link);
|
||||
wl_list_remove(&roots_surface->surface_commit.link);
|
||||
free(roots_surface);
|
||||
}
|
||||
|
||||
static void handle_request_move(struct wl_listener *listener, void *data) {
|
||||
struct roots_wl_shell_surface *roots_surface =
|
||||
wl_container_of(listener, roots_surface, request_move);
|
||||
|
|
@ -174,15 +187,7 @@ static void handle_new_popup(struct wl_listener *listener, void *data) {
|
|||
static void handle_destroy(struct wl_listener *listener, void *data) {
|
||||
struct roots_wl_shell_surface *roots_surface =
|
||||
wl_container_of(listener, roots_surface, destroy);
|
||||
wl_list_remove(&roots_surface->destroy.link);
|
||||
wl_list_remove(&roots_surface->request_move.link);
|
||||
wl_list_remove(&roots_surface->request_resize.link);
|
||||
wl_list_remove(&roots_surface->request_maximize.link);
|
||||
wl_list_remove(&roots_surface->request_fullscreen.link);
|
||||
wl_list_remove(&roots_surface->set_state.link);
|
||||
wl_list_remove(&roots_surface->surface_commit.link);
|
||||
view_destroy(roots_surface->view);
|
||||
free(roots_surface);
|
||||
}
|
||||
|
||||
void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
|
||||
|
|
@ -238,6 +243,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
|
|||
view->roots_wl_shell_surface = roots_surface;
|
||||
view->resize = resize;
|
||||
view->close = close;
|
||||
view->destroy = destroy;
|
||||
roots_surface->view = view;
|
||||
|
||||
view_map(view, surface->surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue