[gnome-games] Use g_timeout_add_seconds when available
- From: Christian Persch <chpe src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games] Use g_timeout_add_seconds when available
- Date: Fri, 1 May 2009 15:37:44 -0400 (EDT)
commit 72267d33b7bb922d62b6d376a6b9026bf35c7293
Author: Christian Persch <chpe gnome org>
Date: Fri May 1 21:34:16 2009 +0200
Use g_timeout_add_seconds when available
---
libgames-support/games-conf.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libgames-support/games-conf.c b/libgames-support/games-conf.c
index 97e1771..b08853a 100644
--- a/libgames-support/games-conf.c
+++ b/libgames-support/games-conf.c
@@ -71,7 +71,7 @@ G_DEFINE_TYPE (GamesConf, games_conf, G_TYPE_OBJECT);
/* helper functions */
-#define WINDOW_STATE_TIMEOUT 1000 /* ms */
+#define WINDOW_STATE_TIMEOUT 1 /* s */
enum {
STATE_KEY_MAXIMISED,
@@ -158,9 +158,15 @@ window_configure_event_cb (GtkWidget *widget,
state->window);
if (state->timeout_id == 0) {
- state->timeout_id = g_timeout_add (WINDOW_STATE_TIMEOUT,
+#if GLIB_CHECK_VERSION (2, 14, 0)
+ state->timeout_id = g_timeout_add_seconds (WINDOW_STATE_TIMEOUT,
+ (GSourceFunc) window_state_timeout_cb,
+ state);
+#else
+ state->timeout_id = g_timeout_add (WINDOW_STATE_TIMEOUT * 1000,
(GSourceFunc) window_state_timeout_cb,
state);
+#endif
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]