Simplify get_text_size

This commit is contained in:
o9000 2017-11-23 22:38:55 +01:00
parent 5e124c7a97
commit cc5842463d

View file

@ -937,10 +937,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_xlib_surface_create(server.display, pmap, server.visual, available_height, available_width);
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, available_height, available_width);
cairo_t *c = cairo_create(cs);
PangoLayout *layout = pango_cairo_create_layout(c);
@ -964,7 +963,6 @@ void get_text_size2(const PangoFontDescription *font,
g_object_unref(layout);
cairo_destroy(c);
cairo_surface_destroy(cs);
XFreePixmap(server.display, pmap);
}
#if !GLIB_CHECK_VERSION(2, 34, 0)