From 92734c567382633f81c3f7c30044ef292a4ead03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Sun, 15 Jan 2012 15:17:58 -0500 Subject: [PATCH] tty: Leave tty in KD_GRAPHICS mode during vt switches Part of the point of KD_GRAPHICS mode is that the kernel doesn't try to restore the VT contents when we switch bach, but leaves that to the user mode process. This avoids ugly flicker of text mode contents before the compositor takes over. --- src/tty.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/tty.c b/src/tty.c index bb979d3..f583eb5 100644 --- a/src/tty.c +++ b/src/tty.c @@ -48,14 +48,10 @@ struct tty { static int on_enter_vt(int signal_number, void *data) { struct tty *tty = data; - int ret; tty->vt_func(tty->compositor, TTY_ENTER_VT); ioctl(tty->fd, VT_RELDISP, VT_ACKACQ); - ret = ioctl(tty->fd, KDSETMODE, KD_GRAPHICS); - if (ret) - fprintf(stderr, "failed to set KD_GRAPHICS mode on console: %m\n"); return 1; } @@ -64,13 +60,8 @@ static int on_leave_vt(int signal_number, void *data) { struct tty *tty = data; - int ret; - ioctl (tty->fd, VT_RELDISP, 1); - ret = ioctl(tty->fd, KDSETMODE, KD_TEXT); - if (ret) - fprintf(stderr, - "failed to set KD_TEXT mode on console: %m\n"); + ioctl(tty->fd, VT_RELDISP, 1); tty->vt_func(tty->compositor, TTY_LEAVE_VT); -- 2.7.4