diff options
author | Monsta <[email protected]> | 2015-11-12 11:07:39 +0300 |
---|---|---|
committer | Monsta <[email protected]> | 2015-11-12 11:15:28 +0300 |
commit | ad3464d2e9c0da6d9cfd5e153fa68e722b8810c5 (patch) | |
tree | 5909d06dbb773204105ef9bfc6d10c3b354e0fc7 | |
parent | 1e4d522036ca7ed7d7a31fcb9f39d585cd1c0d54 (diff) | |
download | mate-panel-ad3464d2e9c0da6d9cfd5e153fa68e722b8810c5.tar.bz2 mate-panel-ad3464d2e9c0da6d9cfd5e153fa68e722b8810c5.tar.xz |
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
-rw-r--r-- | mate-panel/xstuff.c | 13 |
1 files 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 @@ -310,6 +310,14 @@ zoom_timeout (GtkWidget *window) } 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, cairo_t *cr, @@ -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; |