]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-keymap-icon: Fix falling back to label-plugin when there is no pre-rendered text
authorHans de Goede <hansg@kernel.org>
Thu, 3 Jul 2025 11:05:13 +0000 (13:05 +0200)
committerHans de Goede <hansg@kernel.org>
Mon, 14 Jul 2025 08:20:16 +0000 (10:20 +0200)
In order for the fallback path (keymap_icon->has_prerendered_text == false)
to work properly keymap_icon->keymap_name must be set when no pre-rendered
text is found.

Tested by temporarily removing the "us" entry from ply-keymap-metadata.h.

Signed-off-by: Hans de Goede <hansg@kernel.org>
src/libply-splash-graphics/ply-keymap-icon.c

index 26aabfdfc2e195e1cc073884d80476af8ea5e9bb..41cb3b722dc901f22fcf3d79ad8f1121a77133c9 100644 (file)
@@ -114,8 +114,10 @@ ply_keymap_icon_fill_keymap_info (ply_keymap_icon_t *keymap_icon)
                 }
         }
 
-        if (keymap_icon->keymap_offset == -1)
+        if (keymap_icon->keymap_offset == -1) {
                 ply_trace ("Warning: no pre-rendered text for '%s' keymap", keymap_without_variant);
+                keymap_icon->keymap_name = strdup (keymap_without_variant);
+        }
 
         free (keymap_without_variant);
 }