Fix blurry text on multiple scale monitor setups

* src/pgtkterm.c (pgtk_copy_bits): Preserve window scale factor
on temporary surface.  (bug#54040)
This commit is contained in:
Po Lu 2022-02-18 15:48:50 +08:00
parent 9a9a3390ad
commit ef1dfd2261

View file

@ -2927,6 +2927,7 @@ pgtk_copy_bits (struct frame *f, cairo_rectangle_t *src_rect,
cairo_t *cr;
GdkWindow *window;
cairo_surface_t *surface; /* temporary surface */
int scale;
window = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
@ -2936,6 +2937,9 @@ pgtk_copy_bits (struct frame *f, cairo_rectangle_t *src_rect,
FRAME_CR_SURFACE_DESIRED_HEIGHT
(f));
scale = gtk_widget_get_scale_factor (FRAME_GTK_WIDGET (f));
cairo_surface_set_device_scale (surface, scale, scale);
cr = cairo_create (surface);
cairo_set_source_surface (cr, FRAME_CR_SURFACE (f), -src_rect->x,
-src_rect->y);