Skip to content

Commit

Permalink
if we don't have keycodes to map, don't translate them
Browse files Browse the repository at this point in the history
this is better than erroring out and not setting up the keyboard at all
  • Loading branch information
totaam committed Apr 2, 2023
1 parent 77cacbb commit ab63964
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions xpra/x11/server_keyboard_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,6 @@ def set_keymap(self, translate_only=False):
clean_keyboard_state()

if not self.raw:
has_keycodes = bool(self.x11_keycodes) or bool(self.keycodes)
assert has_keycodes, "client failed to provide any keycodes!"

clear_modifiers()
clean_keyboard_state()

Expand All @@ -356,11 +353,13 @@ def set_keymap(self, translate_only=False):
if self.x11_keycodes and self.query_struct:
#native full mapping of all keycodes:
self.keycode_translation = set_all_keycodes(self.x11_keycodes, self.keycodes, False, self.keynames_for_mod)
else:
elif self.keycodes:
#if the client does not provide a full native keymap with all the keycodes,
#try to preserve the initial server keycodes and translate the client keycodes instead:
#(used by non X11 clients like osx,win32 or HTML5)
self.keycode_translation = set_keycode_translation(self.x11_keycodes, self.keycodes)
else:
self.keycode_translation = {}
self.add_gtk_keynames()

#now set the new modifier mappings:
Expand Down

0 comments on commit ab63964

Please sign in to comment.