aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/wayland/backend.c6
-rw-r--r--backend/wayland/seat.c45
2 files changed, 26 insertions, 25 deletions
diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c
index 720cecc5..f3aa462a 100644
--- a/backend/wayland/backend.c
+++ b/backend/wayland/backend.c
@@ -469,7 +469,11 @@ static void backend_destroy(struct wlr_backend *backend) {
wlr_drm_format_set_finish(&wl->shm_formats);
wlr_drm_format_set_finish(&wl->linux_dmabuf_v1_formats);
- destroy_wl_seats(wl);
+ struct wlr_wl_seat *seat, *tmp_seat;
+ wl_list_for_each_safe(seat, tmp_seat, &wl->seats, link) {
+ destroy_wl_seat(seat);
+ }
+
if (wl->zxdg_decoration_manager_v1) {
zxdg_decoration_manager_v1_destroy(wl->zxdg_decoration_manager_v1);
}
diff --git a/backend/wayland/seat.c b/backend/wayland/seat.c
index b81fe219..35fc4dc2 100644
--- a/backend/wayland/seat.c
+++ b/backend/wayland/seat.c
@@ -246,34 +246,31 @@ bool create_wl_seat(struct wl_seat *wl_seat, struct wlr_wl_backend *wl) {
return true;
}
-void destroy_wl_seats(struct wlr_wl_backend *wl) {
- struct wlr_wl_seat *seat, *tmp_seat;
- wl_list_for_each_safe(seat, tmp_seat, &wl->seats, link) {
- if (seat->wl_touch) {
- wl_touch_release(seat->wl_touch);
- wlr_touch_finish(&seat->wlr_touch);
- }
- if (seat->wl_pointer) {
- finish_seat_pointer(seat);
- }
- if (seat->wl_keyboard) {
- wl_keyboard_release(seat->wl_keyboard);
+void destroy_wl_seat(struct wlr_wl_seat *seat) {
+ if (seat->wl_touch) {
+ wl_touch_release(seat->wl_touch);
+ wlr_touch_finish(&seat->wlr_touch);
+ }
+ if (seat->wl_pointer) {
+ finish_seat_pointer(seat);
+ }
+ if (seat->wl_keyboard) {
+ wl_keyboard_release(seat->wl_keyboard);
- if (seat->backend->started) {
- wlr_keyboard_finish(&seat->wlr_keyboard);
- }
- }
- if (seat->zwp_tablet_seat_v2) {
- finish_seat_tablet(seat);
+ if (seat->backend->started) {
+ wlr_keyboard_finish(&seat->wlr_keyboard);
}
+ }
+ if (seat->zwp_tablet_seat_v2) {
+ finish_seat_tablet(seat);
+ }
- free(seat->name);
- assert(seat->wl_seat);
- wl_seat_destroy(seat->wl_seat);
+ free(seat->name);
+ assert(seat->wl_seat);
+ wl_seat_destroy(seat->wl_seat);
- wl_list_remove(&seat->link);
- free(seat);
- }
+ wl_list_remove(&seat->link);
+ free(seat);
}
bool wlr_input_device_is_wl(struct wlr_input_device *dev) {