1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-10 06:02:10 -05:00

GTK: create backing Cairo surface of similar type to window

Specifically, this creates the surface using
gdk_window_create_similar_surface() where that's available.
This commit is contained in:
Ben Harris 2025-04-19 09:13:06 +01:00
parent c93a225b97
commit daed7200b3

View File

@ -819,8 +819,14 @@ static void drawing_area_setup(GtkFrontend *inst, int width, int height)
inst->surface = NULL;
}
#if GTK_CHECK_VERSION(2,22,0)
inst->surface = gdk_window_create_similar_surface(
gtk_widget_get_window(inst->area),
CAIRO_CONTENT_COLOR, inst->backing_w, inst->backing_h);
#else
inst->surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, inst->backing_w, inst->backing_h);
#endif
#endif
draw_backing_rect(inst);