summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2011-01-21 11:23:34 +0000
committerBastien Nocera <hadess@hadess.net>2011-01-21 11:23:34 +0000
commitdec323d0a3cd23274f05ba8b589d12a03bfb8ecf (patch)
tree9fd7ff2eda404c2b8c58fe553c8326395e83096d
parent821c1c3aac63838163de9fc13f7c51376e17e63a (diff)
downloadtotem-dec323d0a3cd23274f05ba8b589d12a03bfb8ecf.tar.gz
browser-plugin: Fix possible warnings when destroyed
Each time the widget was left, we would add a new timeout, without removing the old one. This could cause warnings once the widget was destroyed. https://bugzilla.gnome.org/show_bug.cgi?id=640109
-rw-r--r--browser-plugin/totem-glow-button.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/browser-plugin/totem-glow-button.c b/browser-plugin/totem-glow-button.c
index ae1cea26e..befa49c21 100644
--- a/browser-plugin/totem-glow-button.c
+++ b/browser-plugin/totem-glow-button.c
@@ -216,6 +216,7 @@ totem_glow_button_enter (GtkButton *buttonw)
button->pointer_entered = TRUE;
button->anim_finished = FALSE;
button->glow_start_time = G_MINDOUBLE;
+ totem_glow_button_set_timeout (button, FALSE);
}
static void
@@ -281,10 +282,14 @@ totem_glow_button_new (void)
return g_object_new (TOTEM_TYPE_GLOW_BUTTON, NULL);
}
+/* We can only add a timeout once, we assert that, though
+ * calling it multiple times to disable the animation is fine */
static void
totem_glow_button_set_timeout (TotemGlowButton *button, gboolean set_timeout)
{
if (set_timeout != FALSE) {
+ g_assert (button->button_glow == 0);
+
button->glow_start_time = 0.0;
/* The animation doesn't speed up or slow down based on the