aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-05-19 17:59:57 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-19 17:59:57 +0800
commit0fea8f6e1fbabbbcf29615b838ded6902d80b32f (patch)
tree9e5c5ae9b6736bbc95cc39d45f810fcc74edf260 /libempathy
parent20ce0c962a960e39216b06bdf2198dfd83319278 (diff)
downloadgsoc2013-empathy-0fea8f6e1fbabbbcf29615b838ded6902d80b32f.tar
gsoc2013-empathy-0fea8f6e1fbabbbcf29615b838ded6902d80b32f.tar.gz
gsoc2013-empathy-0fea8f6e1fbabbbcf29615b838ded6902d80b32f.tar.bz2
gsoc2013-empathy-0fea8f6e1fbabbbcf29615b838ded6902d80b32f.tar.lz
gsoc2013-empathy-0fea8f6e1fbabbbcf29615b838ded6902d80b32f.tar.xz
gsoc2013-empathy-0fea8f6e1fbabbbcf29615b838ded6902d80b32f.tar.zst
gsoc2013-empathy-0fea8f6e1fbabbbcf29615b838ded6902d80b32f.zip
Auto away when session id idle, instead of when screensaver is active.
2006-05-19 Xavier Claessens <xclaesse@gmail.com> * libempathy/empathy-idle.c: Auto away when session id idle, instead of when screensaver is active. svn path=/trunk/; revision=73
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-idle.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index 80d75740a..e7191259e 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -48,21 +48,21 @@ enum {
struct _EmpathyIdlePriv {
MissionControl *mc;
DBusGProxy *gs_proxy;
- gboolean is_active;
+ gboolean is_idle;
McPresence last_state;
gchar *last_status;
guint ext_away_timeout;
};
-static void empathy_idle_class_init (EmpathyIdleClass *klass);
-static void empathy_idle_init (EmpathyIdle *idle);
-static void idle_finalize (GObject *object);
-static void idle_active_changed_cb (DBusGProxy *gs_proxy,
- gboolean is_active,
- EmpathyIdle *idle);
-static void idle_ext_away_start (EmpathyIdle *idle);
-static void idle_ext_away_stop (EmpathyIdle *idle);
-static gboolean idle_ext_away_cb (EmpathyIdle *idle);
+static void empathy_idle_class_init (EmpathyIdleClass *klass);
+static void empathy_idle_init (EmpathyIdle *idle);
+static void idle_finalize (GObject *object);
+static void idle_session_idle_changed_cb (DBusGProxy *gs_proxy,
+ gboolean is_idle,
+ EmpathyIdle *idle);
+static void idle_ext_away_start (EmpathyIdle *idle);
+static void idle_ext_away_stop (EmpathyIdle *idle);
+static gboolean idle_ext_away_cb (EmpathyIdle *idle);
//static guint signals[LAST_SIGNAL];
@@ -85,7 +85,7 @@ empathy_idle_init (EmpathyIdle *idle)
priv = GET_PRIV (idle);
- priv->is_active = FALSE;
+ priv->is_idle = FALSE;
priv->mc = gossip_mission_control_new ();
priv->gs_proxy = dbus_g_proxy_new_for_name (tp_get_bus (),
"org.gnome.ScreenSaver",
@@ -96,11 +96,11 @@ empathy_idle_init (EmpathyIdle *idle)
return;
}
- dbus_g_proxy_add_signal (priv->gs_proxy, "ActiveChanged",
+ dbus_g_proxy_add_signal (priv->gs_proxy, "SessionIdleChanged",
G_TYPE_BOOLEAN,
G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->gs_proxy, "ActiveChanged",
- G_CALLBACK (idle_active_changed_cb),
+ dbus_g_proxy_connect_signal (priv->gs_proxy, "SessionIdleChanged",
+ G_CALLBACK (idle_session_idle_changed_cb),
idle, NULL);
}
@@ -137,20 +137,20 @@ empathy_idle_new (void)
}
static void
-idle_active_changed_cb (DBusGProxy *gs_proxy,
- gboolean is_active,
- EmpathyIdle *idle)
+idle_session_idle_changed_cb (DBusGProxy *gs_proxy,
+ gboolean is_idle,
+ EmpathyIdle *idle)
{
EmpathyIdlePriv *priv;
priv = GET_PRIV (idle);
- gossip_debug (DEBUG_DOMAIN, "Screensaver state changed, %s -> %s",
- priv->is_active ? "yes" : "no",
- is_active ? "yes" : "no");
+ gossip_debug (DEBUG_DOMAIN, "Session idle state changed, %s -> %s",
+ priv->is_idle ? "yes" : "no",
+ is_idle ? "yes" : "no");
- if (is_active && !priv->is_active) {
- /* The screensaver is now running */
+ if (is_idle && !priv->is_idle) {
+ /* We are now idle, set state to away */
g_free (priv->last_status);
idle_ext_away_stop (idle);
@@ -163,8 +163,8 @@ idle_active_changed_cb (DBusGProxy *gs_proxy,
_("Autoaway"),
NULL, NULL);
idle_ext_away_start (idle);
- } else if (!is_active && priv->is_active) {
- /* The screensaver stoped */
+ } else if (!is_idle && priv->is_idle) {
+ /* We are no more idle, restore state */
idle_ext_away_stop (idle);
gossip_debug (DEBUG_DOMAIN, "Restoring state to %d %s",
@@ -177,7 +177,7 @@ idle_active_changed_cb (DBusGProxy *gs_proxy,
NULL, NULL);
}
- priv->is_active = is_active;
+ priv->is_idle = is_idle;
}
static void