Skip to content

Commit aeb0b6d

Browse files
authored
Merge pull request neutrinolabs#3476 from matt335672/kbd_fallback
Add support for 16-bit layout fallback for xorgxrdp
2 parents aac4946 + c8f5888 commit aeb0b6d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

xrdp/lang.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,26 @@ xrdp_init_xkb_layout(struct xrdp_client_info *client_info)
705705
break;
706706
}
707707
}
708+
if (rdp_layout[0] == '\0' && (client_info->keylayout & ~0xffff) != 0)
709+
{
710+
// We failed to match the layout, but we may be able
711+
// to match on the lower 16-bits
712+
int alt_layout = client_info->keylayout & 0xffff;
713+
for (index = 0; index < items->count; index++)
714+
{
715+
item = (char *)list_get_item(items, index);
716+
value = (char *)list_get_item(values, index);
717+
int rdp_layout_id = g_htoi(value);
718+
if (rdp_layout_id == alt_layout)
719+
{
720+
g_strncpy(rdp_layout, item, 255);
721+
LOG(LOG_LEVEL_INFO,
722+
"Failed to match layout %08X, but matched %04X to %s",
723+
client_info->keylayout, alt_layout, rdp_layout);
724+
break;
725+
}
726+
}
727+
}
708728
list_clear(items);
709729
list_clear(values);
710730
file_read_section(fd, section_layouts_map, items, values);

0 commit comments

Comments
 (0)