From 1158c880e25db99e82945ab4af539a55ea18386f Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 14 Jan 2022 14:57:55 +0800 Subject: [PATCH] Try to make sure an XKB desc is always available * src/xterm.c (handle_one_xevent): Re-retrieve XKB map if it's unavailable for some reason upon handling an XKB map or keyboard notify event. --- src/xterm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index ff93e210a1b..3a9f5c9ef9f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11461,6 +11461,20 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_find_modifier_meanings (dpyinfo); } + else + { + dpyinfo->xkb_desc = XkbGetMap (dpyinfo->display, + (XkbKeySymsMask + | XkbKeyTypesMask + | XkbModifierMapMask + | XkbVirtualModsMask), + XkbUseCoreKbd); + + if (dpyinfo->xkb_desc) + XkbGetNames (dpyinfo->display, + XkbGroupNamesMask | XkbVirtualModNamesMask, + dpyinfo->xkb_desc); + } XkbRefreshKeyboardMapping (&xkbevent->map); } -- 2.39.2