dix, Xext, Xtrap, Xi: replace inputInfo.pointer with PickPointer where
possible. More replacements to come.
This commit is contained in:
parent
e43b8a4e40
commit
57aa5e908d
|
@ -97,8 +97,8 @@ int XETrapSimulateXEvent(register xXTrapInputReq *request,
|
|||
xEvent xev;
|
||||
register int x = request->input.x;
|
||||
register int y = request->input.y;
|
||||
DevicePtr keydev = LookupKeyboardDevice();
|
||||
DevicePtr ptrdev = LookupPointerDevice();
|
||||
DevicePtr keydev = (DevicePtr)PickKeyboard(client);
|
||||
DevicePtr ptrdev = (DevicePtr)PickPointer(client);
|
||||
|
||||
if (request->input.screen < screenInfo.numScreens)
|
||||
{
|
||||
|
|
|
@ -316,7 +316,7 @@ ProcXTestFakeInput(client)
|
|||
#ifdef XINPUT
|
||||
if (!extension)
|
||||
#endif /* XINPUT */
|
||||
dev = (DeviceIntPtr)LookupKeyboardDevice();
|
||||
dev = PickKeyboard(client);
|
||||
if (ev->u.u.detail < dev->key->curKeySyms.minKeyCode ||
|
||||
ev->u.u.detail > dev->key->curKeySyms.maxKeyCode)
|
||||
{
|
||||
|
@ -361,7 +361,7 @@ ProcXTestFakeInput(client)
|
|||
}
|
||||
#endif /* XINPUT */
|
||||
if (!dev)
|
||||
dev = (DeviceIntPtr*)LookupPointerDevice();
|
||||
dev = PickPointer(client);
|
||||
if (ev->u.keyButtonPointer.root == None)
|
||||
root = GetCurrentRootWindow();
|
||||
else
|
||||
|
@ -451,7 +451,7 @@ ProcXTestFakeInput(client)
|
|||
#ifdef XINPUT
|
||||
if (!extension)
|
||||
#endif /* XINPUT */
|
||||
dev = (DeviceIntPtr*)LookupPointerDevice();
|
||||
dev = PickPointer(client);
|
||||
if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons)
|
||||
{
|
||||
client->errorValue = ev->u.u.detail;
|
||||
|
|
|
@ -140,7 +140,7 @@ ProcXGrabDeviceButton(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
mdev = PickKeyboard(client);
|
||||
|
||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ ProcXGrabDeviceKey(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
mdev = PickKeyboard(client);
|
||||
|
||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
mdev = PickKeyboard(client);
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
||||
if (rc != Success) {
|
||||
|
|
|
@ -132,7 +132,7 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
mdev = PickKeyboard(client);
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
||||
if (rc != Success) {
|
||||
|
|
|
@ -597,6 +597,8 @@ RemoveDevice(DeviceIntPtr dev)
|
|||
int
|
||||
NumMotionEvents()
|
||||
{
|
||||
/* only called to fill data in initial connection reply.
|
||||
* VCP is ok here, it is the only fixed device we have. */
|
||||
return inputInfo.pointer->valuator->numMotionEvents;
|
||||
}
|
||||
|
||||
|
@ -1376,6 +1378,7 @@ ProcSetPointerMapping(ClientPtr client)
|
|||
REQUEST(xSetPointerMappingReq);
|
||||
BYTE *map;
|
||||
int ret;
|
||||
DeviceIntPtr ptr = PickPointer(client);
|
||||
xSetPointerMappingReply rep;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq);
|
||||
|
@ -1389,14 +1392,18 @@ ProcSetPointerMapping(ClientPtr client)
|
|||
|
||||
/* So we're bounded here by the number of core buttons. This check
|
||||
* probably wants disabling through XFixes. */
|
||||
if (stuff->nElts != inputInfo.pointer->button->numButtons) {
|
||||
/* MPX: With ClientPointer, we can return the right number of buttons.
|
||||
* Let's just hope nobody changed ClientPointer between GetPointerMapping
|
||||
* and SetPointerMapping
|
||||
*/
|
||||
if (stuff->nElts != ptr->button->numButtons) {
|
||||
client->errorValue = stuff->nElts;
|
||||
return BadValue;
|
||||
}
|
||||
if (BadDeviceMap(&map[0], (int)stuff->nElts, 1, 255, &client->errorValue))
|
||||
return BadValue;
|
||||
|
||||
ret = DoSetPointerMapping(inputInfo.pointer, map, stuff->nElts);
|
||||
ret = DoSetPointerMapping(ptr, map, stuff->nElts);
|
||||
if (ret != Success) {
|
||||
rep.success = ret;
|
||||
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
|
||||
|
@ -1404,7 +1411,7 @@ ProcSetPointerMapping(ClientPtr client)
|
|||
}
|
||||
|
||||
/* FIXME: Send mapping notifies for all the extended devices as well. */
|
||||
SendMappingNotify(inputInfo.pointer, MappingPointer, 0, 0, client);
|
||||
SendMappingNotify(ptr, MappingPointer, 0, 0, client);
|
||||
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
@ -1414,7 +1421,8 @@ ProcGetKeyboardMapping(ClientPtr client)
|
|||
{
|
||||
xGetKeyboardMappingReply rep;
|
||||
REQUEST(xGetKeyboardMappingReq);
|
||||
KeySymsPtr curKeySyms = &inputInfo.keyboard->key->curKeySyms;
|
||||
DeviceIntPtr kbd = PickKeyboard(client);
|
||||
KeySymsPtr curKeySyms = &kbd->key->curKeySyms;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGetKeyboardMappingReq);
|
||||
|
||||
|
@ -1449,7 +1457,9 @@ int
|
|||
ProcGetPointerMapping(ClientPtr client)
|
||||
{
|
||||
xGetPointerMappingReply rep;
|
||||
ButtonClassPtr butc = inputInfo.pointer->button;
|
||||
/* Apps may get different values each time they call GetPointerMapping as
|
||||
* the ClientPointer could change. */
|
||||
ButtonClassPtr butc = PickPointer(client)->button;
|
||||
|
||||
REQUEST_SIZE_MATCH(xReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -1753,7 +1763,7 @@ ProcBell(ClientPtr client)
|
|||
int
|
||||
ProcChangePointerControl(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr mouse = inputInfo.pointer;
|
||||
DeviceIntPtr mouse = PickPointer(client);
|
||||
PtrCtrl ctrl; /* might get BadValue part way through */
|
||||
REQUEST(xChangePointerControlReq);
|
||||
|
||||
|
@ -1809,7 +1819,7 @@ ProcChangePointerControl(ClientPtr client)
|
|||
|
||||
|
||||
for (mouse = inputInfo.devices; mouse; mouse = mouse->next) {
|
||||
if ((mouse->coreEvents || mouse == inputInfo.pointer) &&
|
||||
if ((mouse->coreEvents || mouse == PickPointer(client)) &&
|
||||
mouse->ptrfeed && mouse->ptrfeed->CtrlProc) {
|
||||
mouse->ptrfeed->ctrl = ctrl;
|
||||
(*mouse->ptrfeed->CtrlProc)(mouse, &mouse->ptrfeed->ctrl);
|
||||
|
@ -1822,7 +1832,8 @@ ProcChangePointerControl(ClientPtr client)
|
|||
int
|
||||
ProcGetPointerControl(ClientPtr client)
|
||||
{
|
||||
register PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl;
|
||||
DeviceIntPtr ptr = PickPointer(client);
|
||||
PtrCtrl *ctrl = &ptr->ptrfeed->ctrl;
|
||||
xGetPointerControlReply rep;
|
||||
|
||||
REQUEST_SIZE_MATCH(xReq);
|
||||
|
@ -1860,7 +1871,7 @@ ProcGetMotionEvents(ClientPtr client)
|
|||
xGetMotionEventsReply rep;
|
||||
int i, count, xmin, xmax, ymin, ymax, rc;
|
||||
unsigned long nEvents;
|
||||
DeviceIntPtr mouse = inputInfo.pointer;
|
||||
DeviceIntPtr mouse = PickPointer(client);
|
||||
TimeStamp start, stop;
|
||||
REQUEST(xGetMotionEventsReq);
|
||||
|
||||
|
|
Loading…
Reference in New Issue