From bf58e16b83bc59745323a6955d98b862e3edc63b Mon Sep 17 00:00:00 2001 From: o9000 Date: Thu, 18 Jan 2018 21:31:44 +0000 Subject: [PATCH] Possible fix for issue #693 --- src/util/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/common.c b/src/util/common.c index eef8dd5..432ec12 100644 --- a/src/util/common.c +++ b/src/util/common.c @@ -942,8 +942,9 @@ void get_text_size2(const PangoFontDescription *font, available_width = MAX(0, available_width); available_height = MAX(0, available_height); + Pixmap pmap = XCreatePixmap(server.display, server.root_win, available_height, available_width, server.depth); cairo_surface_t *cs = - cairo_image_surface_create(CAIRO_FORMAT_ARGB32, available_height, available_width); + cairo_xlib_surface_create(server.display, pmap, server.visual, available_height, available_width); cairo_t *c = cairo_create(cs); PangoContext *context = pango_cairo_create_context(c); @@ -970,6 +971,7 @@ void get_text_size2(const PangoFontDescription *font, g_object_unref(context); cairo_destroy(c); cairo_surface_destroy(cs); + XFreePixmap(server.display, pmap); } #if !GLIB_CHECK_VERSION(2, 34, 0)