[empathy] Use gnome-session instead of gnome-screensaver to know when session is idle
- From: Xavier Claessens <xclaesse src gnome org>
- To: svn-commits-list gnome org
- Subject: [empathy] Use gnome-session instead of gnome-screensaver to know when session is idle
- Date: Fri, 26 Jun 2009 09:20:35 +0000 (UTC)
commit ba43aa5a434eab9e68a73af667b4c4441b50db61
Author: Giedrius Slavinskas <giedrius25 gmail com>
Date: Fri Jun 26 11:08:00 2009 +0200
Use gnome-session instead of gnome-screensaver to know when session is idle
libempathy/empathy-idle.c | 32 +++++++++++++++++++++-----------
1 files changed, 21 insertions(+), 11 deletions(-)
---
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index 3ed58de..2ed1440 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -68,6 +68,14 @@ typedef enum {
NM_STATE_DISCONNECTED
} NMState;
+typedef enum {
+ SESSION_STATUS_AVAILABLE,
+ SESSION_STATUS_INVISIBLE,
+ SESSION_STATUS_BUSY,
+ SESSION_STATUS_IDLE,
+ SESSION_STATUS_UNKNOWN
+} SessionStatus;
+
enum {
PROP_0,
PROP_STATE,
@@ -151,14 +159,17 @@ idle_ext_away_start (EmpathyIdle *idle)
}
static void
-idle_session_idle_changed_cb (DBusGProxy *gs_proxy,
- gboolean is_idle,
- EmpathyIdle *idle)
+idle_session_status_changed_cb (DBusGProxy *gs_proxy,
+ SessionStatus status,
+ EmpathyIdle *idle)
{
EmpathyIdlePriv *priv;
+ gboolean is_idle;
priv = GET_PRIV (idle);
+ is_idle = (status == SESSION_STATUS_IDLE);
+
DEBUG ("Session idle state changed, %s -> %s",
priv->is_idle ? "yes" : "no",
is_idle ? "yes" : "no");
@@ -492,15 +503,14 @@ empathy_idle_init (EmpathyIdle *idle)
idle, NULL);
priv->gs_proxy = dbus_g_proxy_new_for_name (tp_get_bus (),
- "org.gnome.ScreenSaver",
- "/org/gnome/ScreenSaver",
- "org.gnome.ScreenSaver");
+ "org.gnome.SessionManager",
+ "/org/gnome/SessionManager/Presence",
+ "org.gnome.SessionManager.Presence");
if (priv->gs_proxy) {
- dbus_g_proxy_add_signal (priv->gs_proxy, "SessionIdleChanged",
- G_TYPE_BOOLEAN,
- G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->gs_proxy, "SessionIdleChanged",
- G_CALLBACK (idle_session_idle_changed_cb),
+ dbus_g_proxy_add_signal (priv->gs_proxy, "StatusChanged",
+ G_TYPE_UINT, G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal (priv->gs_proxy, "StatusChanged",
+ G_CALLBACK (idle_session_status_changed_cb),
idle, NULL);
} else {
DEBUG ("Failed to get gs proxy");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]