From a20e0304fefa74b2eca12d6eb502d967d5ed739b Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 23 May 2025 15:47:57 +0200 Subject: [PATCH] dix: unexport TryClientEvents() Not used by any external drivers, so no need to keep it exported. Signed-off-by: Enrico Weigelt, metux IT consult --- dix/dix_priv.h | 34 ++++++++++++++++++++++++++++++++++ dix/events.c | 2 +- include/dix.h | 9 --------- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/dix/dix_priv.h b/dix/dix_priv.h index ba6e90887..0465f8dce 100644 --- a/dix/dix_priv.h +++ b/dix/dix_priv.h @@ -422,4 +422,38 @@ XRetCode AlterSaveSetForClient(ClientPtr pClient, Bool toRoot, Bool map); +/** + * @brief deliver the given events to the given client. + * + * More than one event may be delivered at a time. This is the case with + * DeviceMotionNotifies which may be followed by DeviceValuator events. + * + * TryClientEvents() is the last station before actually writing the events to + * the socket. Anything that is not filtered here, will get delivered to the + * client. + * An event is only delivered if + * - mask and filter match up. + * - no other client has a grab on the device that caused the event. + * + * + * @param client The target client to deliver to. + * @param dev The device the event came from. May be NULL. + * @param pEvents The events to be delivered. + * @param count Number of elements in pEvents. + * @param mask Event mask as set by the window. + * @param filter Mask based on event type. + * @param grab Possible grab on the device that caused the event. + * + * @return 1 if event was delivered, 0 if not or -1 if grab was not set by the + * client. + */ +int TryClientEvents(ClientPtr pClient, + DeviceIntPtr device, + xEventPtr pEvents, + size_t count, + Mask mask, + Mask filter, + GrabPtr grab) + _X_ATTRIBUTE_NONNULL_ARG(3); + #endif /* _XSERVER_DIX_PRIV_H */ diff --git a/dix/events.c b/dix/events.c index 57f2795e4..a9c38b312 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2034,7 +2034,7 @@ ReleaseActiveGrabs(ClientPtr client) */ int TryClientEvents(ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, - int count, Mask mask, Mask filter, GrabPtr grab) + size_t count, Mask mask, Mask filter, GrabPtr grab) { int type; diff --git a/include/dix.h b/include/dix.h index 3d7b8b600..341174044 100644 --- a/include/dix.h +++ b/include/dix.h @@ -286,15 +286,6 @@ WriteEventsToClient(ClientPtr /*pClient */ , int /*count */ , xEventPtr /*events */ ); -extern _X_EXPORT int -TryClientEvents(ClientPtr /*client */ , - DeviceIntPtr /* device */ , - xEventPtr /*pEvents */ , - int /*count */ , - Mask /*mask */ , - Mask /*filter */ , - GrabPtr /*grab */ ); - extern _X_EXPORT void WindowsRestructured(void);