diff options
author | Brian Ashworth <RedSoxFan@users.noreply.github.com> | 2018-11-25 22:25:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-25 22:25:12 -0500 |
commit | 0e6e5af9833bcfac30d4a19d7fa5b88e81ce67cd (patch) | |
tree | e9adc86b8fda0667758e48f56da13a67ba1b1ba4 /sway/tree/view.c | |
parent | 91bbb2a7ddded2e956c50226d0f0207cd7da550e (diff) | |
parent | b84bf3585ce68784406ebe435dca5f67406db66e (diff) |
Merge pull request #3183 from emersion/fix-escape-pango
Fix pango title escaping
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 63bb8e26..febba3b9 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -835,11 +835,10 @@ static size_t append_prop(char *buffer, const char *value) { if (!value) { return 0; } - // if using pango_markup in font, we need to escape all markup char - // from values to avoid messing with pango markup - if (!config->pango_markup) { + // If using pango_markup in font, we need to escape all markup chars + // from values to make sure tags are not inserted by clients + if (config->pango_markup) { char *escaped_value = escape_pango_markup(value); - lenient_strcat(buffer, escaped_value); size_t len = strlen(escaped_value); free(escaped_value); @@ -856,11 +855,7 @@ static size_t append_prop(char *buffer, const char *value) { */ static size_t parse_title_format(struct sway_view *view, char *buffer) { if (!view->title_format || strcmp(view->title_format, "%title") == 0) { - const char *title = view_get_title(view); - if (buffer && title) { - strcpy(buffer, title); - } - return title ? strlen(title) : 0; + return append_prop(buffer, view_get_title(view)); } size_t len = 0; |