]> git.eshelyaron.com Git - emacs.git/commitdiff
Try to make sure an XKB desc is always available
authorPo Lu <luangruo@yahoo.com>
Fri, 14 Jan 2022 06:57:55 +0000 (14:57 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 14 Jan 2022 06:57:55 +0000 (14:57 +0800)
* 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

index ff93e210a1b75de54975ea5bc701de307696e741..3a9f5c9ef9f7329b90746cd54c3976b1c20e2ca7 100644 (file)
@@ -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);
            }