diff options
author | Ray Strode <rstrode@redhat.com> | 2018-08-31 15:46:55 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2018-08-31 16:43:21 -0400 |
commit | 5883b17072003d34b95294fade9c81b216965092 (patch) | |
tree | d097d64d2c5ef8c5728f85a0b0a979896294ac62 /daemon/gdm-session-worker.c | |
parent | 923a778519e1987dc2dc26ae493e9d7bea2f00c9 (diff) | |
download | gdm-5883b17072003d34b95294fade9c81b216965092.tar.gz |
session-worker: clear VT before jumping to it
If we're going to jump to a new VT we should make sure it's free
of residual console text. That way if there's flicker the user
will be less likely to notice it.
This commit sends a clear screen escape sequence to the tty
before jumping to it.
Diffstat (limited to 'daemon/gdm-session-worker.c')
-rw-r--r-- | daemon/gdm-session-worker.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c index bcddc948..3fde9cbc 100644 --- a/daemon/gdm-session-worker.c +++ b/daemon/gdm-session-worker.c @@ -975,6 +975,13 @@ jump_to_vt (GdmSessionWorker *worker, active_vt_tty_fd = open ("/dev/tty0", O_RDWR | O_NOCTTY); if (worker->priv->session_tty_fd != -1) { + static const char *clear_screen_escape_sequence = "\33[H\33[2J"; + + /* let's make sure the new VT is clear */ + write (worker->priv->session_tty_fd, + clear_screen_escape_sequence, + sizeof (clear_screen_escape_sequence)); + fd = worker->priv->session_tty_fd; g_debug ("GdmSessionWorker: first setting graphics mode to prevent flicker"); |