summaryrefslogtreecommitdiffstats
path: root/common/pango.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-04-02 14:23:01 -0400
committerLibravatar GitHub <noreply@github.com>2018-04-02 14:23:01 -0400
commit4134407fa967c7f45cd09554b74a15f28974fca5 (patch)
treea1a6122d927b95b29375af7dbf6adccd8cb4e71f /common/pango.c
parentMerge pull request #1697 from RedSoxFan/back-and-forth (diff)
parentRender blocks the correct order (diff)
downloadsway-4134407fa967c7f45cd09554b74a15f28974fca5.tar.gz
sway-4134407fa967c7f45cd09554b74a15f28974fca5.tar.zst
sway-4134407fa967c7f45cd09554b74a15f28974fca5.zip
Merge pull request #1690 from swaywm/i3bar-json
I3bar json
Diffstat (limited to 'common/pango.c')
-rw-r--r--common/pango.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/pango.c b/common/pango.c
index 2ae7883c..658d2876 100644
--- a/common/pango.c
+++ b/common/pango.c
@@ -6,6 +6,7 @@
6#include <stdio.h> 6#include <stdio.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <string.h> 8#include <string.h>
9#include "log.h"
9 10
10PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, 11PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
11 const char *text, int32_t scale, bool markup) { 12 const char *text, int32_t scale, bool markup) {
@@ -13,7 +14,13 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
13 PangoAttrList *attrs; 14 PangoAttrList *attrs;
14 if (markup) { 15 if (markup) {
15 char *buf; 16 char *buf;
16 pango_parse_markup(text, -1, 0, &attrs, &buf, NULL, NULL); 17 GError *error = NULL;
18 if (!sway_assert(pango_parse_markup(
19 text, -1, 0, &attrs, &buf, NULL, &error),
20 "pango_parse_markup '%s' -> error %s", text,
21 error ? error->message : NULL)) {
22 return NULL;
23 }
17 pango_layout_set_markup(layout, buf, -1); 24 pango_layout_set_markup(layout, buf, -1);
18 free(buf); 25 free(buf);
19 } else { 26 } else {