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
Invalid variant ignored #16
Comments
This is the intended behavior; it is assumed to work this way by the "rules" file, so we can't change it really. From my tests X does the same, can you tell me how you tested it? Coincidentally, since libxkbcommon 0.5.0 we now do print a warning when there is a user-provided RMLVO value which is not matched anywhere in the rules file (see d8a4f52). It turns out to not be very effective though because most settings are matched by wildcards whether they are valid or not (in the current rules file in xkeyboard-config at least). But it works well for misspelled "option" values, and it also warns in this case:
Here are some technical details if you're interested: I wrote a document a while ago describing what the rules file: https://raw.githubusercontent.com/xkbcommon/libxkbcommon/master/doc/rules-format.txt It is not "official", but I tried to follow the parser in libxkbfile exactly (used by setxkbmap and friends, and copied verbatim in the X server). In the Notes section I mention:
And X has the same behavior: Since all the rules which match on both layout and variant look something like this:
Or this:
this doesn't match, it only matches these rules:
And since |
Thanks for the detailed explanation. I can confirm that an error is printed with 0.5.0, I thought I was testing with 0.5.0 all along, but as it turns out I was using the previous release (a package update had failed without me noticing): $ ./systemd-evcat As to how X appears to have been working all this time with the wrong variant, I'm not sure. I assume something (Gnome?) may have been setting the correct layout for me and hence masking the error. |
Using libkxbcommon (with the systemd-evcat test tool) I observe:
xkbcommon: DEBUG: Compiling from RMLVO: rules 'evdev', model 'pc105', layout 'us,us', variant 'dvorak-intl', options 'grp:caps_toggle'
xkbcommon: DEBUG: Compiling from KcCGST: keycodes 'evdev+aliases(qwerty)', types 'complete', compat 'complete', symbols 'pc+us+us:2+inet(evdev)+capslock(grouplock)'
(notice the missing trailing comma in the variant). The effect is that I get two plain us keymaps. I would have expected either an error message/failing compilation or for the compiler to somehow make sense of the missing comma (as X does AFAIU).
With the trailing comma:
xkbcommon: DEBUG: Compiling from RMLVO: rules 'evdev', model 'pc105', layout 'us,us', variant 'dvorak-intl,', options 'grp:caps_toggle'
xkbcommon: DEBUG: Compiling from KcCGST: keycodes 'evdev+aliases(qwerty)', types 'complete', compat 'complete', symbols 'pc+us(dvorak-intl)+us:2+inet(evdev)+capslock(grouplock)'
The text was updated successfully, but these errors were encountered: