diff options
-rw-r--r-- | swaybar/render.c | 4 | ||||
-rw-r--r-- | wayland/pango.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/swaybar/render.c b/swaybar/render.c index a773df7b..7dfac891 100644 --- a/swaybar/render.c +++ b/swaybar/render.c | |||
@@ -205,7 +205,7 @@ void workspace_button_size(struct window *window, const char *workspace_name, in | |||
205 | const char *stripped_name = strip_workspace_name(swaybar.config->strip_workspace_numbers, workspace_name); | 205 | const char *stripped_name = strip_workspace_name(swaybar.config->strip_workspace_numbers, workspace_name); |
206 | 206 | ||
207 | get_text_size(window->cairo, window->font, width, height, | 207 | get_text_size(window->cairo, window->font, width, height, |
208 | window->scale, false, "%s", stripped_name); | 208 | window->scale, true, "%s", stripped_name); |
209 | *width += 2 * ws_horizontal_padding; | 209 | *width += 2 * ws_horizontal_padding; |
210 | *height += 2 * ws_vertical_padding; | 210 | *height += 2 * ws_vertical_padding; |
211 | } | 211 | } |
@@ -241,7 +241,7 @@ static void render_workspace_button(struct window *window, struct config *config | |||
241 | cairo_set_source_u32(window->cairo, box_colors.text); | 241 | cairo_set_source_u32(window->cairo, box_colors.text); |
242 | cairo_move_to(window->cairo, (int)*x + ws_horizontal_padding, margin); | 242 | cairo_move_to(window->cairo, (int)*x + ws_horizontal_padding, margin); |
243 | pango_printf(window->cairo, window->font, window->scale, | 243 | pango_printf(window->cairo, window->font, window->scale, |
244 | false, "%s", stripped_name); | 244 | true, "%s", stripped_name); |
245 | 245 | ||
246 | *x += width + ws_spacing; | 246 | *x += width + ws_spacing; |
247 | } | 247 | } |
diff --git a/wayland/pango.c b/wayland/pango.c index 38993243..5781541b 100644 --- a/wayland/pango.c +++ b/wayland/pango.c | |||
@@ -11,9 +11,10 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text | |||
11 | int32_t scale, bool markup) { | 11 | int32_t scale, bool markup) { |
12 | PangoLayout *layout = pango_cairo_create_layout(cairo); | 12 | PangoLayout *layout = pango_cairo_create_layout(cairo); |
13 | PangoAttrList *attrs = pango_attr_list_new(); | 13 | PangoAttrList *attrs = pango_attr_list_new(); |
14 | char *buf = malloc(2048); | ||
14 | if (markup) { | 15 | if (markup) { |
15 | pango_parse_markup(text, -1, 0, &attrs, NULL, NULL, NULL); | 16 | pango_parse_markup(text, -1, 0, &attrs, &buf, NULL, NULL); |
16 | pango_layout_set_markup(layout, text, -1); | 17 | pango_layout_set_markup(layout, buf, -1); |
17 | } else { | 18 | } else { |
18 | pango_layout_set_text(layout, text, -1); | 19 | pango_layout_set_text(layout, text, -1); |
19 | } | 20 | } |
@@ -24,6 +25,7 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text | |||
24 | pango_layout_set_attributes(layout, attrs); | 25 | pango_layout_set_attributes(layout, attrs); |
25 | pango_attr_list_unref(attrs); | 26 | pango_attr_list_unref(attrs); |
26 | pango_font_description_free(desc); | 27 | pango_font_description_free(desc); |
28 | free(buf); | ||
27 | return layout; | 29 | return layout; |
28 | } | 30 | } |
29 | 31 | ||