[gdm] Use g_timeout_add_seconds to reduce wakeups (closes:GnomeBug #583295)
- From: Ray Strode <halfline src gnome org>
- To: svn-commits-list gnome org
- Subject: [gdm] Use g_timeout_add_seconds to reduce wakeups (closes:GnomeBug #583295)
- Date: Wed, 15 Jul 2009 19:35:51 +0000 (UTC)
commit 8e2122deec56472132422250653b40981f64ff75
Author: Javier Jardón <javierjc1982 gmail com>
Date: Wed May 20 05:31:37 2009 +0200
Use g_timeout_add_seconds to reduce wakeups (closes:GnomeBug #583295)
* daemon/main.c
(bus_proxy_destroyed_cb),
(main)
* gui/simple-chooser/gdm-host-chooser-widget.c,
(xdmcp_discover)
daemon/main.c | 4 ++--
gui/simple-chooser/gdm-host-chooser-widget.c | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/daemon/main.c b/daemon/main.c
index 9d7ab5e..0fb3915 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -215,7 +215,7 @@ bus_proxy_destroyed_cb (DBusGProxy *bus_proxy,
g_object_unref (*managerp);
*managerp = NULL;
- g_timeout_add (3000, (GSourceFunc)bus_reconnect, managerp);
+ g_timeout_add_seconds (3, (GSourceFunc)bus_reconnect, managerp);
}
static void
@@ -631,7 +631,7 @@ main (int argc,
gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
if (do_timed_exit) {
- g_timeout_add (1000 * 30, (GSourceFunc) timed_exit_cb, main_loop);
+ g_timeout_add_seconds (30, (GSourceFunc) timed_exit_cb, main_loop);
}
gdm_manager_start (manager);
diff --git a/gui/simple-chooser/gdm-host-chooser-widget.c b/gui/simple-chooser/gdm-host-chooser-widget.c
index 999a9c0..5b572c8 100644
--- a/gui/simple-chooser/gdm-host-chooser-widget.c
+++ b/gui/simple-chooser/gdm-host-chooser-widget.c
@@ -93,8 +93,8 @@ static void gdm_host_chooser_widget_finalize (GObject *
G_DEFINE_TYPE (GdmHostChooserWidget, gdm_host_chooser_widget, GTK_TYPE_VBOX)
#define GDM_XDMCP_PROTOCOL_VERSION 1001
-#define SCAN_TIMEOUT 30000
-#define PING_TIMEOUT 2000
+#define SCAN_TIMEOUT 30
+#define PING_TIMEOUT 2
#define PING_TRIES 3
enum {
@@ -378,9 +378,9 @@ xdmcp_discover (GdmHostChooserWidget *widget)
g_source_remove (widget->priv->scan_time_id);
}
- widget->priv->scan_time_id = g_timeout_add (SCAN_TIMEOUT,
- chooser_scan_time_update,
- widget);
+ widget->priv->scan_time_id = g_timeout_add_seconds (SCAN_TIMEOUT,
+ chooser_scan_time_update,
+ widget);
#endif
/* Note we already used up one try */
widget->priv->ping_tries = PING_TRIES - 1;
@@ -388,9 +388,9 @@ xdmcp_discover (GdmHostChooserWidget *widget)
g_source_remove (widget->priv->ping_try_id);
}
- widget->priv->ping_try_id = g_timeout_add (PING_TIMEOUT,
- (GSourceFunc)ping_try,
- widget);
+ widget->priv->ping_try_id = g_timeout_add_seconds (PING_TIMEOUT,
+ (GSourceFunc)ping_try,
+ widget);
}
/* Find broadcast address for all active, non pointopoint interfaces */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]