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.