From: Po Lu Date: Fri, 14 Jan 2022 06:57:55 +0000 (+0800) Subject: Try to make sure an XKB desc is always available X-Git-Tag: emacs-29.0.90~3078 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1158c880e25db99e82945ab4af539a55ea18386f;p=emacs.git 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. --- 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); }