GNU bug report logs - #54040
29.0.50; Text becomes blurry on PGTK/Wayland

Previous Next

Package: emacs;

Reported by: Thomas Jost <schnouki <at> schnouki.net>

Date: Thu, 17 Feb 2022 12:08:01 UTC

Severity: normal

Found in version 29.0.50

Done: Po Lu <luangruo <at> yahoo.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 54040 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Thomas Jost <schnouki <at> schnouki.net>
Cc: 54040 <at> debbugs.gnu.org
Subject: Re: bug#54040: 29.0.50; Text becomes blurry on PGTK/Wayland
Date: Fri, 18 Feb 2022 15:38:16 +0800
Thomas Jost <schnouki <at> schnouki.net> writes:

> This was the first thing I tried as well, but this didn't solve this
> issue for me, and I had to revert to cairo_surface_create_similar(). I
> don't know how they are different, but I couldn't get it to work with
> gdk_window_create_similar_surface().

The reason `cairo_surface_create_similar' doesn't work is that Emacs
recently gained a feature that allows frames to have a transparent
background with opaque text, and surfaces created that way don't work to
preserve the alpha channel when copying bits, so going back to that is
not a solution.

Does this patch help?

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 65408801cf..54b65ac54e 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -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);




This bug report was last modified 3 years and 118 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.