chiark / gitweb /
logind: never select closing sessions for a VT
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 16 Jul 2015 16:46:12 +0000 (18:46 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:07:01 +0000 (10:07 +0100)
If a session is in closing state (and already got rid of its VT), then
never re-select it for that VT. There is no reason why we should grant
something to a session that is already going away *AND* already got rid
of exactly that.

src/login/logind-seat.c

index 3daaf000eaccf0087962cd40a2f8b504d30a3cb7..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;
                         }