summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <javierjc1982@gmail.com>2009-05-20 05:31:37 +0200
committerRay Strode <rstrode@redhat.com>2009-07-15 15:35:22 -0400
commit8e2122deec56472132422250653b40981f64ff75 (patch)
tree155eb7572736a06c849487ed1df7d4e328bae992
parent57659df20dc97e055b41c4d8e30836515aa9bde9 (diff)
downloadgdm-8e2122deec56472132422250653b40981f64ff75.tar.gz
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)
-rw-r--r--daemon/main.c4
-rw-r--r--gui/simple-chooser/gdm-host-chooser-widget.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/daemon/main.c b/daemon/main.c
index 9d7ab5ef..0fb39150 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 999a9c0e..5b572c81 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 */