seat: limit multi-session mode to --multi-session
If kmscon is started without the --multi-session option, we no longer provide multi-session support (now the default). This is for better backwards compatibility to agetty and friends. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
79312a60ae
commit
22a1e1b91b
@ -74,7 +74,8 @@ static void print_help()
|
||||
"\t --cdev [off] Emulate kernel VTs\n"
|
||||
"\n"
|
||||
"Session Options:\n"
|
||||
"\t --session-max <max> [50] Maximum number of sessions\n"
|
||||
"\t --session-max <max> [50] Maximum number of sessions\n"
|
||||
"\t --multi-session [off] Run in multi-session mode\n"
|
||||
"\n"
|
||||
"Terminal Options:\n"
|
||||
"\t-l, --login [/bin/sh]\n"
|
||||
@ -478,6 +479,7 @@ int kmscon_conf_new(struct conf_ctx **out)
|
||||
|
||||
/* Session Options */
|
||||
CONF_OPTION_UINT(0, "session-max", &conf->session_max, 50),
|
||||
CONF_OPTION_BOOL(0, "multi-session", &conf->multi_session, false),
|
||||
|
||||
/* Terminal Options */
|
||||
CONF_OPTION(0, 'l', "login", &conf_login, aftercheck_login, NULL, file_login, &conf->login, false),
|
||||
|
@ -63,6 +63,8 @@ struct kmscon_conf_t {
|
||||
/* Session Options */
|
||||
/* sessions */
|
||||
unsigned int session_max;
|
||||
/* run in multi-session mode */
|
||||
bool multi_session;
|
||||
|
||||
/* Terminal Options */
|
||||
/* custom login process */
|
||||
|
@ -536,7 +536,7 @@ static void seat_input_event(struct uterm_input *input,
|
||||
struct kmscon_session *s;
|
||||
int ret;
|
||||
|
||||
if (ev->handled || !seat->awake)
|
||||
if (ev->handled || !seat->awake || !seat->conf->multi_session)
|
||||
return;
|
||||
|
||||
if (conf_grab_matches(seat->conf->grab_session_next,
|
||||
@ -690,7 +690,7 @@ int kmscon_seat_new(struct kmscon_seat **out,
|
||||
else
|
||||
kmscon_session_enable(s);
|
||||
|
||||
if (seat->conf->cdev) {
|
||||
if (seat->conf->multi_session && seat->conf->cdev) {
|
||||
ret = kmscon_cdev_register(&s, seat);
|
||||
if (ret == -EOPNOTSUPP)
|
||||
log_notice("cdev sessions not compiled in");
|
||||
@ -698,11 +698,13 @@ int kmscon_seat_new(struct kmscon_seat **out,
|
||||
log_error("cannot register cdev session: %d", ret);
|
||||
}
|
||||
|
||||
ret = kmscon_compositor_register(&s, seat);
|
||||
if (ret == -EOPNOTSUPP)
|
||||
log_notice("compositor support not compiled in");
|
||||
else if (ret)
|
||||
log_error("cannot register kmscon compositor: %d", ret);
|
||||
if (seat->conf->multi_session) {
|
||||
ret = kmscon_compositor_register(&s, seat);
|
||||
if (ret == -EOPNOTSUPP)
|
||||
log_notice("compositor support not compiled in");
|
||||
else if (ret)
|
||||
log_error("cannot register kmscon compositor: %d", ret);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user