From 63a1f613dbea8a73286866e424ac05a0b79462b4 Mon Sep 17 00:00:00 2001 From: bentley Date: Sat, 6 Apr 2019 13:51:18 +0000 Subject: [PATCH] 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@ --- xserver/config/wscons.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,