From: Johan Malm Date: Sat, 21 Aug 2021 10:16:15 +0000 (+0100) Subject: ssd: handle font texture creation when view->width not yet set X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c13a520673d4248d46506802e6c23e27c24fcb1a;p=proto%2Flabwc.git ssd: handle font texture creation when view->width not yet set --- diff --git a/src/ssd.c b/src/ssd.c index e8d5a5c2..3b8fbb84 100644 --- a/src/ssd.c +++ b/src/ssd.c @@ -251,7 +251,6 @@ ssd_update_title(struct view *view) .size = rc.font_size_activewindow, }; - /* get the size we can play within */ struct ssd_part *part; wl_list_for_each(part, &view->ssd.parts, link) { if (part->type == LAB_SSD_PART_TITLE) { @@ -260,8 +259,10 @@ ssd_update_title(struct view *view) } } + int max_width = part->box.width > 0 ? part->box.width : 1000; + /* TODO: use window.active.label.text.color here */ - font_texture_create(view->server, &view->title, part->box.width, + font_texture_create(view->server, &view->title, max_width, view->impl->get_string_prop(view, "title"), &font, theme->menu_items_active_text_color);