all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Thomas Jost <schnouki@schnouki.net>
Cc: 54040@debbugs.gnu.org
Subject: bug#54040: 29.0.50; Text becomes blurry on PGTK/Wayland
Date: Fri, 18 Feb 2022 15:38:16 +0800	[thread overview]
Message-ID: <87pmnkr5ef.fsf@yahoo.com> (raw)
In-Reply-To: <87tucwbpqn.fsf@schnouki.net> (Thomas Jost's message of "Fri, 18 Feb 2022 08:25:36 +0100")

Thomas Jost <schnouki@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);





  reply	other threads:[~2022-02-18  7:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 10:44 bug#54040: 29.0.50; Text becomes blurry on PGTK/Wayland Thomas Jost via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-18  0:35 ` Morgan Smith
2022-02-18  0:58 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-18  7:25   ` Thomas Jost via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-18  7:38     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-02-18  7:44       ` Thomas Jost via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-18  7:47         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-18  9:03           ` Thomas Jost via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-18 10:15             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-18 17:07               ` Thomas Jost via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-19  0:59                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-17  0:00 ` Andrew Cohen
2022-03-17  1:04   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-17  1:44     ` Andrew Cohen
2022-03-17  3:45       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-17  4:02         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]           ` <87a6dpb4tm.fsf@ust.hk>
2022-03-17  4:23             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmnkr5ef.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=54040@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=schnouki@schnouki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.