Giovanni Mascellani : winex11.drv: Allow keyboard layout score to be negative.

Alexandre Julliard julliard at winehq.org
Wed Jun 9 16:43:07 CDT 2021


Module: wine
Branch: master
Commit: 054b7c8204ea7be2157cbeb690dabc85c2eaa08b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=054b7c8204ea7be2157cbeb690dabc85c2eaa08b

Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date:   Wed Jun  9 12:56:18 2021 +0200

winex11.drv: Allow keyboard layout score to be negative.

The keyboard layout matching algorithm can assign a negative score
to a keyboard layout. If the user has a strange keyboard layout,
possibly a custom one, it might happen that all keyboard layouts
known by Wine get a negative score. This is not an error in itself,
and we should still strive to find the best match.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/keyboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index d86f418a64e..5fde07ead31 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1432,7 +1432,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
   KeySym keysym = 0;
   const char (*lkey)[MAIN_LEN][4];
   unsigned max_seq = 0;
-  int max_score = 0, ismatch = 0;
+  int max_score = INT_MIN, ismatch = 0;
   char ckey[256][4];
 
   syms = keysyms_per_keycode;




More information about the wine-cvs mailing list