emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f2fcea2716: Avoid unnecessary lookup of min and max keycodes when


From: Po Lu
Subject: master f2fcea2716: Avoid unnecessary lookup of min and max keycodes when XKB is present
Date: Tue, 11 Jan 2022 21:24:47 -0500 (EST)

branch: master
commit f2fcea2716405aac9a3a6013b284b6b7be634725
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Avoid unnecessary lookup of min and max keycodes when XKB is present
    
    * 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index af0c5c0bfd..80cf80f7d8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]