Module: tools Branch: master Commit: 5b2476cdd90aa396a195bfe67cefbe82ab8e1a26 URL: https://source.winehq.org/git/tools.git/?a=commit;h=5b2476cdd90aa396a195bfe6... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Jan 27 13:55:26 2022 +0100 testbot/SetWinLocale: Take keyboard layouts preference order into account. See for instance the Armenian locale (hy). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/bin/SetWinLocale | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale index 654ec46..f725e30 100755 --- a/testbot/bin/SetWinLocale +++ b/testbot/bin/SetWinLocale @@ -661,13 +661,17 @@ sub GetWinKeyboardIds($) } # Look for the locale's keyboard id(s). + my %WinLayouts; foreach my $VName (keys %$Values) { - next if ($VName !~ /^[0-9A-F]{4}:/); - $WinKeyboardIds{$Locale} = [$VName]; - last; + # The value is the keyboard layout's preference order + $WinLayouts{hex($Values->{$VName})} = $VName if ($VName =~ /^[0-9A-F]{4}:/); + } + $WinKeyboardIds{$Locale} = %WinLayouts ? [] : $Keyboards{$Locale}; + foreach my $Index (sort { $a cmp $b } keys %WinLayouts) + { + push @{$WinKeyboardIds{$Locale}}, $WinLayouts{$Index}; } - $WinKeyboardIds{$Locale} ||= $Keyboards{$Locale}; if (!$WinKeyboardIds{$Locale}) { FatalError("could not find the $Locale LCID and keyboard ids. Maybe the locale is not installed?\n");