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