From b6e95af4a37cfef660969e62e18f7f17245675c1 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 25 May 2014 17:20:11 +0200 Subject: [PATCH] sample: Fix GtkDemo/DemoImages progressive update with recent gtk+ --- sample/GtkDemo/DemoImages.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sample/GtkDemo/DemoImages.cs b/sample/GtkDemo/DemoImages.cs index 7407f48da..73588f890 100644 --- a/sample/GtkDemo/DemoImages.cs +++ b/sample/GtkDemo/DemoImages.cs @@ -175,7 +175,14 @@ namespace GtkDemo void ProgressiveUpdatedCallback (object obj, AreaUpdatedArgs args) { - progressiveImage.QueueDraw (); + /* We know the pixbuf inside the GtkImage has changed, but the image + * itself doesn't know this; so give it a hint by setting the pixbuf + * again. Queuing a redraw used to be sufficient, but in recent GTK+, + * GtkImage uses GtkIconHelper which caches the pixbuf state and will + * just redraw from the cache. + */ + Pixbuf pixbuf = progressiveImage.Pixbuf; + progressiveImage.Pixbuf = pixbuf; } } }