Commit 883811c2 authored by Peter Hutterer's avatar Peter Hutterer

dix: remove inputInfo.pointer reference in TryClientEvents.

Unfortunately, this requires a change in the TCE API, and thus a change in all
callers. Tough luck.
parent 6e171844
...@@ -541,8 +541,8 @@ int reason; ...@@ -541,8 +541,8 @@ int reason;
event.u.videoNotify.drawable = pDraw->id; event.u.videoNotify.drawable = pDraw->id;
event.u.videoNotify.port = pPort->id; event.u.videoNotify.port = pPort->id;
event.u.videoNotify.reason = reason; event.u.videoNotify.reason = reason;
(void) TryClientEvents(pn->client, (xEventPtr)&event, 1, NoEventMask, TryClientEvents(pn->client, NULL, (xEventPtr)&event, 1,
NoEventMask, NullGrab); NoEventMask, NoEventMask, NullGrab);
} }
pn = pn->next; pn = pn->next;
} }
...@@ -573,8 +573,8 @@ XvdiSendPortNotify( ...@@ -573,8 +573,8 @@ XvdiSendPortNotify(
event.u.portNotify.port = pPort->id; event.u.portNotify.port = pPort->id;
event.u.portNotify.attribute = attribute; event.u.portNotify.attribute = attribute;
event.u.portNotify.value = value; event.u.portNotify.value = value;
(void) TryClientEvents(pn->client, (xEventPtr)&event, 1, NoEventMask, TryClientEvents(pn->client, NULL, (xEventPtr)&event, 1,
NoEventMask, NullGrab); NoEventMask, NoEventMask, NullGrab);
} }
pn = pn->next; pn = pn->next;
} }
......
...@@ -1023,7 +1023,8 @@ ProcSetSelectionOwner(ClientPtr client) ...@@ -1023,7 +1023,8 @@ ProcSetSelectionOwner(ClientPtr client)
event.u.selectionClear.time = time.milliseconds; event.u.selectionClear.time = time.milliseconds;
event.u.selectionClear.window = CurrentSelections[i].window; event.u.selectionClear.window = CurrentSelections[i].window;
event.u.selectionClear.atom = CurrentSelections[i].selection; event.u.selectionClear.atom = CurrentSelections[i].selection;
(void) TryClientEvents (CurrentSelections[i].client, &event, 1, TryClientEvents (CurrentSelections[i].client, NULL,
&event, 1,
NoEventMask, NoEventMask /* CantBeFiltered */, NoEventMask, NoEventMask /* CantBeFiltered */,
NullGrab); NullGrab);
} }
...@@ -1158,7 +1159,7 @@ ProcConvertSelection(ClientPtr client) ...@@ -1158,7 +1159,7 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionRequest.target = stuff->target; event.u.selectionRequest.target = stuff->target;
event.u.selectionRequest.property = stuff->property; event.u.selectionRequest.property = stuff->property;
if (TryClientEvents( if (TryClientEvents(
CurrentSelections[i].client, &event, 1, NoEventMask, CurrentSelections[i].client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab)) NoEventMask /* CantBeFiltered */, NullGrab))
return (client->noClientException); return (client->noClientException);
} }
...@@ -1168,7 +1169,7 @@ ProcConvertSelection(ClientPtr client) ...@@ -1168,7 +1169,7 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionNotify.selection = stuff->selection; event.u.selectionNotify.selection = stuff->selection;
event.u.selectionNotify.target = stuff->target; event.u.selectionNotify.target = stuff->target;
event.u.selectionNotify.property = None; event.u.selectionNotify.property = None;
(void) TryClientEvents(client, &event, 1, NoEventMask, TryClientEvents(client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab); NoEventMask /* CantBeFiltered */, NullGrab);
return (client->noClientException); return (client->noClientException);
} }
......
...@@ -1968,6 +1968,7 @@ ReleaseActiveGrabs(ClientPtr client) ...@@ -1968,6 +1968,7 @@ ReleaseActiveGrabs(ClientPtr client)
* *
* *
* @param client The target client to deliver to. * @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 pEvents The events to be delivered.
* @param count Number of elements in pEvents. * @param count Number of elements in pEvents.
* @param mask Event mask as set by the window. * @param mask Event mask as set by the window.
...@@ -1978,8 +1979,8 @@ ReleaseActiveGrabs(ClientPtr client) ...@@ -1978,8 +1979,8 @@ ReleaseActiveGrabs(ClientPtr client)
* client. * client.
*/ */
_X_EXPORT int _X_EXPORT int
TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
Mask filter, GrabPtr grab) int count, Mask mask, Mask filter, GrabPtr grab)
{ {
int i; int i;
int type; int type;
...@@ -1998,7 +1999,7 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, ...@@ -1998,7 +1999,7 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
{ {
if (mask & PointerMotionHintMask) if (mask & PointerMotionHintMask)
{ {
if (WID(inputInfo.pointer->valuator->motionHintWindow) == if (WID(dev->valuator->motionHintWindow) ==
pEvents->u.keyButtonPointer.event) pEvents->u.keyButtonPointer.event)
{ {
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
...@@ -2108,8 +2109,9 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent ...@@ -2108,8 +2109,9 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count)) if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count))
/* do nothing */; /* do nothing */;
else if ( (attempt = TryClientEvents(wClient(pWin), pEvents, count, else if ( (attempt = TryClientEvents(wClient(pWin), pDev, pEvents,
pWin->eventMask, filter, grab)) ) count, pWin->eventMask,
filter, grab)) )
{ {
if (attempt > 0) if (attempt > 0)
{ {
...@@ -2146,8 +2148,10 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent ...@@ -2146,8 +2148,10 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
if (XaceHook(XACE_RECEIVE_ACCESS, pClient->client, pWin, if (XaceHook(XACE_RECEIVE_ACCESS, pClient->client, pWin,
pEvents, count)) pEvents, count))
/* do nothing */; /* do nothing */;
else if (TryClientEvents(pClient->client, pEvents, count, else if (TryClientEvents(pClient->client, pDev,
pClient->eventMask[GEEXTIDX(pEvents)], filter, grab) > 0) pEvents, count,
pClient->eventMask[GEEXTIDX(pEvents)],
filter, grab) > 0)
{ {
deliveries++; deliveries++;
} else } else
...@@ -2179,8 +2183,10 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent ...@@ -2179,8 +2183,10 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin,
pEvents, count)) pEvents, count))
/* do nothing */; /* do nothing */;
else if ( (attempt = TryClientEvents(rClient(other), pEvents, count, else if ( (attempt = TryClientEvents(rClient(other), pDev,
other->mask[mskidx], filter, grab)) ) pEvents, count,
other->mask[mskidx],
filter, grab)) )
{ {
if (attempt > 0) if (attempt > 0)
{ {
...@@ -2308,7 +2314,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents, ...@@ -2308,7 +2314,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
#endif #endif
if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count)) if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count))
return 1; /* don't send, but pretend we did */ return 1; /* don't send, but pretend we did */
return TryClientEvents(wClient(pWin), pEvents, count, return TryClientEvents(wClient(pWin), NULL, pEvents, count,
pWin->eventMask, filter, NullGrab); pWin->eventMask, filter, NullGrab);
} }
for (other = wOtherClients(pWin); other; other = other->next) for (other = wOtherClients(pWin); other; other = other->next)
...@@ -2325,7 +2331,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents, ...@@ -2325,7 +2331,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, pEvents, if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, pEvents,
count)) count))
return 1; /* don't send, but pretend we did */ return 1; /* don't send, but pretend we did */
return TryClientEvents(rClient(other), pEvents, count, return TryClientEvents(rClient(other), NULL, pEvents, count,
other->mask, filter, NullGrab); other->mask, filter, NullGrab);
} }
} }
...@@ -3469,7 +3475,7 @@ CheckPassiveGrabsOnWindow( ...@@ -3469,7 +3475,7 @@ CheckPassiveGrabsOnWindow(
FixUpEventFromWindow(device, xE, grab->window, None, TRUE); FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
(void) TryClientEvents(rClient(grab), xE, count, (void) TryClientEvents(rClient(grab), device, xE, count,
filters[device->id][xE->u.u.type], filters[device->id][xE->u.u.type],
filters[device->id][xE->u.u.type], grab); filters[device->id][xE->u.u.type], grab);
...@@ -3704,8 +3710,8 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, ...@@ -3704,8 +3710,8 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
if (GEEventFill(xE)) if (GEEventFill(xE))
GEEventFill(xE)(ge, thisDev, grab->window, grab); GEEventFill(xE)(ge, thisDev, grab->window, grab);
deliveries = TryClientEvents(rClient(grab), xE, count, deliveries = TryClientEvents(rClient(grab), thisDev, xE,
gemask->eventMask[GEEXTIDX(ge)], count, gemask->eventMask[GEEXTIDX(ge)],
generic_filters[GEEXTIDX(ge)][ge->evtype], generic_filters[GEEXTIDX(ge)][ge->evtype],
grab); grab);
} else } else
...@@ -3728,8 +3734,8 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, ...@@ -3728,8 +3734,8 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
else if (!IsInterferingGrab(rClient(grab), thisDev, else if (!IsInterferingGrab(rClient(grab), thisDev,
&core)) &core))
{ {
deliveries = TryClientEvents(rClient(grab), &core, 1, deliveries = TryClientEvents(rClient(grab), thisDev,
mask, &core, 1, mask,
filters[thisDev->id][core.u.u.type], filters[thisDev->id][core.u.u.type],
grab); grab);
} }
...@@ -3754,7 +3760,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, ...@@ -3754,7 +3760,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
else else
{ {
deliveries = deliveries =
TryClientEvents(rClient(grab), TryClientEvents(rClient(grab), thisDev,
xE, count, xE, count,
mask, mask,
filters[thisDev->id][xE->u.u.type], filters[thisDev->id][xE->u.u.type],
...@@ -4452,10 +4458,10 @@ EnterLeaveEvent( ...@@ -4452,10 +4458,10 @@ EnterLeaveEvent(
if ((mask & filters[mouse->id][type]) && sendevent) if ((mask & filters[mouse->id][type]) && sendevent)
{ {
if (grab) if (grab)
(void)TryClientEvents(rClient(grab), &event, 1, mask, TryClientEvents(rClient(grab), mouse, &event, 1, mask,
filters[mouse->id][type], grab); filters[mouse->id][type], grab);
else else
(void)DeliverEventsToWindow(mouse, pWin, &event, 1, DeliverEventsToWindow(mouse, pWin, &event, 1,
filters[mouse->id][type], NullGrab, 0); filters[mouse->id][type], NullGrab, 0);
} }
...@@ -4475,7 +4481,8 @@ EnterLeaveEvent( ...@@ -4475,7 +4481,8 @@ EnterLeaveEvent(
inputMasks->deliverableEvents[mskidx])) inputMasks->deliverableEvents[mskidx]))
{ {
if (devgrab) if (devgrab)
(void)TryClientEvents(rClient(devgrab), (xEvent*)devEnterLeave, 1, (void)TryClientEvents(rClient(devgrab), mouse,
(xEvent*)devEnterLeave, 1,
mask, filters[mouse->id][devEnterLeave->type], mask, filters[mouse->id][devEnterLeave->type],
devgrab); devgrab);
else else
...@@ -4496,8 +4503,8 @@ EnterLeaveEvent( ...@@ -4496,8 +4503,8 @@ EnterLeaveEvent(
ke.type = KeymapNotify; ke.type = KeymapNotify;
if (grab) if (grab)
(void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask, (void)TryClientEvents(rClient(grab), keybd, (xEvent *)&ke, 1,
KeymapStateMask, grab); mask, KeymapStateMask, grab);
else else
(void)DeliverEventsToWindow(mouse, pWin, (xEvent *)&ke, 1, (void)DeliverEventsToWindow(mouse, pWin, (xEvent *)&ke, 1,
KeymapStateMask, NullGrab, 0); KeymapStateMask, NullGrab, 0);
......
...@@ -1105,7 +1105,7 @@ DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd) ...@@ -1105,7 +1105,7 @@ DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd)
if (pScreenPriv->client) if (pScreenPriv->client)
{ {
/* If the DGA client has selected input, then deliver based on the usual filter */ /* If the DGA client has selected input, then deliver based on the usual filter */
TryClientEvents (pScreenPriv->client, (xEvent *) de, 1, TryClientEvents (pScreenPriv->client, keybd, (xEvent *) de, 1,
filters[coreEquiv], pScreenPriv->input, 0); filters[coreEquiv], pScreenPriv->input, 0);
} }
else else
...@@ -1186,7 +1186,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse) ...@@ -1186,7 +1186,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse)
if (pScreenPriv->client) if (pScreenPriv->client)
{ {
/* If the DGA client has selected input, then deliver based on the usual filter */ /* If the DGA client has selected input, then deliver based on the usual filter */
TryClientEvents (pScreenPriv->client, (xEvent *) de, 1, TryClientEvents (pScreenPriv->client, mouse, (xEvent *) de, 1,
filters[coreEquiv], pScreenPriv->input, 0); filters[coreEquiv], pScreenPriv->input, 0);
} }
else else
......
...@@ -502,6 +502,7 @@ extern void WriteEventsToClient( ...@@ -502,6 +502,7 @@ extern void WriteEventsToClient(
extern int TryClientEvents( extern int TryClientEvents(
ClientPtr /*client*/, ClientPtr /*client*/,
DeviceIntPtr /* device */,
xEventPtr /*pEvents*/, xEventPtr /*pEvents*/,
int /*count*/, int /*count*/,
Mask /*mask*/, Mask /*mask*/,
......
...@@ -385,7 +385,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) ...@@ -385,7 +385,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor)
pe->u.graphicsExposure.majorEvent = major; pe->u.graphicsExposure.majorEvent = major;
pe->u.graphicsExposure.minorEvent = minor; pe->u.graphicsExposure.minorEvent = minor;
} }
TryClientEvents(client, pEvent, numRects, TryClientEvents(client, NULL, pEvent, numRects,
(Mask)0, NoEventMask, NullGrab); (Mask)0, NoEventMask, NullGrab);
xfree(pEvent); xfree(pEvent);
} }
...@@ -396,7 +396,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) ...@@ -396,7 +396,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor)
event.u.noExposure.drawable = drawable; event.u.noExposure.drawable = drawable;
event.u.noExposure.majorEvent = major; event.u.noExposure.majorEvent = major;
event.u.noExposure.minorEvent = minor; event.u.noExposure.minorEvent = minor;
TryClientEvents(client, &event, 1, TryClientEvents(client, NULL, &event, 1,
(Mask)0, NoEventMask, NullGrab); (Mask)0, NoEventMask, NullGrab);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment