Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.92k stars 165 forks source link

Fix "--keyboard-sync" option is effective in command line. #4329

Closed unisons closed 1 month ago

unisons commented 1 month ago

keyboard-sync options in command line was not working.

The options is parsed in input.py as below:

https://github.com/Xpra-org/xpra/blob/775d435b83097b0d97d55b3173ab5d9503ee5971/xpra/server/mixins/input.py#L58

    def init(self, opts) -> None:
        props = typedict()
        keymap = props.setdefault("keymap", {})
        for option in ("sync", "layout", "layouts", "variant", "variants", "options"):
            v = getattr(opts, f"keyboard_{option}", None)
            if v is not None:
                keymap[option] = v
        self.keyboard_config = self.get_keyboard_config(props)

The client sends the keyboard config but it doesn't have keyboard sync data so the default value (True) is used.

With --keyboard-sync=no option, the client UI displays the option as off but it is not on the server side.

totaam commented 1 month ago

Thanks!

totaam commented 1 month ago

I didn't like the special case for sync so 2d009020c1e0dea32c791d1516f1aa94a3428a45 renames it.