[totem] browser-plugin: fix a crasher on totem-glow-button



commit 713de9f69155dc03480c54486ae6e0b42783c03d
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Thu Jan 27 15:19:33 2011 -0500

    browser-plugin: fix a crasher on totem-glow-button
    
    If the glowing starts while the pointer is hovering the widget, leaving the
    widget will crash with an assert.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640109

 browser-plugin/test-glow-button.c  |    6 ++++--
 browser-plugin/totem-glow-button.c |    3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/browser-plugin/test-glow-button.c b/browser-plugin/test-glow-button.c
index d4ecddc..d97dda8 100644
--- a/browser-plugin/test-glow-button.c
+++ b/browser-plugin/test-glow-button.c
@@ -2,7 +2,7 @@
 #include <gtk/gtk.h>
 #include "totem-glow-button.h"
 
-#if 0
+#if 1
 static gboolean
 idle_cb (gpointer data)
 {
@@ -44,9 +44,11 @@ int main (int argc, char **argv)
 
 	totem_glow_button_set_glow (TOTEM_GLOW_BUTTON (button), TRUE);
 
-//	g_timeout_add_seconds (1, idle_cb, button);
+	g_timeout_add_seconds (3, idle_cb, button);
 	g_timeout_add_seconds (5, idle_un_cb, button);
 
+	gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
+
 	gtk_widget_show_all (window);
 
 	gtk_main ();
diff --git a/browser-plugin/totem-glow-button.c b/browser-plugin/totem-glow-button.c
index befa49c..9a0b3fd 100644
--- a/browser-plugin/totem-glow-button.c
+++ b/browser-plugin/totem-glow-button.c
@@ -288,7 +288,8 @@ static void
 totem_glow_button_set_timeout (TotemGlowButton *button, gboolean set_timeout)
 {
 	if (set_timeout != FALSE) {
-		g_assert (button->button_glow == 0);
+		if (button->button_glow > 0)
+			return;
 
 		button->glow_start_time = 0.0;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]