From ad3464d2e9c0da6d9cfd5e153fa68e722b8810c5 Mon Sep 17 00:00:00 2001 From: Monsta Date: Thu, 12 Nov 2015 11:07:39 +0300 Subject: don't destroy a widget in its draw/expose signal ported from: https://git.gnome.org/browse/gnome-panel/commit/?id=8c275a2adf4ad99297a17cabf251344837620831 https://git.gnome.org/browse/gnome-panel/commit/?id=be33e799d968a073c0a8856c96d11e8594b88bc4 --- mate-panel/xstuff.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mate-panel/xstuff.c b/mate-panel/xstuff.c index 898bcb6f..42dc3b78 100644 --- a/mate-panel/xstuff.c +++ b/mate-panel/xstuff.c @@ -309,6 +309,14 @@ zoom_timeout (GtkWidget *window) return TRUE; } +static gboolean +idle_destroy (gpointer data) +{ + gtk_widget_destroy (GTK_WIDGET (data)); + + return FALSE; +} + static gboolean #if GTK_CHECK_VERSION (3, 0, 0) zoom_draw (GtkWidget *widget, @@ -328,12 +336,13 @@ zoom_expose (GtkWidget *widget, g_source_remove (zoom->timeout_id); zoom->timeout_id = 0; + gtk_widget_hide (widget); + g_idle_add (idle_destroy, widget); + g_object_unref (zoom->pixbuf); zoom->pixbuf = NULL; g_slice_free (CompositedZoomData, zoom); - - gtk_widget_destroy (widget); } else { GdkPixbuf *scaled; int width, height; -- cgit v1.2.1