changeset 18007:a8b4444f2515

Raise the timeouts one second so they'll work every time (for certain) with g_timeout_add_seconds(), which is documented as, "To allow this grouping, the interval to the first timer is rounded and can deviate up to one second from the specified interval."
author Richard Laager <rlaager@wiktel.com>
date Sun, 20 May 2007 13:48:45 +0000
parents f2d8658b3a86
children f22986db6e70
files libpurple/idle.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/idle.c	Sat May 19 21:38:47 2007 +0000
+++ b/libpurple/idle.c	Sun May 20 13:48:45 2007 +0000
@@ -230,7 +230,11 @@
 	if (time_until_next_idle_event == 0)
 		idle_timer = 0;
 	else
-		idle_timer = purple_timeout_add_seconds(time_until_next_idle_event + 1, check_idleness_timer, NULL);
+	{
+		/* +1 for the boundary,
+		 * +1 more for g_timeout_add_seconds rounding. */
+		idle_timer = purple_timeout_add_seconds(time_until_next_idle_event + 2, check_idleness_timer, NULL);
+	}
 	return FALSE;
 }
 
@@ -309,8 +313,10 @@
 void
 purple_idle_init()
 {
-	/* Add the timer to check if we're idle */
-	idle_timer = purple_timeout_add_seconds((IDLEMARK + 1), check_idleness_timer, NULL);
+	/* Add the timer to check if we're idle.
+	 * IDLEMARK + 1 as the boundary,
+	 * +1 more for g_timeout_add_seconds rounding. */
+	idle_timer = purple_timeout_add_seconds((IDLEMARK + 2), check_idleness_timer, NULL);
 
 	purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg",
 						purple_idle_get_handle(),