chiark / gitweb /
Create /run/systemd as needed
[elogind.git] / src / login / logind-seat.c
index 72bcfc4a52b89ac0c4a7ac4fad7a216d62b2968c..5c15ff3a893db509719ee93800c8bce7e632ecc9 100644 (file)
@@ -454,7 +454,7 @@ void seat_evict_position(Seat *s, Session *session) {
                  * position (eg., during gdm->session transition), so let's look
                  * for it and set it on the free slot. */
                 LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
-                        if (iter->position == pos) {
+                        if (iter->position == pos && session_get_state(iter) != SESSION_CLOSING) {
                                 s->positions[pos] = iter;
                                 break;
                         }
@@ -473,7 +473,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) {
         seat_evict_position(s, session);
 
         session->position = pos;
-        if (pos > 0 && !s->positions[pos])
+        if (pos > 0)
                 s->positions[pos] = session;
 }