Merge branch 'label-fixes' into 'main'

Label fixes

See merge request plymouth/plymouth!247
This commit is contained in:
Ray Strode 2023-11-30 18:53:39 +00:00
commit 5a720533b8
2 changed files with 3 additions and 3 deletions

View file

@ -100,7 +100,7 @@ ply_label_load_plugin (ply_label_t *label)
/* ...and the FreeType based one after that, it is not a complete substitute (yet). */
if (label->module_handle == NULL)
label->module_handle = ply_open_module (PLYMOUTH_PLUGIN_PATH "label-freetype.so");
label->module_handle = ply_open_module (PLYMOUTH_PLUGIN_PATH "label-freetype.so");
if (label->module_handle == NULL)
return false;

View file

@ -188,7 +188,7 @@ init_pango_text_layout (cairo_t *cairo_context,
if (width >= 0)
pango_layout_set_width (pango_layout, width * PANGO_SCALE);
pango_layout_set_text (pango_layout, text, -1);
pango_layout_set_text (pango_layout, text ?: "", -1);
pango_cairo_update_layout (cairo_context, pango_layout);
return pango_layout;
@ -321,7 +321,7 @@ set_text_for_control (ply_label_plugin_control_t *label,
{
ply_rectangle_t dirty_area;
if (label->text != text) {
if (strcmp (label->text ?: "", text ?: "") != 0) {
dirty_area = label->area;
free (label->text);
label->text = strdup (text);