diff options
author | Giedrius Slavinskas <giedrius25@gmail.com> | 2009-06-26 17:08:00 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-06-26 17:08:00 +0800 |
commit | ba43aa5a434eab9e68a73af667b4c4441b50db61 (patch) | |
tree | 672a87e0c00e9dc283ca10aea165b1b2c4d31597 /libempathy | |
parent | 764e70b98c1b657e87b349c1f220903a78eb4065 (diff) | |
download | gsoc2013-empathy-ba43aa5a434eab9e68a73af667b4c4441b50db61.tar gsoc2013-empathy-ba43aa5a434eab9e68a73af667b4c4441b50db61.tar.gz gsoc2013-empathy-ba43aa5a434eab9e68a73af667b4c4441b50db61.tar.bz2 gsoc2013-empathy-ba43aa5a434eab9e68a73af667b4c4441b50db61.tar.lz gsoc2013-empathy-ba43aa5a434eab9e68a73af667b4c4441b50db61.tar.xz gsoc2013-empathy-ba43aa5a434eab9e68a73af667b4c4441b50db61.tar.zst gsoc2013-empathy-ba43aa5a434eab9e68a73af667b4c4441b50db61.zip |
Use gnome-session instead of gnome-screensaver to know when session is idle
Diffstat (limited to 'libempathy')
-rw-r--r-- | 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 3ed58de92..2ed1440fc 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"); |