libei/test
Peter Hutterer 39a222868f proto: add a device ready request
The protocol currently supports a ei_device.done event to notify
the ei client that the initial description of the device is complete.
For some future use-cases the client may need to futher negotiate
properties of the device. For example for tablet tools the client may
narrow down capabilities of the tool.

The sequence with the new request is thus e.g.
     -> ei_seat.device
     -> ei_device.name
     -> ei_device.interface
     -> ei_device.interface
     -> ei_device.done
     <- ei_device.ready
     -> ei_device.resumed

In libei the request is sent automatically on unref of
the DEVICE_ADDED event. This makes clients immediately compatible
and for the typical (future) use-case of device configuration. Said
configuration will likely be handled in response to the DEVICE_ADDED
event anyway.

In libeis, a new EIS_EVENT_DEVICE_READY event that is sent when the client
sends that same event on the protocol, informing the EIS implementation
that this device is ready. For clients that do not support that version
the event is emulated immediately after sending ei_device.done.

This requires a flag bit to be long-term maintainable. The typical
EIS implementation currently calls eis_device_add() immediately
followed by eis_device_resume(). This doesn't leave any room to
wait for the client's ei_device.ready request.

One backwards-compatible solution could be to buffer the
eis_device_resume() until the ei_device.ready has been received but this
is fraught with hairy corner cases, e.g. if the client is a receiver
context we would also have to buffer all events immediately sent to the
client.

So instead, we have a flag in the context and if set by the caller, we
change the internal behavior to match ei_device interface version 3.

Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/346>
2025-10-17 13:38:47 +10:00
..
templates test: drop a bunch of unused imports 2023-02-15 08:20:01 +10:00
buildtest.c Purge libreis from the repo 2023-02-09 11:48:28 +10:00
buildtest.cc test: make the c++ build test mirror the c build test 2024-12-02 00:23:14 +00:00
conftest.py test: run pytest with xdist where available 2023-03-03 11:27:01 +10:00
eierpecken.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
eierpecken.h proto: add a device ready request 2025-10-17 13:38:47 +10:00
eiproto.py.tmpl test: drop the use of attr 2024-12-10 05:06:49 +00:00
meson.build test: increase protocol-test-valgrind timeout 2025-04-11 15:32:20 +08:00
test-ei-device.c test: change peck_new_context to take varargs 2025-07-24 11:07:32 +10:00
test-ei-seat.c ei: add EI_EVENT_SYNC as opaque event to correctly schedule callbacks 2024-12-18 04:30:01 +00:00
test-ei.c test: add a test for delaying the ping/sync 2025-08-25 13:36:18 +02:00
test-eis.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
test-main.c Remove empty trailing newlines from all files 2023-03-13 08:52:08 +10:00
test_oeffis.py test: rename a variable to shut up ruff with default args 2024-12-10 05:06:49 +00:00
test_protocol.py test: fix false fail by actually looking for unbound capability mask 2025-08-05 02:02:38 +03:00
test_scanner.py Reformat for ruff 0.9 2025-02-03 13:17:34 +10:00
unit-tests.c Add SPDX identifiers to all source files 2022-03-03 00:27:36 +00:00