Skip to content

Commit

Permalink
move set_layout to the keyboard config class, so shadow servers can s…
Browse files Browse the repository at this point in the history
…imply inherit the no-op default implementation

git-svn-id: https://xpra.org/svn/Xpra/trunk@12399 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 16, 2016
1 parent b558d13 commit a71e881
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/xpra/server/keyboard_config_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ def get_info(self):
}
return info


def parse_options(self, props):
pass

def get_hash(self):
return ""

def set_layout(self, layout, variant):
pass

def set_keymap(self):
pass

Expand Down
7 changes: 1 addition & 6 deletions src/xpra/server/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,12 +1166,7 @@ def _make_metadata(self, wid, window, propname):
# Keyboard magic
#
def set_layout(self, layout, variant):
keylog("set_layout(%s, %s)", layout, variant)
if layout!=self.keyboard_config.xkbmap_layout or variant!=self.keyboard_config.xkbmap_variant:
self.keyboard_config.xkbmap_layout = layout
self.keyboard_config.xkbmap_variant = variant
return True
return False
return self.keyboard_config.set_layout(layout, variant)

def keys_changed(self):
if self.keyboard_config:
Expand Down
9 changes: 9 additions & 0 deletions src/xpra/x11/server_keyboard_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ def is_modifier(self, keycode):
return False


def set_layout(self, layout, variant):
log("set_layout(%s, %s)", layout, variant)
if layout!=self.xkbmap_layout or variant!=self.xkbmap_variant:
self.keyboard_config.xkbmap_layout = layout
self.keyboard_config.xkbmap_variant = variant
return True
return False


def set_keymap(self):
if not self.enabled:
return
Expand Down

0 comments on commit a71e881

Please sign in to comment.