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.
This commit is contained in:
@@ -48,14 +48,10 @@ struct tty {
|
|||||||
static int on_enter_vt(int signal_number, void *data)
|
static int on_enter_vt(int signal_number, void *data)
|
||||||
{
|
{
|
||||||
struct tty *tty = data;
|
struct tty *tty = data;
|
||||||
int ret;
|
|
||||||
|
|
||||||
tty->vt_func(tty->compositor, TTY_ENTER_VT);
|
tty->vt_func(tty->compositor, TTY_ENTER_VT);
|
||||||
|
|
||||||
ioctl(tty->fd, VT_RELDISP, VT_ACKACQ);
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -64,13 +60,8 @@ static int
|
|||||||
on_leave_vt(int signal_number, void *data)
|
on_leave_vt(int signal_number, void *data)
|
||||||
{
|
{
|
||||||
struct tty *tty = data;
|
struct tty *tty = data;
|
||||||
int ret;
|
|
||||||
|
|
||||||
ioctl (tty->fd, VT_RELDISP, 1);
|
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");
|
|
||||||
|
|
||||||
tty->vt_func(tty->compositor, TTY_LEAVE_VT);
|
tty->vt_func(tty->compositor, TTY_LEAVE_VT);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user