dix: MaybeDeliverEventToClient(): change return type to Bool
Callers are only interesed in whether event was actually sent (retval==1) or not, so Bool is suffient and easier. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
d74f591ce4
commit
09f46c97b6
|
@ -269,12 +269,12 @@ void SetCriticalEvent(int event);
|
||||||
* @param pEvent event to be delivered
|
* @param pEvent event to be delivered
|
||||||
* @param filter filter mask based on event type
|
* @param filter filter mask based on event type
|
||||||
* @param skipClient don't deliver to this client (if not NULL)
|
* @param skipClient don't deliver to this client (if not NULL)
|
||||||
* @return 0 when skipped (skipClient), 1 when delivered, 2 when nobody's interested
|
* @return TRUE when event was delivered
|
||||||
*/
|
*/
|
||||||
int MaybeDeliverEventToClient(WindowPtr pWindow,
|
Bool MaybeDeliverEventToClient(WindowPtr pWindow,
|
||||||
xEvent *pEvent,
|
xEvent *pEvent,
|
||||||
Mask filter,
|
Mask filter,
|
||||||
ClientPtr skipClient)
|
ClientPtr skipClient)
|
||||||
_X_ATTRIBUTE_NONNULL_ARG(1,2);
|
_X_ATTRIBUTE_NONNULL_ARG(1,2);
|
||||||
|
|
||||||
#endif /* _XSERVER_DIX_PRIV_H */
|
#endif /* _XSERVER_DIX_PRIV_H */
|
||||||
|
|
23
dix/events.c
23
dix/events.c
|
@ -2545,41 +2545,40 @@ XineramaTryClientEventsResult(ClientPtr client,
|
||||||
* @param filter Mask based on event type.
|
* @param filter Mask based on event type.
|
||||||
* @param dontClient Don't deliver to the dontClient.
|
* @param dontClient Don't deliver to the dontClient.
|
||||||
*/
|
*/
|
||||||
int
|
Bool MaybeDeliverEventToClient(WindowPtr pWin, xEvent *pEvents,
|
||||||
MaybeDeliverEventToClient(WindowPtr pWin, xEvent *pEvents,
|
Mask filter, ClientPtr dontClient)
|
||||||
Mask filter, ClientPtr dontClient)
|
|
||||||
{
|
{
|
||||||
OtherClients *other;
|
OtherClients *other;
|
||||||
|
|
||||||
if (pWin->eventMask & filter) {
|
if (pWin->eventMask & filter) {
|
||||||
if (wClient(pWin) == dontClient)
|
if (wClient(pWin) == dontClient)
|
||||||
return 0;
|
return FALSE;
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
|
if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
|
||||||
return XineramaTryClientEventsResult(wClient(pWin), NullGrab,
|
return XineramaTryClientEventsResult(wClient(pWin), NullGrab,
|
||||||
pWin->eventMask, filter);
|
pWin->eventMask, filter) == 1;
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
if (XaceHookReceiveAccess(wClient(pWin), pWin, pEvents, 1))
|
if (XaceHookReceiveAccess(wClient(pWin), pWin, pEvents, 1))
|
||||||
return 1; /* don't send, but pretend we did */
|
return TRUE; /* don't send, but pretend we did */
|
||||||
return TryClientEvents(wClient(pWin), NULL, pEvents, 1,
|
return TryClientEvents(wClient(pWin), NULL, pEvents, 1,
|
||||||
pWin->eventMask, filter, NullGrab);
|
pWin->eventMask, filter, NullGrab) == 1;
|
||||||
}
|
}
|
||||||
for (other = wOtherClients(pWin); other; other = other->next) {
|
for (other = wOtherClients(pWin); other; other = other->next) {
|
||||||
if (other->mask & filter) {
|
if (other->mask & filter) {
|
||||||
if (SameClient(other, dontClient))
|
if (SameClient(other, dontClient))
|
||||||
return 0;
|
return FALSE;
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
|
if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
|
||||||
return XineramaTryClientEventsResult(rClient(other), NullGrab,
|
return XineramaTryClientEventsResult(rClient(other), NullGrab,
|
||||||
other->mask, filter);
|
other->mask, filter) == 1;
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
if (XaceHookReceiveAccess(rClient(other), pWin, pEvents, 1))
|
if (XaceHookReceiveAccess(rClient(other), pWin, pEvents, 1))
|
||||||
return 1; /* don't send, but pretend we did */
|
return TRUE; /* don't send, but pretend we did */
|
||||||
return TryClientEvents(rClient(other), NULL, pEvents, 1,
|
return TryClientEvents(rClient(other), NULL, pEvents, 1,
|
||||||
other->mask, filter, NullGrab);
|
other->mask, filter, NullGrab) == 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 2;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Window
|
static Window
|
||||||
|
|
|
@ -2310,7 +2310,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
if (MaybeDeliverEventToClient(pParent, &event,
|
if (MaybeDeliverEventToClient(pParent, &event,
|
||||||
SubstructureRedirectMask, client) == 1)
|
SubstructureRedirectMask, client))
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
if (action == RESIZE_WIN) {
|
if (action == RESIZE_WIN) {
|
||||||
|
@ -2326,7 +2326,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
|
||||||
};
|
};
|
||||||
eventT.u.u.type = ResizeRequest;
|
eventT.u.u.type = ResizeRequest;
|
||||||
if (MaybeDeliverEventToClient(pWin, &eventT,
|
if (MaybeDeliverEventToClient(pWin, &eventT,
|
||||||
ResizeRedirectMask, client) == 1) {
|
ResizeRedirectMask, client)) {
|
||||||
/* if event is delivered, leave the actual size alone. */
|
/* if event is delivered, leave the actual size alone. */
|
||||||
w = pWin->drawable.width;
|
w = pWin->drawable.width;
|
||||||
h = pWin->drawable.height;
|
h = pWin->drawable.height;
|
||||||
|
@ -2475,7 +2475,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
|
||||||
if (RedirectSend(pParent)) {
|
if (RedirectSend(pParent)) {
|
||||||
event.u.u.type = CirculateRequest;
|
event.u.u.type = CirculateRequest;
|
||||||
if (MaybeDeliverEventToClient(pParent, &event,
|
if (MaybeDeliverEventToClient(pParent, &event,
|
||||||
SubstructureRedirectMask, client) == 1)
|
SubstructureRedirectMask, client))
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2633,7 +2633,7 @@ MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client)
|
||||||
|
|
||||||
return MaybeDeliverEventToClient(pParent, &event,
|
return MaybeDeliverEventToClient(pParent, &event,
|
||||||
SubstructureRedirectMask,
|
SubstructureRedirectMask,
|
||||||
client) == 1;
|
client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue