Skip to content

ei: make ei_disconnect() public

Peter Hutterer requested to merge whot/libei:wip/ei-disconnect into main

Previously the only way to disconnect from the EIS implementation was to call ei_unref() and release all resources. This makes it more difficult for shared cleanup code - clients already have code in place to deal with DEVICE_REMOVED, SEAT_REMOVED, etc. but that code has to be triggered manually before ei_unref() is called.

OTOH where the server disconnects us, libei already unwound the state so we would artificially generate these removed events, allowing the client to clean up.

Make life easier for client by allowing them to ei_disconnect() and get the benefits of our state unwinding. ei_disconnect() was already used internally to disconnect on any error so this merely makes this function public.

Closes #67 (closed)

cc @rkjnsn1

Merge request reports

Loading