simon-git: putty (main): Ben Harris
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Wed Apr 30 23:48:14 BST 2025
TL;DR:
c60b2832 GTK: flush target Cairo surface in 'draw' handler
647d5a49 GTK: correct a comment calling Cairo surface "client-side"
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer: Ben Harris <bjh21 at bjh21.me.uk>
Date: 2025-04-30 23:48:14
commit c60b2832f41fa2abbb576291efdb57dfa8819152
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c60b2832f41fa2abbb576291efdb57dfa8819152;hp=dae2febd85390bd2afb73604a210bccbf9f92924
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Wed Apr 30 23:27:43 2025 +0100
GTK: flush target Cairo surface in 'draw' handler
In 687efc3a5da1fb85c86a3c871b00a7234b97c2e9, Simon noted that when PuTTY
was running under X and using an RGB24 image surface as its backing
surface, it would fail to draw on its window. Changing the backing
image to ARGB32 caused the problem to go away.
If you set GDK_BACKEND=x11 and GDK_RENDERING=image, then PuTTY's
gdk_window_create_similar_surface() returns an RGB24 image surface, and
it appears to have precisely the same problem. Dumping the surfaces to
PNG files revealed that Cairo thought they had the right context. But
xtruss didn't show any actual requests to write to the window.
So on a hunch approximately as well-informed as Simon's, I added a call
to cairo_flush(), to explicitly ask Cairo to flush its changes to the
underlying surface. I would have hoped that GTK would do something like
this for us, but adding that call seems to have made things work
properly. Like Simon, I have no idea if this is the correct fix, but it
seems like a reasonable one and the problem is no longer occurring for
me.
unix/window.c | 1 +
1 file changed, 1 insertion(+)
commit 647d5a49d27fcce41db06ddb847b9c9a8937caee
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=647d5a49d27fcce41db06ddb847b9c9a8937caee;hp=c60b2832f41fa2abbb576291efdb57dfa8819152
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Wed Apr 30 23:40:48 2025 +0100
GTK: correct a comment calling Cairo surface "client-side"
Our Cairo backing surface can be server-side now. Indeed I think it
always is under GTK 2 where that comment applies.
unix/window.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
More information about the tartarus-commits
mailing list