seat: add kmscon_seat_is_registered() helper
This helper allows API users to check whether a session object is still registered to a seat. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
d904eb929a
commit
6977a7ecf0
@ -474,6 +474,11 @@ void kmscon_session_unregister(struct kmscon_session *sess)
|
||||
session_call(sess, KMSCON_SESSION_UNREGISTER, NULL);
|
||||
}
|
||||
|
||||
bool kmscon_session_is_registered(struct kmscon_session *sess)
|
||||
{
|
||||
return sess && sess->seat;
|
||||
}
|
||||
|
||||
void kmscon_session_activate(struct kmscon_session *sess)
|
||||
{
|
||||
if (!sess || !sess->seat)
|
||||
|
@ -32,8 +32,8 @@
|
||||
#ifndef KMSCON_SEAT_H
|
||||
#define KMSCON_SEAT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "eloop.h"
|
||||
#include "uterm.h"
|
||||
|
||||
@ -89,6 +89,7 @@ int kmscon_seat_register_session(struct kmscon_seat *seat,
|
||||
void kmscon_session_ref(struct kmscon_session *sess);
|
||||
void kmscon_session_unref(struct kmscon_session *sess);
|
||||
void kmscon_session_unregister(struct kmscon_session *sess);
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user