When using evdev support the XKB keymap name (with variant) for Dvorak
users will be e.g. "US (Dvorak)". The Dvorak layouts are not described
in /usr/share/X11/xkb/rules/evdev.xml, so these are not added to
ply-keymap-metadata.h / keymap-render.png .
For the console-keymap case dvorak is handled specially in:
keymap-render.py:normalize_keymaps()
ply-keymap-icon.c:ply_keymap_normalize_keymap()
mapping all keymap-names with a lowercase dvorak in there to "dvorak",
change this special handling to be case-insensitive so that it also works
for the xkb-keymap case.
Note the keymap-render.py change really is a no-op since keymap-render.py
only calls normalize_keymaps() on console-keymaps which are always
lower-case. normalize_keymaps() should still be updated though to keep
the 2 functions in sync.
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2341810
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
# on machines returning "us" for both is not useful.
# Presumably users using dvorak now which variant they use
# so we just describe all dvorak layouts as "dvorak".
- if "dvorak" in keymap:
+ if "dvorak" in keymap.lower():
return "dvorak"
# mac / sun keymaps are prefixes with mac / sun / sun[4-6]t
int i, length;
/* Special case for dvorak layouts */
- if (strstr (keymap_with_variant, "dvorak"))
+ if (strcasestr (keymap_with_variant, "dvorak"))
return strdup ("dvorak");
/* Check for and skip sun / mac prefixes */