vt: add support for automatic VT switching
authorRan Benita <ran234@gmail.com>
Sat, 10 Dec 2011 23:56:48 +0000 (01:56 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 14 Dec 2011 15:33:35 +0000 (16:33 +0100)
commitdfd880881ef35204ca1307d1dee401bbb9e56c71
tree6c4cfcb97f881ae5609d2bed5fbe8abc580d6571
parentbb9089696e4fedd74711786c2a6f4cd6f4995322
vt: add support for automatic VT switching

Add two functions to enter/leave our VT object. This allows to
implement to expected behavior of automatically switching to the kmscon
when it is running on a new tty, and switching back to the tty we came
from when the program finishes. Presumably this behavior will be
controlled by a config variable or command line argument later on (like
Xorg's -novtswitch).

There's a bit of a subtlety in this because of VT_PROCESS. We need
permission from ourselves to switch in/out of out VT; this is done when
processing SIGUSR[12] in the eloop. We therefore must dispatch the loop
at least once after switching out. The usual case is demonstrated in
test_vt.c.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/vt.c
src/vt.h
tests/test_vt.c