From 75293d5fb02f7a968a8409741553d958f015458a Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Thu, 18 May 2023 08:39:24 +0300 Subject: [PATCH] keyboard: use the new data in wlr_keyboard_set_keymap() Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3647 --- types/wlr_keyboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/wlr_keyboard.c b/types/wlr_keyboard.c index 5c143f45..81181704 100644 --- a/types/wlr_keyboard.c +++ b/types/wlr_keyboard.c @@ -189,18 +189,18 @@ bool wlr_keyboard_set_keymap(struct wlr_keyboard *kb, struct xkb_keymap *keymap) return true; } - struct xkb_state *xkb_state = xkb_state_new(kb->keymap); + struct xkb_state *xkb_state = xkb_state_new(keymap); if (xkb_state == NULL) { wlr_log(WLR_ERROR, "Failed to create XKB state"); return false; } - char *keymap_str = xkb_keymap_get_as_string(kb->keymap, XKB_KEYMAP_FORMAT_TEXT_V1); + char *keymap_str = xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1); if (keymap_str == NULL) { wlr_log(WLR_ERROR, "Failed to get string version of keymap"); goto error_xkb_state; } - size_t keymap_size = strlen(kb->keymap_string) + 1; + size_t keymap_size = strlen(keymap_str) + 1; int rw_fd = -1, ro_fd = -1; if (!allocate_shm_file_pair(keymap_size, &rw_fd, &ro_fd)) {