changeset 17228:5033139b3ead

merge of 'b8b81ea3c89a56d3526f1ca7373b947083c44a3f' and 'd483d375dbe8fca98d12114188e00790374a4092'
author Mark Doliner <mark@kingant.net>
date Tue, 22 May 2007 07:09:32 +0000
parents 61c5d8737f01 (current diff) 9a649a04fd74 (diff)
children b1db61e778d6 b25c4fe3a8ce
files libpurple/protocols/jabber/auth.c
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkdebug.c	Tue May 22 05:22:36 2007 +0000
+++ b/pidgin/gtkdebug.c	Tue May 22 07:09:32 2007 +0000
@@ -77,6 +77,7 @@
 };
 
 static DebugWindow *debug_win = NULL;
+static guint debug_enabled_timer = 0;
 
 #ifdef HAVE_REGEX_H
 static void regex_filter_all(DebugWindow *win);
@@ -864,14 +865,24 @@
 	return win;
 }
 
+static gboolean
+debug_enabled_timeout_cb(gpointer data)
+{
+	debug_enabled_timer = 0;
+
+	if (data)
+		pidgin_debug_window_show();
+	else
+		pidgin_debug_window_hide();
+
+	return FALSE;
+}
+
 static void
 debug_enabled_cb(const char *name, PurplePrefType type,
 				 gconstpointer value, gpointer data)
 {
-	if (value)
-		pidgin_debug_window_show();
-	else
-		pidgin_debug_window_hide();
+	debug_enabled_timer = g_timeout_add(0, debug_enabled_timeout_cb, GINT_TO_POINTER(GPOINTER_TO_INT(value)));
 }
 
 static void
@@ -984,6 +995,9 @@
 pidgin_debug_uninit(void)
 {
 	purple_debug_set_ui_ops(NULL);
+
+	if (debug_enabled_timer != 0)
+		g_source_remove(debug_enabled_timer);
 }
 
 void