[gnome-desktop] Return a negative error code from gnome_idle_monitor_get_idletime() when there is no idle counter



commit 59c470cb47c6d33f0864074b7c3346a81eea255c
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jan 11 11:14:45 2013 +0000

    Return a negative error code from gnome_idle_monitor_get_idletime() when there is no idle counter
    
    Returning 0 is a valid response if the counter has just been reset.

 libgnome-desktop/gnome-idle-monitor.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgnome-desktop/gnome-idle-monitor.c b/libgnome-desktop/gnome-idle-monitor.c
index 9365b1b..d1254fd 100644
--- a/libgnome-desktop/gnome-idle-monitor.c
+++ b/libgnome-desktop/gnome-idle-monitor.c
@@ -504,7 +504,7 @@ gnome_idle_monitor_remove_watch (GnomeIdleMonitor *monitor,
  * gnome_idle_monitor_get_idletime:
  * @monitor: A #GnomeIdleMonitor
  *
- * Returns: The current idle time, in milliseconds.
+ * Returns: The current idle time, in milliseconds, or -1 for not supported
  */
 gint64
 gnome_idle_monitor_get_idletime (GnomeIdleMonitor *monitor)
@@ -512,7 +512,7 @@ gnome_idle_monitor_get_idletime (GnomeIdleMonitor *monitor)
 	XSyncValue value;
 
 	if (!XSyncQueryCounter (monitor->priv->display, monitor->priv->counter, &value))
-		return FALSE;
+		return -1;
 
 	return _xsyncvalue_to_int64 (value);
 }



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