libei/src
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
..
brei-proto.h.tmpl brei: move the object_id_t typedefs to the brei-proto.h header 2023-05-18 14:03:26 +10:00
brei-shared.c test: fix 64-bit pointer access for the object ids 2023-08-31 13:42:25 +10:00
brei-shared.h doc: Correct spelling errors in the code documentation 2025-07-02 14:03:34 -07:00
ei-proto.c.tmpl log: remove trailing linebreaks from log messages 2023-05-29 17:54:20 +10:00
ei-proto.h.tmpl brei: move the object_id_t typedefs to the brei-proto.h header 2023-05-18 14:03:26 +10:00
libei-button.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-button.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-callback.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-callback.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-connection.c ei: add ei_ping() and the matching EI_EVENT_PONG 2024-12-18 04:30:01 +00:00
libei-connection.h ei: add ei_ping() and the matching EI_EVENT_PONG 2024-12-18 04:30:01 +00:00
libei-device.c ei-device: Don't leak fd when receiving the keymap 2025-05-22 22:43:35 +02:00
libei-device.h Add a mapping_id to the regions 2023-08-30 09:18:26 +10:00
libei-event.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
libei-event.h ei: Expose ei_event_ref() 2025-08-21 17:08:53 +02:00
libei-fd.c ei: rename ei_set_connection to ei_set_socket 2023-03-03 11:20:42 +10:00
libei-handshake.c ei: revamp the internal sync callback 2024-12-18 04:30:01 +00:00
libei-handshake.h Switch object ids to use the object_id_t typedef 2023-03-03 11:27:01 +10:00
libei-keyboard.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-keyboard.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-log.c util: rename xvasprintf to xvaprintf 2023-02-16 15:29:18 +10:00
libei-ping.c ei: add ei_ping() and the matching EI_EVENT_PONG 2024-12-18 04:30:01 +00:00
libei-pingpong.c ei: remove unused ei_pingpong_new() 2023-06-07 23:08:16 +00:00
libei-pingpong.h ei: remove unused ei_pingpong_new() 2023-06-07 23:08:16 +00:00
libei-pointer-absolute.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-pointer-absolute.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-pointer.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-pointer.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-private.h ei: Send sync done event on last event unref 2025-08-21 17:08:53 +02:00
libei-region.c Add a mapping_id to the regions 2023-08-30 09:18:26 +10:00
libei-region.h Add a mapping_id to the regions 2023-08-30 09:18:26 +10:00
libei-scroll.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-scroll.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-seat.c Add a few missing va_end 2024-09-11 12:25:41 +10:00
libei-seat.h protocol: replace the capabilities enum with an interface list 2023-05-02 05:53:25 +00:00
libei-socket.c ei: rename ei_set_connection to ei_set_socket 2023-03-03 11:20:42 +10:00
libei-touchscreen.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei-touchscreen.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libei.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
libei.h ei: Expose ei_event_ref() 2025-08-21 17:08:53 +02:00
libeis-button.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-button.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-callback.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-callback.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-client.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
libeis-client.h eis: if a client is slow, queue up messages for future delivery 2025-05-02 15:40:47 +10:00
libeis-connection.c eis: add eis_ping() and the matching EIS_EVENT_PONG 2024-12-18 04:30:01 +00:00
libeis-connection.h eis: add eis_ping() and the matching EIS_EVENT_PONG 2024-12-18 04:30:01 +00:00
libeis-device.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
libeis-device.h proto: add a device ready request 2025-10-17 13:38:47 +10:00
libeis-event.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
libeis-event.h eis: Expose eis_event_ref() 2025-08-21 17:08:53 +02:00
libeis-fd.c eis: Remove eis_backend_fd_add_fd() 2022-04-27 02:00:07 +00:00
libeis-handshake.c eis: only send interface versions that the client announced 2025-08-05 07:02:57 +00:00
libeis-handshake.h Switch object ids to use the object_id_t typedef 2023-03-03 11:27:01 +10:00
libeis-keyboard.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-keyboard.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-log.c util: rename xvasprintf to xvaprintf 2023-02-16 15:29:18 +10:00
libeis-ping.c eis: add eis_ping() and the matching EIS_EVENT_PONG 2024-12-18 04:30:01 +00:00
libeis-pingpong.c protocol: widen the callback_data arg for ping/sync to 64bit 2023-05-16 15:09:47 +10:00
libeis-pingpong.h protocol: widen the callback_data arg for ping/sync to 64bit 2023-05-16 15:09:47 +10:00
libeis-pointer-absolute.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-pointer-absolute.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-pointer.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-pointer.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-private.h proto: add a device ready request 2025-10-17 13:38:47 +10:00
libeis-region.c Add a mapping_id to the regions 2023-08-30 09:18:26 +10:00
libeis-region.h Add a mapping_id to the regions 2023-08-30 09:18:26 +10:00
libeis-scroll.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-scroll.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-seat.c eis: only send scroll/button capabilities if the client supports them 2025-08-05 07:02:57 +00:00
libeis-seat.h eis: only queue a seat bind event if the caps change 2023-11-08 23:24:45 +00:00
libeis-socket.c eis: implement getting client PID for BSDs after 70cfc6eed2 2025-08-26 09:33:24 +02:00
libeis-touchscreen.c Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis-touchscreen.h Fix MIT license header text 2025-05-29 23:07:48 +00:00
libeis.c proto: add a device ready request 2025-10-17 13:38:47 +10:00
libeis.h proto: add a device ready request 2025-10-17 13:38:47 +10:00
liboeffis.c oeffis: Correct spelling errors in log messages 2025-07-02 14:03:34 -07:00
liboeffis.h oeffis: OEFFIS_DEVICE_ALL_DEVICES should translate to "all" 2023-12-14 00:58:18 +00:00
meson.build meson.build: Use the correct name for the libraries overrides 2025-03-26 15:33:34 +01:00
util-bits.c util: add some mask helpers 2023-03-03 11:16:48 +10:00
util-bits.h util: add some mask helpers 2023-03-03 11:16:48 +10:00
util-color.h Add SPDX identifiers to all source files 2022-03-03 00:27:36 +00:00
util-io.c doc: Correct spelling errors in the code documentation 2025-07-02 14:03:34 -07:00
util-io.h doc: Correct spelling errors in the code documentation 2025-07-02 14:03:34 -07:00
util-list.c util: add the macros to run through a list backwards 2022-05-17 14:36:39 +10:00
util-list.h util: add the macros to run through a list backwards 2022-05-17 14:36:39 +10:00
util-logger.c util-object: split macro to generate unref into one two 2022-03-03 05:41:15 +00:00
util-logger.h Add SPDX identifiers to all source files 2022-03-03 00:27:36 +00:00
util-macros.h utils: add the etrace macro 2025-07-24 11:07:32 +10:00
util-mem.h util: fix a comment to use the right decimal marker for english 2024-09-11 12:27:38 +10:00
util-memfile.c util/memfile: use MAP_SHARED to create the map 2024-07-29 14:48:34 +10:00
util-memfile.h util/memfile: include stddef for size_t 2024-07-29 14:48:34 +10:00
util-memmap.c util/memmap: add a helper wrapper around mmap 2024-07-29 14:48:34 +10:00
util-memmap.h util/memmap: add a helper wrapper around mmap 2024-07-29 14:48:34 +10:00
util-munit.c util: add a global setup option to our munit wrapper 2023-10-24 18:25:25 +10:00
util-munit.h Revert "util: silence out-of-bounds read warning" 2024-11-26 15:33:36 +10:00
util-object.h util: add macros to declare getters and setters 2023-02-13 13:27:57 +10:00
util-sources.c test: add a few non-null checks to make the static analyzer happy 2024-09-11 12:26:40 +10:00
util-sources.h util: allow sources to have write notifications 2023-10-11 00:41:13 +00:00
util-strings.c doc: Correct spelling errors in the code documentation 2025-07-02 14:03:34 -07:00
util-strings.h util: use already computed strlen 2025-06-29 07:43:34 +00:00
util-structs.h Add SPDX identifiers to all source files 2022-03-03 00:27:36 +00:00
util-time.h util: add msleep() 2023-03-03 11:16:48 +10:00
util-tristate.h Remove empty trailing newlines from all files 2023-03-13 08:52:08 +10:00
util-version.h Add a version macro for grepable version numbers 2022-09-07 09:20:27 +10:00