From f90a9ad6596ee752e3648611df3e4d4f447ef674 Mon Sep 17 00:00:00 2001 From: Riteo Siuga Date: Thu, 27 Nov 2025 23:02:08 +0100 Subject: [PATCH] Destroy XKB keymap and state on seat capability change Wasn't that much of a concern as it would have been disposed of next time a keyboard got added, but it's still a good thing to do. --- platform/linuxbsd/wayland/wayland_thread.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index b0131f48bf1..67ca1de696c 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -1613,6 +1613,16 @@ void WaylandThread::_wl_seat_on_capabilities(void *data, struct wl_seat *wl_seat ss->xkb_compose_state = nullptr; } + if (ss->xkb_keymap) { + xkb_keymap_unref(ss->xkb_keymap); + ss->xkb_keymap = nullptr; + } + + if (ss->xkb_state) { + xkb_state_unref(ss->xkb_state); + ss->xkb_state = nullptr; + } + if (ss->wl_keyboard) { wl_keyboard_destroy(ss->wl_keyboard); ss->wl_keyboard = nullptr;