Fix parsing of current keyboard locale
authorMartin Fleisz <martin.fleisz@thincast.com>
Wed, 23 Dec 2020 13:44:31 +0000 (14:44 +0100)
committerakallabeth <akallabeth@users.noreply.github.com>
Thu, 25 Feb 2021 08:51:41 +0000 (09:51 +0100)
(cherry picked from commit 2e59baa33c23cbd0e0ef6e432d8ef202caa34303)

libfreerdp/locale/keyboard_x11.c
libfreerdp/locale/xkb_layout_ids.c

index 7ec8793..858ed7c 100644 (file)
@@ -80,6 +80,11 @@ int freerdp_detect_keyboard_layout_from_xkb(DWORD* keyboardLayoutId)
 
                        layout = beg;
 
+                       /* if multiple languages are present we just take the first one */
+                       pch = strchr(layout, ',');
+                       if (pch)
+                               *pch = '\0';
+
                        /* "variant" */
                        beg = strchr(end + 1, '"');
                        beg += 1;
@@ -124,6 +129,11 @@ int freerdp_detect_keyboard_layout_from_xkb(DWORD* keyboardLayoutId)
 
                        layout = beg;
 
+                       /* if multiple languages are present we just take the first one */
+                       pch = strchr(layout, ',');
+                       if (pch)
+                               *pch = '\0';
+
                        /* "variant" */
                        beg = strchr(end + 1, '"');
                        beg += 1;
index ce0810b..223f7d1 100644 (file)
@@ -776,6 +776,7 @@ static const XKB_LAYOUT xkbLayouts[] = {
        { "gh", 0, gh_variants },                                /* Ghana */
        { "gn", 0, NULL },                                       /* Guinea */
        { "ge", KBD_GEORGIAN, ge_variants },                     /* Georgia */
+       { "at", KBD_GERMAN, de_variants },                       /* Austria */
        { "de", KBD_GERMAN, de_variants },                       /* Germany */
        { "gr", KBD_GREEK, gr_variants },                        /* Greece */
        { "hu", KBD_HUNGARIAN, hu_variants },                    /* Hungary */