[gnome-power-manager] Provide a function to get the raw value for the X IDLETIME
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-power-manager] Provide a function to get the raw value for the X IDLETIME
- Date: Thu, 4 Jun 2009 12:36:39 -0400 (EDT)
commit 024d8fa032cfc448c1da1126e4277cf623774ee8
Author: Richard Hughes <richard hughsie com>
Date: Thu Jun 4 17:05:37 2009 +0100
Provide a function to get the raw value for the X IDLETIME
---
src/egg-idletime.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/egg-idletime.c b/src/egg-idletime.c
index 8f9d971..ea8ecef 100644
--- a/src/egg-idletime.c
+++ b/src/egg-idletime.c
@@ -74,6 +74,26 @@ static gpointer egg_idletime_object = NULL;
G_DEFINE_TYPE (EggIdletime, egg_idletime, G_TYPE_OBJECT)
/**
+ * egg_idletime_xsyncvalue_to_int64:
+ */
+static gint64
+egg_idletime_xsyncvalue_to_int64 (XSyncValue value)
+{
+ return ((guint64) XSyncValueHigh32 (value)) << 32 | (guint64) XSyncValueLow32 (value);
+}
+
+/**
+ * egg_idletime_get_time:
+ */
+gint64
+egg_idletime_get_time (EggIdletime *idletime)
+{
+ XSyncValue value;
+ XSyncQueryCounter (idletime->priv->dpy, idletime->priv->idle_counter, &value);
+ return egg_idletime_xsyncvalue_to_int64 (value);
+}
+
+/**
* egg_idletime_xsync_alarm_set:
*/
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]