osd-thumbnail: make sure item->{normal,active}_title are non-null

The if-statement doesn't make sense, because `view_get_string_prop()`
never returns NULL. And if it did, it would cause segfault in
`osd_thumbnail_update()`.
This commit is contained in:
tokyo4j 2025-10-12 23:59:04 +09:00 committed by Hiroaki Yamamoto
parent da96513e70
commit 27cc738985

View file

@ -156,14 +156,12 @@ create_item_scene(struct wlr_scene_tree *parent, struct view *view,
/* title */
const char *title = view_get_string_prop(view, "title");
if (title) {
item->normal_title = create_title(item->tree, switcher_theme,
title, theme->osd_label_text_color,
theme->osd_bg_color, title_y);
item->active_title = create_title(item->tree, switcher_theme,
title, theme->osd_label_text_color,
switcher_theme->item_active_bg_color, title_y);
}
item->normal_title = create_title(item->tree, switcher_theme,
title, theme->osd_label_text_color,
theme->osd_bg_color, title_y);
item->active_title = create_title(item->tree, switcher_theme,
title, theme->osd_label_text_color,
switcher_theme->item_active_bg_color, title_y);
/* icon */
int icon_size = switcher_theme->item_icon_size;