From 94216789872a24614ce85b6c0ea688eee1c9a540 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 26 Jan 2022 20:35:04 +0800 Subject: [PATCH] Add workaround for super modifier misconfiguration to non-XKB code * src/xterm.c (x_find_modifier_meanings): Don't let a modifier be both Hyper and Super. --- src/xterm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index b2cdbe6a0f0..1684048ea4c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5694,6 +5694,12 @@ x_find_modifier_meanings (struct x_display_info *dpyinfo) dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask; } + /* If some keys are both super and hyper, make them just super. + Many X servers are misconfigured so that super and hyper are both + Mod4, but most users have no hyper key. */ + if (dpyinfo->hyper_mod_mask & dpyinfo->super_mod_mask) + dpyinfo->hyper_mod_mask &= ~dpyinfo->super_mod_mask; + XFree (syms); XFreeModifiermap (mods); } -- 2.39.2