From 98a4a4ff673d1325dc6dc9a46a77f587b8b760cb Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Mon, 3 Aug 2020 02:55:07 +0200 Subject: seat: Add VT cleanup on switch to empty VT VTs were being cleaned up the active client of a VT went away, or if we were acking a kernel VT switch request. However, no cleanup was done if the user had reqested a session switch to a different VT. Duplicate the VT cleanup to the VT switch condition. --- seatd/seat.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'seatd') diff --git a/seatd/seat.c b/seatd/seat.c index e6d9950..6358f7d 100644 --- a/seatd/seat.c +++ b/seatd/seat.c @@ -547,6 +547,13 @@ int seat_activate(struct seat *seat) { // If we're asked to do a simple VT switch, do that if (seat->next_vt > 0) { log_info("executing VT switch"); + if (seat->curttyfd != -1) { + terminal_set_process_switching(seat->curttyfd, false); + terminal_set_keyboard(seat->curttyfd, true); + terminal_set_graphics(seat->curttyfd, false); + close(seat->curttyfd); + seat->curttyfd = -1; + } terminal_switch_vt(ttyfd, seat->next_vt); seat->next_vt = 0; close(ttyfd); -- cgit v1.2.3