summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2019-08-02 10:53:37 -0400
committerRay Strode <halfline@gmail.com>2019-08-13 19:35:47 +0000
commit422647b7c9a347fe3b293d4b4c44eceb51e44074 (patch)
tree0e53ee74132b68f1cfb6cb7850715960ce38eeef /daemon
parent04d0d82a9cc56d4bf769b320ebd9369da0ea4a66 (diff)
downloadgdm-422647b7c9a347fe3b293d4b4c44eceb51e44074.tar.gz
session-worker: don't take control of a vt just because we're changing to it
The session worker should only take control of VTs it's actually managing. Right now, if a session worker jumps back to the login screen during tear down, it takes control of the login screen's VT and then exits That leaves the VT in kernel control until the next login which is not ideal. This commit fixes that.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-session-worker.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index cc565a4c..aa824bcf 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -664,7 +664,7 @@ gdm_session_worker_process_pam_message (GdmSessionWorker *worker,
char *user_answer;
gboolean res;
char *utf8_msg;
- char *msg;
+ char *msg;
if (response != NULL) {
*response = NULL;
@@ -954,7 +954,8 @@ out:
static void
jump_to_vt (GdmSessionWorker *worker,
- int vt_number)
+ int vt_number,
+ gboolean take_control)
{
int fd;
int active_vt_tty_fd;
@@ -990,7 +991,8 @@ jump_to_vt (GdmSessionWorker *worker,
fd = active_vt_tty_fd;
}
- handle_terminal_vt_switches (worker, fd);
+ if (take_control)
+ handle_terminal_vt_switches (worker, fd);
if (ioctl (fd, VT_GETSTATE, &vt_state) < 0) {
g_debug ("GdmSessionWorker: couldn't get current VT: %m");
@@ -1053,7 +1055,7 @@ gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
if (g_strcmp0 (worker->priv->display_seat_id, "seat0") == 0) {
if (worker->priv->login_vt != worker->priv->session_vt) {
- jump_to_vt (worker, worker->priv->login_vt);
+ jump_to_vt (worker, worker->priv->login_vt, FALSE);
}
}
@@ -2007,7 +2009,7 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
* ready, and in the reuse server case, we're already on the correct VT. */
if (g_strcmp0 (worker->priv->display_seat_id, "seat0") == 0) {
if (worker->priv->display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
- jump_to_vt (worker, worker->priv->session_vt);
+ jump_to_vt (worker, worker->priv->session_vt, TRUE);
}
}