#2241 closed defect (fixed)
HTML5 client erroneously fetches keyboard layouts from the browser's language
Reported by: | Carlos Solís | Owned by: | Carlos Solís |
---|---|---|---|
Priority: | major | Milestone: | 4.0 |
Component: | html5 | Version: | 2.5.x |
Keywords: | Cc: |
Description
When connecting to Xpra from the HTML5 client, the system attempts to obtain the keyboard layout from the browser's reported language - unfortunately, in my particular case this is causing wrong guesses, namely:
- My Firefox browser reports "ES-ar" (Spanish, Argentina) and Xpra's logs report switching to "ar" (Arabic).
- My Microsoft Edge Browser reports more accurately as "ES-cr" (Spanish, Costa Rica) and Xpra's logs report attempting to switch to a non-existing "cr" layout, causing a failure.
In both cases, this causes the inability to type into any windows. Xterm in particular only seems to display numbers and a few control characters. Not even setting the server to use a specific keyboard layout through the --keyboard-layout=XX command seems to work, as the layout is dynamically switched because of the heuristics detailed above. This bug might have gone unnoticed before, because there are EN and US layouts available by default.
Change History (4)
comment:1 Changed 17 months ago by
Milestone: | → 4.0 |
---|---|
Priority: | minor → major |
Status: | new → assigned |
comment:2 Changed 14 months ago by
Owner: | changed from Antoine Martin to Carlos Solís |
---|---|
Status: | assigned → new |
comment:3 Changed 13 months ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Not heard back, closing.
comment:4 Changed 6 weeks ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2241
So, the difficulty here is that the browsers return ISO 639-1 codes (see https://stackoverflow.com/questions/5580876/navigator-language-list-of-all-languages) but we need an X11 keymap name (see List all valid kbd layouts, variants and toggle options (to use with setxkbmap)).
The original code was trying to make sure that when we get
en_GB
then we will use thegb
x11 keymap.For
en
, we should useus
.And in your case, for
ES-ar
we should be usinges
or maybelatam
? Is there anar
variant? If so, how do we configure that variant with X11?So r24878 changes the detection code to do that, using the primary language and adding entries to the existing
LANGUAGE_TO_LAYOUT
lookup table.I couldn't see an easy way of automatically mapping the ISO codes to X11 layouts... so I did it by hand: r24879 - that took a while. And it is still incomplete as some locales don't have an obvious X11 language mapping, and new locales may be added to browsers, and some are probably missing from the list I used to begin with...
@csolisr: does that work for you? You can apply the patches by hand, download a new copy of the html5 client code from svn, or use the latest online version here: https://xpra.org/html5/