diff options
author | Anthony J. Bentley <bentley@cvs.openbsd.org> | 2019-04-06 13:51:19 +0000 |
---|---|---|
committer | Anthony J. Bentley <bentley@cvs.openbsd.org> | 2019-04-06 13:51:19 +0000 |
commit | 8e965a388f37e43d8c581eae80f541faaabd8a3f (patch) | |
tree | 49773559d11393ff7fed974e6dd7fed8aac0101d /xserver | |
parent | cbab4fb0965b77a7915648a43dd0e407199128ea (diff) |
When checking keyboard variants, perform a stricter comparison.
This prevents kbd(8) layouts with particular bitmasks from being
wrongly detected as French.
Broken behavior reported by Diogo Galvao; thanks!
ok mpi@ matthieu@
Diffstat (limited to 'xserver')
-rw-r--r-- | xserver/config/wscons.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xserver/config/wscons.c b/xserver/config/wscons.c index a0a18f37a..8567eeef9 100644 --- a/xserver/config/wscons.c +++ b/xserver/config/wscons.c @@ -139,7 +139,9 @@ wscons_add_keyboard(void) break; } for (i = 0; kbdvar[i].val; i++) - if ((wsenc & kbdvar[i].val) == kbdvar[i].val) { + if ((wsenc & kbdvar[i].val) == kbdvar[i].val && + (KB_ENCODING(wsenc) == KB_ENCODING(kbdvar[i].val) || + !KB_ENCODING(kbdvar[i].val))) { LogMessageVerb(X_INFO, 3, "wskbd: using variant %s\n", kbdvar[i].name); input_options = input_option_new(input_options, |