chiark / gitweb /
logind: mute/restore VT on behalf of session controllers
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 28 Nov 2013 14:10:24 +0000 (15:10 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 28 Nov 2013 14:16:49 +0000 (15:16 +0100)
commit90a18413f8be577a649900eca977e060273f2b5b
treebb5ef76e3e1bdf9492f347bed84358b4d237df50
parent6d33772f9ae6769c557e2267d16b7d31f67db914
logind: mute/restore VT on behalf of session controllers

If a session process calls TakeControl(), we now put the VT into
KD_GRAPHICS+K_OFF mode. This way, the new session controller can solely
rely on the logind-dbus API to manage the session.

Once the controller exits or calls ReleaseControl(), we restore the VT. We
also restore it, if we lost a controller during crash/restart (but only if
there really *was* a controller previously).

Note that we also must put the VT into VT_PROCESS mode. We want VT_AUTO
semantics, but VT_AUTO+KD_GRAPHICS actually disables *all* VT switches
(who came up with that great idea?). Hence, we set VT_PROCESS for logind
but acknowledge *all* requests immediately.

If a compositor wants custom VT setups, they can still get this by *first*
calling TakeControl() and afterwards setting up the VT. logind doesn't
touch the VT during controller runtime, only during setup/teardown. This
is actually what weston already does.
src/login/logind-session.c
src/login/logind-session.h