diff options
author | Jesús González <jgonzalez@gdr-sistemas.com> | 2015-02-13 11:47:09 +0100 |
---|---|---|
committer | Jesús González <jgonzalez@gdr-sistemas.com> | 2015-02-13 11:47:09 +0100 |
commit | 27a369121fa4fc2146dbc5653139b06ff6301ab2 (patch) | |
tree | c054e9bb409215f1b2f7dfdbc8a3a8cceda74dec /src/seat.c | |
parent | 850aad05441d414e9bdc9cd80cd8e8bca8bede2b (diff) | |
parent | 7b6a695d2b5eb47c41d468cbceca256833f0a790 (diff) | |
download | lightdm-git-27a369121fa4fc2146dbc5653139b06ff6301ab2.tar.gz |
Merged changes from parent branch.
Fixed "lock-seat-after-vt-switch" test to expect X server reuse by the new greeter instead of X server reinitiation.
Diffstat (limited to 'src/seat.c')
-rw-r--r-- | src/seat.c | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -272,6 +272,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) { |