chiark / gitweb /
logind: send PropertyChanged during deactivation
[elogind.git] / src / login / logind-seat.c
index 3dc529b2b9bd5ff1c054b0458a0246c42f9d1d12..feebcf4558febcb23e44ccaf0b07f88f1ba0b832 100644 (file)
@@ -246,10 +246,17 @@ int seat_set_active(Seat *s, Session *session) {
         old_active = s->active;
         s->active = session;
 
+        if (old_active) {
+                session_device_pause_all(old_active);
+                session_send_changed(old_active, "Active\0");
+        }
+
         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 +427,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);