From: Daniel Hill <daniel(a)gluo.nz> Dvorak detection would sometimes fallback to Phantom keys, because we only use seq as a tie breaker greater emphasis on locality is required for layouts using the same language. A rewrite to use taxi cab distance for the score might be more accurate, especially if we introduce more alternative layouts. Signed-off-by: Daniel Hill <daniel(a)gluo.nz> --- dlls/winex11.drv/keyboard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 89bf7da550a..2e7a118c110 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1522,8 +1522,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display ) } TRACE("matches=%d, mismatches=%d, seq=%d, score=%d\n", match, mismatch, seq, score); - if ((score > max_score) || - ((score == max_score) && (seq > max_seq))) { + if (score + (int)seq > max_score + (int)max_seq) { /* best match so far */ kbd_layout = current; max_score = score; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4869