diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-02 14:23:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 14:23:01 -0400 |
commit | 4134407fa967c7f45cd09554b74a15f28974fca5 (patch) | |
tree | a1a6122d927b95b29375af7dbf6adccd8cb4e71f /common/pango.c | |
parent | 2a8985a3451f8be7e4b1eb21e3266e9f5b979b39 (diff) | |
parent | ef50d84be1180a7ddd73e1273ebb77503b3f36c4 (diff) |
Merge pull request #1690 from swaywm/i3bar-json
I3bar json
Diffstat (limited to 'common/pango.c')
-rw-r--r-- | common/pango.c | 9 |
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 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include "log.h" PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text, int32_t scale, bool markup) { @@ -13,7 +14,13 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, PangoAttrList *attrs; if (markup) { char *buf; - pango_parse_markup(text, -1, 0, &attrs, &buf, NULL, NULL); + GError *error = NULL; + if (!sway_assert(pango_parse_markup( + text, -1, 0, &attrs, &buf, NULL, &error), + "pango_parse_markup '%s' -> error %s", text, + error ? error->message : NULL)) { + return NULL; + } pango_layout_set_markup(layout, buf, -1); free(buf); } else { |