X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-seat.c;h=4a4d40adca770c076525f6db31dc58d223eaa812;hb=299404a19f26aa4f203042d8285ee0b7afa5bf40;hp=3dc529b2b9bd5ff1c054b0458a0246c42f9d1d12;hpb=bf7825ae69f53a7e80a740547919833e49ed1df4;p=elogind.git diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 3dc529b2b..4a4d40adc 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -246,10 +246,15 @@ int seat_set_active(Seat *s, Session *session) { old_active = s->active; s->active = session; + if (old_active) + session_device_pause_all(old_active); + seat_apply_acls(s, old_active); - if (session && session->started) + if (session && session->started) { session_send_changed(session, "Active\0"); + session_device_resume_all(session); + } if (!session || session->started) seat_send_changed(s, "ActiveSession\0"); @@ -420,6 +425,21 @@ int seat_attach_session(Seat *s, Session *session) { return 0; } +void seat_complete_switch(Seat *s) { + Session *session; + + assert(s); + + /* if no session-switch is pending or if it got canceled, do nothing */ + if (!s->pending_switch) + return; + + session = s->pending_switch; + s->pending_switch = NULL; + + seat_set_active(s, session); +} + bool seat_has_vts(Seat *s) { assert(s);