aboutsummaryrefslogtreecommitdiff
path: root/libseat/libseat.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-03-26 10:05:12 +0100
committerKenny Levinsen <kl@kl.wtf>2021-03-26 11:11:26 +0100
commit9a7824b7c3ff5c957632671e91454fc84fbcdda8 (patch)
treecf103f2f5591943b61cb330e129e20de546477ea /libseat/libseat.c
parent5ad91ae9dad205331ede6579b2b24b53e02a6287 (diff)
Add no-op session
This is useful for headless testing, for instance with VKMS: modprobe vkms export WLR_DRM_DEVICES=/dev/dri/card1 export WLR_BACKENDS=drm export LIBSEAT_BACKEND=noop sway We don't need any of the VT handling in this case.
Diffstat (limited to 'libseat/libseat.c')
-rw-r--r--libseat/libseat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libseat/libseat.c b/libseat/libseat.c
index b1e8bb2..a7e079c 100644
--- a/libseat/libseat.c
+++ b/libseat/libseat.c
@@ -13,6 +13,7 @@
extern const struct seat_impl seatd_impl;
extern const struct seat_impl logind_impl;
extern const struct seat_impl builtin_impl;
+extern const struct seat_impl noop_impl;
static const struct named_backend impls[] = {
#ifdef SEATD_ENABLED
@@ -24,6 +25,7 @@ static const struct named_backend impls[] = {
#ifdef BUILTIN_ENABLED
{"builtin", &builtin_impl},
#endif
+ {"noop", &noop_impl},
{NULL, NULL},
};
@@ -62,6 +64,9 @@ struct libseat *libseat_open_seat(struct libseat_seat_listener *listener, void *
struct libseat *backend = NULL;
for (const struct named_backend *iter = impls; iter->backend != NULL; iter++) {
+ if (iter->backend == &noop_impl) {
+ continue;
+ }
backend = iter->backend->open_seat(listener, data);
if (backend != NULL) {
log_infof("Seat opened with backend '%s'", iter->name);