eis: only send interface versions that the client announced

Do not reply with interfaces that the client never requested.

Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/353>
This commit is contained in:
Peter Hutterer 2025-08-01 14:11:47 +10:00 committed by Marge Bot
parent 1faaacda6e
commit 7347aeacd2

View file

@ -122,8 +122,9 @@ client_msg_finish(struct eis_handshake *setup)
* about our version. But for convenience and to make sure this all works
* send all our versions down the wire */
#define SEND_INTERFACE_VERSION(upper_name_, lower_name_) \
eis_handshake_event_interface_version(setup, upper_name_ ##_INTERFACE_NAME, \
setup->client_versions.lower_name_);
if (setup->client_versions.lower_name_) \
eis_handshake_event_interface_version(setup, upper_name_ ##_INTERFACE_NAME, \
setup->client_versions.lower_name_); \
SEND_INTERFACE_VERSION(EIS_CALLBACK, ei_callback);
SEND_INTERFACE_VERSION(EIS_CONNECTION, ei_connection);