-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rdp-backend: Fall back to weston.ini keymap if no mapping is found #144
Conversation
Do not force "us" layout when no xkb mapping is found. Weston will this way fallback to the keymap defined in compositor xkb_names which falls back to "us" if no layout is defined in weston.ini.
@microsoft-github-policy-service agree
|
Reload default global compositor keymap when no xkb mapping is found for current keyboard layout. This will default to the keymap in weston.ini or to "us" if no keymap is defined there. Should allow to use custom KLC layouts for keymaps that exist in Linux but have no correspondence in Windows (e.g. altgr-intl). This should also partially fix #173. Still need a way to export weston.ini to the user.
@hideyukn88 any feedback about this pull request? |
Please refer my feedback at microsoft/wslg#1046 (comment), thanks! |
Thanks for looking into this. I'll see if is there an easy way to import keyboard layout configuration into weston using .wslgconfig without exposing the full weston.ini configuration. Meanwhile, I believe this PR could be reviewed and merged independently. At the moment when no keymap mapping can be found between Windows and XKB you hard code an "us" fall back. With the proposed changes you would still have the same result (fallback to us, as weston already does this without hard coding) in the normal scenario without ignoring weston configuration. That would allow power users to e.g. build a custom system image with their weston.ini or even modify weston.ini on the fly like in the ugly way some user were suggesting. |
@fargiolas, thanks for submiting PR. If I understand correctly, TS_RAIL_ORDER_LANGUAGEIMEINFO RDP message (https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdperp/f09de18b-902c-413c-bbd7-4560a4493d2a) is used in RemoteApp (aka RAIL) only, so I think defaulting to keyboard layout from weston.ini still needs to be done at convert_rdp_keyboard_to_xkb_rule_names, otherwise it doesn't work with Fullscreen desktop Linux mode, you can enable that by having below file. c:\Users\[Your Windows Username]\.wslgconfig
|
@hideyukn88, if I get this correctly, if you remove the code that defaults to "us", when no matching keyboard is found So This leads to weston initializing a global keymap in This is what happens at startup both with full screen mode and with RAIL apps. With RAIL apps you also need to handle the layout update that sends a LANGUAGEIMEINFO message, and that's what my second commit is for. When no matching layout is found it creates a new keymap from compositor |
@fargiolas, right, thanks for clarification, your change looks good to me, thanks again for submitting the PR. |
0); | ||
weston_seat_update_keymap(peer_ctx->item.seat, keymap); | ||
xkb_keymap_unref(keymap); | ||
settings->KeyboardLayout = new_keyboard_layout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally "new_keyboard_layout" should reflect the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately that's not always possible because you may have a xkb layout in weston.ini that doesn't have a windows counter-part. E.g. us-intl with altgr dead keys is a pretty popular one for europeans using us keyboards that doesn't exist in windows unless you use MSKLC layouts.
Still you need to save the layout in settings->KeyboardLayout
otherwise the if (new_keyboard_layout != settings->KeyboardLayout)
a few lines above will fail and prevent you to actually change layout.
When no keyboard mapping can be found at the moment we fallback to "us" layout preventing the user to use XKB layouts that have no Windows counterpart. We should instead fallback to the keymap in weston.ini and only fallback to us when no keymap is set there.
Should partially fix microsoft/wslg#173 but it still needs an easy way to export weston.ini to the user. See also that issue for some example use cases for this pull request.