summaryrefslogtreecommitdiff
path: root/src/seat.c
diff options
context:
space:
mode:
authorJesús González <jgonzalez@gdr-sistemas.com>2015-02-12 12:30:00 +1300
committerRobert Ancell <robert.ancell@canonical.com>2015-02-12 12:30:00 +1300
commit76a0ba4d812716dbe9bbd5de48a77565da873395 (patch)
tree2172e55f032e5edecedda135b80240b12b234045 /src/seat.c
parent3a2db791490fe8ba4e45a74c412e5487d606fb55 (diff)
parentedd249eee12da2a400bec5a7c11aa54354945c24 (diff)
downloadlightdm-git-76a0ba4d812716dbe9bbd5de48a77565da873395.tar.gz
Fixes a bug that prevents session locking if the session was unlocked after changing VT and using the screensaver to unlock the screen.
Diffstat (limited to 'src/seat.c')
-rw-r--r--src/seat.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/seat.c b/src/seat.c
index 9a56baf2..b8473327 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -269,6 +269,54 @@ seat_get_next_session (Seat *seat)
return seat->priv->next_session;
}
+/**
+ * Obtains the active session which lightdm expects to be active.
+ *
+ * This function is different from seat_get_active_session() in that the
+ * later (in the case of xlocal seats) dynamically finds the session that is
+ * really active (based on the active VT), whereas this function returns the
+ * session that lightdm activated last by itself, which may not be the actual
+ * active session (i.e. VT changes).
+ */
+Session *
+seat_get_expected_active_session (Seat *seat)
+{
+ g_return_val_if_fail (seat != NULL, NULL);
+ return seat->priv->active_session;
+}
+
+/**
+ * Sets the active session which lightdm expects to be active.
+ *
+ * This function is different from seat_set_active_session() in that the
+ * later performs an actual session activation, whereas this function just
+ * updates the active session after the session has been activated by some
+ * means external to lightdm (i.e. VT changes).
+ */
+void
+seat_set_externally_activated_session (Seat *seat, Session *session)
+{
+ g_return_if_fail (seat != NULL);
+ if (seat->priv->active_session)
+ g_object_unref (seat->priv->active_session);
+ seat->priv->active_session = g_object_ref (session);
+}
+
+Session *
+seat_find_session_by_login1_id (Seat *seat, const gchar *login1_session_id)
+{
+ GList *session_link;
+
+ for (session_link = seat->priv->sessions; session_link; session_link = session_link->next)
+ {
+ Session *session = session_link->data;
+ if (g_strcmp0 (login1_session_id, session_get_login1_session_id (session)) == 0)
+ return session;
+ }
+
+ return NULL;
+}
+
gboolean
seat_get_can_switch (Seat *seat)
{