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
|
|
@ -106,9 +106,9 @@ static void set_fullscreen(struct roots_view *view, bool fullscreen) {
|
|||
wlr_xwayland_surface_set_fullscreen(view->xwayland_surface, fullscreen);
|
||||
}
|
||||
|
||||
static void handle_destroy(struct wl_listener *listener, void *data) {
|
||||
struct roots_xwayland_surface *roots_surface =
|
||||
wl_container_of(listener, roots_surface, destroy);
|
||||
static void destroy(struct roots_view *view) {
|
||||
assert(view->type == ROOTS_XWAYLAND_VIEW);
|
||||
struct roots_xwayland_surface *roots_surface = view->roots_xwayland_surface;
|
||||
wl_list_remove(&roots_surface->destroy.link);
|
||||
wl_list_remove(&roots_surface->request_configure.link);
|
||||
wl_list_remove(&roots_surface->request_move.link);
|
||||
|
|
@ -116,10 +116,15 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
|
|||
wl_list_remove(&roots_surface->request_maximize.link);
|
||||
wl_list_remove(&roots_surface->map_notify.link);
|
||||
wl_list_remove(&roots_surface->unmap_notify.link);
|
||||
view_destroy(roots_surface->view);
|
||||
free(roots_surface);
|
||||
}
|
||||
|
||||
static void handle_destroy(struct wl_listener *listener, void *data) {
|
||||
struct roots_xwayland_surface *roots_surface =
|
||||
wl_container_of(listener, roots_surface, destroy);
|
||||
view_destroy(roots_surface->view);
|
||||
}
|
||||
|
||||
static void handle_request_configure(struct wl_listener *listener, void *data) {
|
||||
struct roots_xwayland_surface *roots_surface =
|
||||
wl_container_of(listener, roots_surface, request_configure);
|
||||
|
|
@ -307,6 +312,7 @@ void handle_xwayland_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;
|
||||
|
||||
view_map(view, surface->surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue