seat: allow sessions to control VT-switches

A new helper allows sessions to manually handly input events so the core
does no longer perform session/VT switches on their behalf.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-11-19 13:06:43 +01:00
parent 6da6e2319a
commit 275692ee70
2 changed files with 12 additions and 2 deletions

View File

@ -53,6 +53,7 @@ struct kmscon_session {
bool enabled;
bool foreground;
bool manual_input;
bool deactivating;
struct ev_timer *timer;
@ -535,14 +536,14 @@ static void seat_input_event(struct uterm_input *input,
if (conf_grab_matches(seat->conf->grab_session_next,
ev->mods, ev->num_syms, ev->keysyms)) {
ev->handled = true;
if (seat->foreground)
if (!seat->current_sess || !seat->current_sess->manual_input)
seat_next(seat);
return;
}
if (conf_grab_matches(seat->conf->grab_session_prev,
ev->mods, ev->num_syms, ev->keysyms)) {
ev->handled = true;
if (seat->foreground)
if (!seat->current_sess || !seat->current_sess->manual_input)
seat_prev(seat);
return;
}
@ -948,6 +949,14 @@ bool kmscon_session_is_active(struct kmscon_session *sess)
return sess && sess->seat && sess->seat->current_sess == sess;
}
void kmscon_session_set_manual_input(struct kmscon_session *sess, bool set)
{
if (!sess)
return;
sess->manual_input = set;
}
void kmscon_session_enable(struct kmscon_session *sess)
{
if (!sess || sess->enabled)

View File

@ -101,6 +101,7 @@ void kmscon_session_unregister(struct kmscon_session *sess);
bool kmscon_session_is_registered(struct kmscon_session *sess);
bool kmscon_session_is_active(struct kmscon_session *sess);
void kmscon_session_set_manual_input(struct kmscon_session *sess, bool set);
void kmscon_session_enable(struct kmscon_session *sess);
void kmscon_session_disable(struct kmscon_session *sess);