summaryrefslogtreecommitdiff
path: root/src/login/logind-session.h
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-11-28 15:10:24 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-11-28 15:16:49 +0100
commit90a18413f8be577a649900eca977e060273f2b5b (patch)
treebb5ef76e3e1bdf9492f347bed84358b4d237df50 /src/login/logind-session.h
parent6d33772f9ae6769c557e2267d16b7d31f67db914 (diff)
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.
Diffstat (limited to 'src/login/logind-session.h')
-rw-r--r--src/login/logind-session.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/login/logind-session.h b/src/login/logind-session.h
index f7a9dbc249..aab39b72e3 100644
--- a/src/login/logind-session.h
+++ b/src/login/logind-session.h
@@ -89,8 +89,10 @@ struct Session {
char *scope;
char *scope_job;
- int vtnr;
Seat *seat;
+ int vtnr;
+ int vtfd;
+ sd_event_source *vt_source;
pid_t leader;
uint32_t audit_id;
@@ -162,6 +164,9 @@ SessionClass session_class_from_string(const char *s) _pure_;
const char *kill_who_to_string(KillWho k) _const_;
KillWho kill_who_from_string(const char *s) _pure_;
+void session_mute_vt(Session *s);
+void session_restore_vt(Session *s);
+
bool session_is_controller(Session *s, const char *sender);
int session_set_controller(Session *s, const char *sender, bool force);
void session_drop_controller(Session *s);