From 5c390fceab571319cc9ea5bb9a08e60eeab6a3e7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 16 Nov 2016 22:02:54 +0000 Subject: [PATCH] Make the new ^< and ^> keystrokes add the class prefix. The new font name configured by the keystrokes was missing its "client:" or "server:" prefix, which could have led to the selection of the wrong font in rare situations. --- unix/gtkfont.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/unix/gtkfont.c b/unix/gtkfont.c index 172475e7..7e303556 100644 --- a/unix/gtkfont.c +++ b/unix/gtkfont.c @@ -1259,8 +1259,13 @@ static char *x11font_size_increment(unifont *font, int increment) #undef FLIPPED_SIZE - if (xlfd_best) - returned_name = xlfd_recompose(xlfd_best); + if (xlfd_best) { + char *bare_returned_name = xlfd_recompose(xlfd_best); + returned_name = dupcat( + xfont->u.vt->prefix, ":", bare_returned_name, + (const char *)NULL); + sfree(bare_returned_name); + } XFreeFontNames(fontnames); sfree(xlfd); @@ -2015,7 +2020,8 @@ static char *pangofont_size_increment(unifont *font, int increment) } else { pango_font_description_set_size(desc, size); newname = pango_font_description_to_string(desc); - retname = dupstr(newname); + retname = dupcat(pfont->u.vt->prefix, ":", + newname, (const char *)NULL); g_free(newname); }