[gnome-shell/wip/message-tray] idle-monitor: Give the proper return value for get_idletime()
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/message-tray] idle-monitor: Give the proper return value for get_idletime()
- Date: Sun, 19 Aug 2012 23:54:39 +0000 (UTC)
commit b560c6b90ac3de6af39e8b01d54e57d121b91364
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Aug 19 19:52:20 2012 -0400
idle-monitor: Give the proper return value for get_idletime()
In a previous revision, it just tested if the user "was idle" by testing
for > 0, but it turns out that it's very rare that isn't the case, as the
count is in milliseconds. I changed it to return the idle time directly,
but forgot to update the prototypes.
src/shell-idle-monitor.c | 7 ++-----
src/shell-idle-monitor.h | 2 +-
2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/shell-idle-monitor.c b/src/shell-idle-monitor.c
index 0b07b4e..5bdb6ba 100644
--- a/src/shell-idle-monitor.c
+++ b/src/shell-idle-monitor.c
@@ -417,16 +417,13 @@ shell_idle_monitor_remove_watch (ShellIdleMonitor *monitor,
GUINT_TO_POINTER (id));
}
-gboolean
+gint64
shell_idle_monitor_get_idletime (ShellIdleMonitor *monitor)
{
XSyncValue value;
- gint64 idletime;
if (!XSyncQueryCounter (monitor->priv->display, monitor->priv->counter, &value))
return FALSE;
- idletime = _xsyncvalue_to_int64 (value);
-
- return idletime;
+ return _xsyncvalue_to_int64 (value);
}
diff --git a/src/shell-idle-monitor.h b/src/shell-idle-monitor.h
index 09eb72f..6a62082 100644
--- a/src/shell-idle-monitor.h
+++ b/src/shell-idle-monitor.h
@@ -67,7 +67,7 @@ guint shell_idle_monitor_add_watch (ShellIdleMonitor *mo
void shell_idle_monitor_remove_watch (ShellIdleMonitor *monitor,
guint id);
-gboolean shell_idle_monitor_get_idletime (ShellIdleMonitor *monitor);
+gint64 shell_idle_monitor_get_idletime (ShellIdleMonitor *monitor);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]