changeset 12667:a99a0cc67713

[gaim-migrate @ 15010] Fix SF Bug #1392371 Disabling the mouse gestures plugin and then performing a mouse gesture would cause a crash. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 29 Dec 2005 00:21:53 +0000
parents 8765dee8f517
children 57462d6542ea
files plugins/gestures/gestures.c plugins/gestures/gstroke.h plugins/gestures/stroke-draw.c
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/gestures/gestures.c	Wed Dec 28 09:04:51 2005 +0000
+++ b/plugins/gestures/gestures.c	Thu Dec 29 00:21:53 2005 +0000
@@ -219,6 +219,7 @@
 		gtkconv = GAIM_GTK_CONVERSATION(conv);
 
 		gstroke_cleanup(gtkconv->imhtml);
+		gstroke_disable(gtkconv->imhtml);
 	}
 
 	return TRUE;
--- a/plugins/gestures/gstroke.h	Wed Dec 28 09:04:51 2005 +0000
+++ b/plugins/gestures/gstroke.h	Thu Dec 29 00:21:53 2005 +0000
@@ -33,6 +33,9 @@
 /* enable strokes for the widget */
 void gstroke_enable (GtkWidget *widget);
 
+/* disable strokes for the widget */
+void gstroke_disable(GtkWidget *widget);
+
 guint gstroke_signal_connect (GtkWidget *widget,
                               const gchar *name,
                               void (*func)(GtkWidget *widget, void *data),
--- a/plugins/gestures/stroke-draw.c	Wed Dec 28 09:04:51 2005 +0000
+++ b/plugins/gestures/stroke-draw.c	Thu Dec 29 00:21:53 2005 +0000
@@ -256,6 +256,12 @@
   last_mouse_position.invalid = TRUE;
 }
 
+void
+gstroke_disable(GtkWidget *widget)
+{
+  g_signal_handlers_disconnect_by_func(G_OBJECT(widget), G_CALLBACK(process_event), NULL);
+}
+
 guint
 gstroke_signal_connect (GtkWidget *widget,
                         const gchar *name,