mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-30 00:15:58 +01:00
rootston: destroy seat view on unmap
This commit is contained in:
parent
42637a52cf
commit
c1c88bfe5d
4 changed files with 12 additions and 0 deletions
|
@ -39,6 +39,7 @@ struct roots_seat_view {
|
||||||
|
|
||||||
struct wl_list link; // roots_seat::views
|
struct wl_list link; // roots_seat::views
|
||||||
|
|
||||||
|
struct wl_listener view_unmap;
|
||||||
struct wl_listener view_destroy;
|
struct wl_listener view_destroy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,7 @@ struct roots_view {
|
||||||
struct wl_listener new_subsurface;
|
struct wl_listener new_subsurface;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
struct wl_signal unmap;
|
||||||
struct wl_signal destroy;
|
struct wl_signal destroy;
|
||||||
} events;
|
} events;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ struct roots_view *view_create(struct roots_desktop *desktop) {
|
||||||
}
|
}
|
||||||
view->desktop = desktop;
|
view->desktop = desktop;
|
||||||
view->alpha = 1.0f;
|
view->alpha = 1.0f;
|
||||||
|
wl_signal_init(&view->events.unmap);
|
||||||
wl_signal_init(&view->events.destroy);
|
wl_signal_init(&view->events.destroy);
|
||||||
wl_list_init(&view->children);
|
wl_list_init(&view->children);
|
||||||
return view;
|
return view;
|
||||||
|
|
|
@ -645,6 +645,7 @@ static void seat_view_destroy(struct roots_seat_view *seat_view) {
|
||||||
seat->cursor->pointer_view = NULL;
|
seat->cursor->pointer_view = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wl_list_remove(&seat_view->view_unmap.link);
|
||||||
wl_list_remove(&seat_view->view_destroy.link);
|
wl_list_remove(&seat_view->view_destroy.link);
|
||||||
wl_list_remove(&seat_view->link);
|
wl_list_remove(&seat_view->link);
|
||||||
free(seat_view);
|
free(seat_view);
|
||||||
|
@ -657,6 +658,12 @@ static void seat_view_destroy(struct roots_seat_view *seat_view) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void seat_view_handle_unmap(struct wl_listener *listener, void *data) {
|
||||||
|
struct roots_seat_view *seat_view =
|
||||||
|
wl_container_of(listener, seat_view, view_unmap);
|
||||||
|
seat_view_destroy(seat_view);
|
||||||
|
}
|
||||||
|
|
||||||
static void seat_view_handle_destroy(struct wl_listener *listener, void *data) {
|
static void seat_view_handle_destroy(struct wl_listener *listener, void *data) {
|
||||||
struct roots_seat_view *seat_view =
|
struct roots_seat_view *seat_view =
|
||||||
wl_container_of(listener, seat_view, view_destroy);
|
wl_container_of(listener, seat_view, view_destroy);
|
||||||
|
@ -675,6 +682,8 @@ static struct roots_seat_view *seat_add_view(struct roots_seat *seat,
|
||||||
|
|
||||||
wl_list_insert(seat->views.prev, &seat_view->link);
|
wl_list_insert(seat->views.prev, &seat_view->link);
|
||||||
|
|
||||||
|
seat_view->view_unmap.notify = seat_view_handle_unmap;
|
||||||
|
wl_signal_add(&view->events.unmap, &seat_view->view_unmap);
|
||||||
seat_view->view_destroy.notify = seat_view_handle_destroy;
|
seat_view->view_destroy.notify = seat_view_handle_destroy;
|
||||||
wl_signal_add(&view->events.destroy, &seat_view->view_destroy);
|
wl_signal_add(&view->events.destroy, &seat_view->view_destroy);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue