From b5686355f3672769c300022a0b4267745594fe4f Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Mon, 18 Dec 2017 15:54:49 -0500 Subject: [PATCH] add some input device cleanup to x11 backend --- backend/x11/backend.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/x11/backend.c b/backend/x11/backend.c index a218c589..f6f9cfa8 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -244,6 +244,17 @@ static void wlr_x11_backend_destroy(struct wlr_backend *backend) { struct wlr_x11_output *output = &x11->output; wlr_output_destroy(&output->wlr_output); + wl_signal_emit(&backend->events.input_remove, &x11->pointer_dev); + wl_signal_emit(&backend->events.input_remove, &x11->keyboard_dev); + // TODO probably need to use wlr_keyboard_destroy, but the devices need to + // be malloced for that to work + if (x11->keyboard_dev.keyboard->keymap) { + xkb_keymap_unref(x11->keyboard_dev.keyboard->keymap); + } + if (x11->keyboard_dev.keyboard->xkb_state) { + xkb_state_unref(x11->keyboard_dev.keyboard->xkb_state); + } + wl_list_remove(&x11->display_destroy.link); wl_event_source_remove(x11->frame_timer);