[gnome-panel] [clock, na, panel] Use g_timeout_add_seconds to reduce wakeups



commit 5f29b08a120be65c074d5aa94cabfa65269ff3b5
Author: Javier Jardón <javierjc1982 gmail com>
Date:   Mon May 4 07:14:52 2009 +0200

    [clock,na,panel] Use g_timeout_add_seconds to reduce wakeups
    
    http://bugzilla.gnome.org/show_bug.cgi?id=581256

 applets/clock/gnome-clock-applet-mechanism.c |    2 +-
 applets/notification_area/na-tray.c          |    5 +++--
 applets/wncklet/showdesktop.c                |    8 ++++----
 gnome-panel/drawer.c                         |    2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/applets/clock/gnome-clock-applet-mechanism.c b/applets/clock/gnome-clock-applet-mechanism.c
index b9f3820..b5ee23e 100644
--- a/applets/clock/gnome-clock-applet-mechanism.c
+++ b/applets/clock/gnome-clock-applet-mechanism.c
@@ -61,7 +61,7 @@ reset_killtimer (void)
                 g_source_remove (timer_id);
         }
         g_debug ("Setting killtimer to 30 seconds...");
-        timer_id = g_timeout_add (30 * 1000, do_exit, NULL);
+        timer_id = g_timeout_add_seconds (30, do_exit, NULL);
 }
 
 struct GnomeClockAppletMechanismPrivate
diff --git a/applets/notification_area/na-tray.c b/applets/notification_area/na-tray.c
index eda31d2..4f9bcb4 100644
--- a/applets/notification_area/na-tray.c
+++ b/applets/notification_area/na-tray.c
@@ -267,8 +267,9 @@ icon_tip_show_next (IconTip *icontip)
   icontip->id = buffer->id;
 
   if (buffer->timeout > 0)
-    icontip->source_id = g_timeout_add (buffer->timeout * 1000,
-                                        icon_tip_show_next_timeout, icontip);
+    icontip->source_id = g_timeout_add_seconds (buffer->timeout,
+                                                icon_tip_show_next_timeout,
+                                                icontip);
 
   icon_tip_buffer_free (buffer, NULL);
 }
diff --git a/applets/wncklet/showdesktop.c b/applets/wncklet/showdesktop.c
index df3447d..f92ddb0 100644
--- a/applets/wncklet/showdesktop.c
+++ b/applets/wncklet/showdesktop.c
@@ -39,7 +39,7 @@
 
 #include <string.h>
 
-#define TIMEOUT_ACTIVATE 1000
+#define TIMEOUT_ACTIVATE_SECONDS 1
 #define SHOW_DESKTOP_ICON "user-desktop"
 
 
@@ -348,9 +348,9 @@ button_drag_motion (GtkWidget          *widget,
 {
 
 	if (sdd->button_activate == 0)
-		sdd->button_activate = g_timeout_add (TIMEOUT_ACTIVATE,
-						      button_motion_timeout,
-						      sdd);
+		sdd->button_activate = g_timeout_add_seconds (TIMEOUT_ACTIVATE_SECONDS,
+							      button_motion_timeout,
+							      sdd);
 	gdk_drag_status (context, 0, time);
 	
 	return TRUE;
diff --git a/gnome-panel/drawer.c b/gnome-panel/drawer.c
index 301abb6..ca034ac 100644
--- a/gnome-panel/drawer.c
+++ b/gnome-panel/drawer.c
@@ -254,7 +254,7 @@ queue_drawer_close_for_drag (Drawer *drawer)
 {
 	if (!drawer->close_timeout_id)
 		drawer->close_timeout_id =
-			g_timeout_add (1 * 1000, close_drawer_in_idle, drawer);
+			g_timeout_add_seconds (1, close_drawer_in_idle, drawer);
 }
 
 static void



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