Anna (navi) Figueiredo Gomes: 4
noop: Call {enable,disable}_seat callbacks.
noop: Return seat0 as the seat name
noop: Close the open devices when close device is called.
noop: Additional open flags for `open(2)`
4 files changed, 6 insertions(+), 3 deletions(-)
Hmm, looking at the code we should actually already be sending the enable:
1. When seat is opened with noop, `backend->initial_setup` is set to true.
2. In dispatch, if `backend->initial_setup` is set, the enable_seat
callback is called and the flag is cleared.
3. In wlroots' libseat_session_init, wlroots calls `libseat_dispatch`
shortly after `libseat_open`, so this logic should activate.
Note that 9b8b6e0bf88f02b77835c977ca97017ac6ed850f introduced the
missing `backend->initial_setup = true` line, and so it would not have
worked on the 0.7 release.
Would you mind checking why the current setup is not working? If it
cannot work, it should be removed - but if it can be made to work,
firing the event from dispatch will be more in line with the other backends.
wlroots' libinput backend expects the name of the seat to either match
ID_SEAT from udev, or in case ID_SEAT returns nothing, match seat0. As
noop has no seat switching, always returning seat0 as the session name
fixes that.
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
---
libseat/backend/noop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libseat/backend/noop.c b/libseat/backend/noop.c
index 8818406..0cf19ca 100644
--- a/libseat/backend/noop.c+++ b/libseat/backend/noop.c
@@ -47,7 +47,7 @@ static int disable_seat(struct libseat *base) {
static const char *seat_name(struct libseat *base) {
(void)base;
- return "noop";+ return "seat0";}
static int open_device(struct libseat *base, const char *path, int *fd) {
--
2.39.2
[PATCH 3/4] noop: Close the open devices when close device is called.
Export this patch
We are not supposed to close the users' fd here. The call is to tell
seatd/logind that we're done with the device, which is just a noop for
the noop backend.
You can see wlroot's own close after libseat_close_device in
wlr_session_close_file, so this would become a double-close.