tty: Leave tty in KD_GRAPHICS mode during vt switches
authorKristian Høgsberg <krh@bitplanet.net>
Sun, 15 Jan 2012 20:17:58 +0000 (15:17 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Sun, 15 Jan 2012 20:25:06 +0000 (15:25 -0500)
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

index bb979d3..f583eb5 100644 (file)
--- 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);