xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #86: expose-server-keymap.patch

File expose-server-keymap.patch, 1.4 KB (added by Antoine Martin, 8 years ago)

expose the server keymap to the client (could be useful in the future)

  • xpra/x11/server_keyboard_config.py

     
    6060    def __repr__(self):
    6161        return "KeyboardConfig(%s / %s)" % (self.xkbmap_layout, self.xkbmap_variant)
    6262
     63    def get_properties(self):
     64        props = {}
     65        for x in ("print", "query", "mod_meanings", "mod_managed", "mod_pointermissing",
     66                  "keycodes", "x11_keycodes", "layout", "variant"):
     67            v = getattr(self, "xkbmap_"+x)
     68            if v:
     69                props[x] = v
     70        return props
     71
     72
    6373    def get_info(self):
    6474        info = {"enabled"   : self.enabled,
    6575                "native"    : self.is_native_keymap,
  • xpra/x11/x11_server_base.py

     
    144144    def make_hello(self):
    145145        capabilities = GTKServerBase.make_hello(self)
    146146        capabilities["resize_screen"] = self.randr
     147        if self.keyboard_config and self.keyboard_config.enabled:
     148            #expose actual keymap used:
     149            for k,v in self.keyboard_config.get_properties().items():
     150                capabilities["keyboard."+k] = v
    147151        return capabilities
    148152
    149153    def do_get_info(self, proto, server_sources, window_ids):