]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid unnecessary lookup of min and max keycodes when XKB is present
authorPo Lu <luangruo@yahoo.com>
Wed, 12 Jan 2022 02:24:01 +0000 (10:24 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 12 Jan 2022 02:24:01 +0000 (10:24 +0800)
* src/xterm.c (x_emacs_to_x_modifiers): Avoid calling
XDisplayKeycodes when that information is available in the xkb
desc and is not needed anyway.

src/xterm.c

index af0c5c0bfdef52534d520f34f5eb8e0fad364eb1..80cf80f7d8eb1325ced9b764a6acb14eaff661d6 100644 (file)
@@ -5386,8 +5386,6 @@ x_find_modifier_meanings (struct x_display_info *dpyinfo)
   dpyinfo->super_mod_mask = 0;
   dpyinfo->hyper_mod_mask = 0;
 
-  XDisplayKeycodes (dpyinfo->display, &min_code, &max_code);
-
 #ifdef HAVE_XKB
   if (dpyinfo->xkb_desc)
     {
@@ -5432,6 +5430,8 @@ x_find_modifier_meanings (struct x_display_info *dpyinfo)
     }
 #endif
 
+  XDisplayKeycodes (dpyinfo->display, &min_code, &max_code);
+
   syms = XGetKeyboardMapping (dpyinfo->display,
                              min_code, max_code - min_code + 1,
                              &syms_per_code);