seat: add kmscon_session_is_active() helper
This helper allows to check whether a given session is currently the active session on its registered seat. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
6977a7ecf0
commit
70386fb702
@ -494,3 +494,8 @@ void kmscon_session_deactivate(struct kmscon_session *sess)
|
||||
|
||||
session_deactivate(sess);
|
||||
}
|
||||
|
||||
bool kmscon_session_is_active(struct kmscon_session *sess)
|
||||
{
|
||||
return sess && sess->seat && sess->seat->cur_sess == sess;
|
||||
}
|
||||
|
@ -93,5 +93,6 @@ bool kmscon_session_is_registered(struct kmscon_session *sess);
|
||||
|
||||
void kmscon_session_activate(struct kmscon_session *sess);
|
||||
void kmscon_session_deactivate(struct kmscon_session *sess);
|
||||
bool kmscon_session_is_active(struct kmscon_session *sess);
|
||||
|
||||
#endif /* KMSCON_SEAT_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user