diff libpurple/idle.c @ 18119:59aec2d6ec43

propagate from branch 'im.pidgin.pidgin.2.1.0' (head 86fd5e0d8b80a9da3103e850c97f1e04a2333961) to branch 'im.pidgin.pidgin' (head 999df812d342023b977c17afda10ed0238f1f80d)
author Richard Laager <rlaager@wiktel.com>
date Sat, 16 Jun 2007 19:48:23 +0000
parents 926ccb104da0 40d51793f2d7
children 667c209521db
line wrap: on
line diff
--- a/libpurple/idle.c	Sat Jun 16 19:44:59 2007 +0000
+++ b/libpurple/idle.c	Sat Jun 16 19:48:23 2007 +0000
@@ -304,6 +304,14 @@
 	return &handle;
 }
 
+static gboolean _do_purple_idle_touch_cb(gpointer data)
+{
+	purple_idle_touch();
+
+	return FALSE;
+}
+
+
 void
 purple_idle_init()
 {
@@ -325,7 +333,10 @@
 	purple_prefs_connect_callback(purple_idle_get_handle(), "/purple/away/idle_reporting",
 	                              idle_reporting_cb, NULL);
 
-	purple_idle_touch();
+	/* Initialize the idleness asynchronously so it doesn't check idleness,
+	 * and potentially try to change the status before the UI is initialized */
+	g_idle_add(_do_purple_idle_touch_cb, NULL);
+
 }
 
 void