Skip to content

Commit

Permalink
* make sure we always compute the nuisance modifiers - even when usin…
Browse files Browse the repository at this point in the history
…g an untranslated keymap

* "lock" is always one of them

git-svn-id: https://xpra.org/svn/Xpra/trunk@17026 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 2, 2017
1 parent 3fa3954 commit 9cd9d4f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/xpra/x11/server_keyboard_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,14 @@ def hashadd(v):

def compute_modifier_keynames(self):
self.keycodes_for_modifier_keynames = {}
self.xkbmap_mod_nuisance = set(DEFAULT_MODIFIER_NUISANCE)
keymap = get_default_keymap()
gdk = import_gdk()
if self.keynames_for_mod:
for modifier, keynames in self.keynames_for_mod.items():
for keyname in keynames:
if keyname in DEFAULT_MODIFIER_NUISANCE_KEYNAMES:
self.xkbmap_mod_nuisance.add(modifier)
keyval = gdk.keyval_from_name(keyname)
if keyval==0:
log.error("no keyval found for keyname %s (modifier %s)", keyname, modifier)
Expand Down Expand Up @@ -197,7 +200,7 @@ def compute_client_modifier_keycodes(self):
for k,v in self.keycode_translation.items():
reverse_trans[v] = k
self.modifier_client_keycodes = {}
self.xkbmap_mod_nuisance = set()
self.xkbmap_mod_nuisance = set(DEFAULT_MODIFIER_NUISANCE)
for modifier, keys in server_mappings.items():
#ie: modifier=mod3, keys=[(115, 'Super_L'), (116, 'Super_R'), (127, 'Super_L')]
#if self.is_native_keymap:
Expand All @@ -222,7 +225,7 @@ def compute_client_modifier_keycodes(self):
log("compute_client_modifier_keycodes() mappings=%s", self.modifier_client_keycodes)
log("compute_client_modifier_keycodes() mod nuisance=%s", self.xkbmap_mod_nuisance)
except Exception as e:
log.error("do_set_keymap: %s" % e, exc_info=True)
log.error("Error: compute_client_modifier_keycodes: %s" % e, exc_info=True)

def compute_modifier_map(self):
self.modifier_map = grok_modifier_map(display_get_default(), self.xkbmap_mod_meanings)
Expand Down Expand Up @@ -472,7 +475,7 @@ def change_mask(modifiers, press, info):
#nuisance keys (lock, num, scroll) are toggled by a
#full key press + key release (so act accordingly in the loop below)
nuisance = modifier in self.xkbmap_mod_nuisance
log("keynames(%s)=%s, keycodes=%s, nuisance=%s", modifier, keynames, keycodes, nuisance)
log("keynames(%s)=%s, keycodes=%s, nuisance=%s, nuisance keys=%s", modifier, keynames, keycodes, nuisance, self.xkbmap_mod_nuisance)
modkeycode = None
if not press:
#since we want to unpress something,
Expand Down

0 comments on commit 9cd9d4f

Please sign in to comment.