diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-05-07 16:22:13 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-05-07 16:22:13 -0400 |
commit | ac5b48e40c7ab54b168627e389817030ef6c1620 (patch) | |
tree | bb02004ace48c3b58358b995de26ca58aae9e17a /demos | |
parent | 3cba63b2f890f5437b99145b7500f9407c30128c (diff) | |
download | gtk+-ac5b48e40c7ab54b168627e389817030ef6c1620.tar.gz |
gtk-demo: Fix revealer demo
This only used by luck before. We are changing a property from the
::notify handler for that property. Now that GtkRevealer is notifying
the property when it stops animations on unmap, we end up in a life
lock situation where we never make it out of the notify queue.
Fix this by not restarting the animation if the widget is unmapped.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/revealer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/demos/gtk-demo/revealer.c b/demos/gtk-demo/revealer.c index 23092d059a..2cccb7a7ed 100644 --- a/demos/gtk-demo/revealer.c +++ b/demos/gtk-demo/revealer.c @@ -12,10 +12,13 @@ static guint timeout = 0; static void change_direction (GtkRevealer *revealer) { - gboolean revealed; + if (gtk_widget_get_mapped (GTK_WIDGET (revealer))) + { + gboolean revealed; - revealed = gtk_revealer_get_child_revealed (revealer); - gtk_revealer_set_reveal_child (revealer, !revealed); + revealed = gtk_revealer_get_child_revealed (revealer); + gtk_revealer_set_reveal_child (revealer, !revealed); + } } static gboolean |