xace: add new hooks + access controls: XInput extension.
Introduces new dix API to lookup a device, dixLookupDevice(), which replaces LookupDeviceIntRec and LookupDevice.
This commit is contained in:
parent
27612748e0
commit
5c03d13181
|
@ -49,7 +49,6 @@ from The Open Group.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#define EXTENSION_EVENT_BASE 64
|
#define EXTENSION_EVENT_BASE 64
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#endif /* XINPUT */
|
#endif /* XINPUT */
|
||||||
|
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
@ -286,11 +285,12 @@ ProcXTestFakeInput(client)
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
if (extension)
|
if (extension)
|
||||||
{
|
{
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid & 0177);
|
rc = dixLookupDevice(&dev, stuff->deviceid & 0177, client,
|
||||||
if (!dev)
|
DixWriteAccess);
|
||||||
|
if (rc != Success)
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->deviceid & 0177;
|
client->errorValue = stuff->deviceid & 0177;
|
||||||
return BadValue;
|
return rc;
|
||||||
}
|
}
|
||||||
if (nev > 1)
|
if (nev > 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "allowev.h"
|
#include "allowev.h"
|
||||||
|
@ -95,13 +94,14 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
DeviceIntPtr thisdev;
|
DeviceIntPtr thisdev;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xAllowDeviceEventsReq);
|
REQUEST(xAllowDeviceEventsReq);
|
||||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||||
|
|
||||||
thisdev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (thisdev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
time = ClientTimeToServerTime(stuff->time);
|
time = ClientTimeToServerTime(stuff->time);
|
||||||
|
|
||||||
switch (stuff->mode) {
|
switch (stuff->mode) {
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h> /* control constants */
|
#include <X11/extensions/XIproto.h> /* control constants */
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
|
|
||||||
|
@ -112,11 +111,9 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||||
|
|
||||||
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
|
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL) {
|
if (ret != Success)
|
||||||
ret = BadDevice;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_ChangeDeviceControl;
|
rep.RepType = X_ChangeDeviceControl;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h> /* control constants */
|
#include <X11/extensions/XIproto.h> /* control constants */
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "chgfctl.h"
|
#include "chgfctl.h"
|
||||||
|
@ -444,14 +443,15 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
||||||
StringFeedbackPtr s;
|
StringFeedbackPtr s;
|
||||||
BellFeedbackPtr b;
|
BellFeedbackPtr b;
|
||||||
LedFeedbackPtr l;
|
LedFeedbackPtr l;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xChangeFeedbackControlReq);
|
REQUEST(xChangeFeedbackControlReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||||
|
|
||||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
switch (stuff->feedbackid) {
|
switch (stuff->feedbackid) {
|
||||||
case KbdFeedbackClass:
|
case KbdFeedbackClass:
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -107,9 +106,9 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||||
REQUEST(xChangeDeviceKeyMappingReq);
|
REQUEST(xChangeDeviceKeyMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
|
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
|
||||||
|
|
||||||
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
@ -115,7 +114,7 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||||
stuff->count)
|
stuff->count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include "scrnintstr.h" /* screen structure */
|
#include "scrnintstr.h" /* screen structure */
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
|
|
||||||
#include "dixevents.h"
|
#include "dixevents.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
|
@ -62,7 +62,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "closedev.h"
|
#include "closedev.h"
|
||||||
|
@ -140,16 +139,16 @@ DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXCloseDevice(ClientPtr client)
|
ProcXCloseDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
int i;
|
int rc, i;
|
||||||
WindowPtr pWin, p1;
|
WindowPtr pWin, p1;
|
||||||
DeviceIntPtr d;
|
DeviceIntPtr d;
|
||||||
|
|
||||||
REQUEST(xCloseDeviceReq);
|
REQUEST(xCloseDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
||||||
|
|
||||||
d = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&d, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (d == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
if (d->grab && SameClient(d->grab, client))
|
if (d->grab && SameClient(d->grab, client))
|
||||||
(*d->DeactivateGrab) (d); /* release active grab */
|
(*d->DeactivateGrab) (d); /* release active grab */
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "devbell.h"
|
#include "devbell.h"
|
||||||
|
@ -93,7 +92,7 @@ ProcXDeviceBell(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
KbdFeedbackPtr k;
|
KbdFeedbackPtr k;
|
||||||
BellFeedbackPtr b;
|
BellFeedbackPtr b;
|
||||||
int base;
|
int rc, base;
|
||||||
int newpercent;
|
int newpercent;
|
||||||
CARD8 class;
|
CARD8 class;
|
||||||
pointer ctrl;
|
pointer ctrl;
|
||||||
|
@ -102,10 +101,10 @@ ProcXDeviceBell(ClientPtr client)
|
||||||
REQUEST(xDeviceBellReq);
|
REQUEST(xDeviceBellReq);
|
||||||
REQUEST_SIZE_MATCH(xDeviceBellReq);
|
REQUEST_SIZE_MATCH(xDeviceBellReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess);
|
||||||
if (dev == NULL) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->deviceid;
|
client->errorValue = stuff->deviceid;
|
||||||
return BadDevice;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stuff->percent < -100 || stuff->percent > 100) {
|
if (stuff->percent < -100 || stuff->percent > 100) {
|
||||||
|
|
|
@ -67,11 +67,11 @@ SOFTWARE.
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixevents.h" /* DeliverFocusedEvent */
|
#include "dixevents.h" /* DeliverFocusedEvent */
|
||||||
#include "dixgrabs.h" /* CreateGrab() */
|
#include "dixgrabs.h" /* CreateGrab() */
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#ifdef XKB
|
#ifdef XKB
|
||||||
#include "xkbsrv.h"
|
#include "xkbsrv.h"
|
||||||
|
@ -511,6 +511,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
WindowPtr pWin, confineTo;
|
WindowPtr pWin, confineTo;
|
||||||
CursorPtr cursor;
|
CursorPtr cursor;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
|
Mask access_mode = DixGrabAccess;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if ((this_device_mode != GrabModeSync) &&
|
if ((this_device_mode != GrabModeSync) &&
|
||||||
|
@ -531,25 +532,33 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
client->errorValue = ownerEvents;
|
client->errorValue = ownerEvents;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (rconfineTo == None)
|
if (rconfineTo == None)
|
||||||
confineTo = NullWindow;
|
confineTo = NullWindow;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupWindow(&confineTo, rconfineTo, client, DixUnknownAccess);
|
rc = dixLookupWindow(&confineTo, rconfineTo, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
if (rcursor == None)
|
if (rcursor == None)
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
cursor = (CursorPtr) LookupIDByType(rcursor, RT_CURSOR);
|
rc = dixLookupResource((pointer *)&cursor, rcursor, RT_CURSOR,
|
||||||
if (!cursor) {
|
client, DixUseAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
{
|
||||||
client->errorValue = rcursor;
|
client->errorValue = rcursor;
|
||||||
return BadCursor;
|
return (rc == BadValue) ? BadCursor : rc;
|
||||||
}
|
}
|
||||||
|
access_mode |= DixForceAccess;
|
||||||
}
|
}
|
||||||
|
if (this_device_mode == GrabModeSync || other_devices_mode == GrabModeSync)
|
||||||
|
access_mode |= DixFreezeAccess;
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
grab = CreateGrab(client->index, dev, pWin, eventMask,
|
grab = CreateGrab(client->index, dev, pWin, eventMask,
|
||||||
(Bool) ownerEvents, (Bool) this_device_mode,
|
(Bool) ownerEvents, (Bool) this_device_mode,
|
||||||
|
@ -569,6 +578,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
KeyClassPtr k = dev->key;
|
KeyClassPtr k = dev->key;
|
||||||
|
Mask access_mode = DixGrabAccess;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (k == NULL)
|
if (k == NULL)
|
||||||
|
@ -596,7 +606,12 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
client->errorValue = ownerEvents;
|
client->errorValue = ownerEvents;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, grabWindow, client, DixSetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
if (this_device_mode == GrabModeSync || other_devices_mode == GrabModeSync)
|
||||||
|
access_mode |= DixFreezeAccess;
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -837,7 +852,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
||||||
if (!mask)
|
if (!mask)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, ev, count))
|
||||||
(void)(DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, d->id));
|
(void)(DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, d->id));
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -1101,7 +1116,8 @@ MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(pEvents->deviceid & DEVICE_BITS);
|
dixLookupDevice(&dev, pEvents->deviceid & DEVICE_BITS, serverClient,
|
||||||
|
DixReadAccess);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1125,7 +1141,8 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(xE->deviceid & DEVICE_BITS);
|
dixLookupDevice(&dev, xE->deviceid & DEVICE_BITS, serverClient,
|
||||||
|
DixReadAccess);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
23
Xi/extinit.c
23
Xi/extinit.c
|
@ -856,29 +856,6 @@ MakeDeviceTypeAtoms(void)
|
||||||
MakeAtom(dev_type[i].name, strlen(dev_type[i].name), 1);
|
MakeAtom(dev_type[i].name, strlen(dev_type[i].name), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* Return a DeviceIntPtr corresponding to a specified device id.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
DeviceIntPtr
|
|
||||||
LookupDeviceIntRec(CARD8 id)
|
|
||||||
{
|
|
||||||
DeviceIntPtr dev;
|
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
|
||||||
if (dev->id == id)
|
|
||||||
return dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (dev = inputInfo.off_devices; dev; dev = dev->next) {
|
|
||||||
if (dev->id == id)
|
|
||||||
return dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* SEventIDispatch
|
* SEventIDispatch
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getbmap.h"
|
#include "getbmap.h"
|
||||||
|
@ -92,6 +91,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceButtonMappingReply rep;
|
xGetDeviceButtonMappingReply rep;
|
||||||
ButtonClassPtr b;
|
ButtonClassPtr b;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceButtonMappingReq);
|
REQUEST(xGetDeviceButtonMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
||||||
|
@ -102,9 +102,9 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
b = dev->button;
|
b = dev->button;
|
||||||
if (b == NULL)
|
if (b == NULL)
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getdctl.h"
|
#include "getdctl.h"
|
||||||
|
@ -238,7 +237,7 @@ SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
||||||
int
|
int
|
||||||
ProcXGetDeviceControl(ClientPtr client)
|
ProcXGetDeviceControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
int total_length = 0;
|
int rc, total_length = 0;
|
||||||
char *buf, *savbuf;
|
char *buf, *savbuf;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceControlReply rep;
|
xGetDeviceControlReply rep;
|
||||||
|
@ -246,9 +245,9 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
REQUEST(xGetDeviceControlReq);
|
REQUEST(xGetDeviceControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_GetDeviceControl;
|
rep.RepType = X_GetDeviceControl;
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getfctl.h"
|
#include "getfctl.h"
|
||||||
|
@ -290,7 +289,7 @@ SRepXGetFeedbackControl(ClientPtr client, int size,
|
||||||
int
|
int
|
||||||
ProcXGetFeedbackControl(ClientPtr client)
|
ProcXGetFeedbackControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
int total_length = 0;
|
int rc, total_length = 0;
|
||||||
char *buf, *savbuf;
|
char *buf, *savbuf;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
KbdFeedbackPtr k;
|
KbdFeedbackPtr k;
|
||||||
|
@ -304,9 +303,9 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
REQUEST(xGetFeedbackControlReq);
|
REQUEST(xGetFeedbackControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_GetFeedbackControl;
|
rep.RepType = X_GetFeedbackControl;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getfocus.h"
|
#include "getfocus.h"
|
||||||
|
@ -93,12 +92,15 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
FocusClassPtr focus;
|
FocusClassPtr focus;
|
||||||
xGetDeviceFocusReply rep;
|
xGetDeviceFocusReply rep;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceFocusReq);
|
REQUEST(xGetDeviceFocusReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
|
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
|
||||||
if (dev == NULL || !dev->focus)
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
|
@ -94,13 +93,14 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
xGetDeviceKeyMappingReply rep;
|
xGetDeviceKeyMappingReply rep;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
KeySymsPtr k;
|
KeySymsPtr k;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceKeyMappingReq);
|
REQUEST(xGetDeviceKeyMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->key == NULL)
|
if (dev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
k = &dev->key->curKeySyms;
|
k = &dev->key->curKeySyms;
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h> /* Request macro */
|
#include <X11/extensions/XIproto.h> /* Request macro */
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getmmap.h"
|
#include "getmmap.h"
|
||||||
|
@ -94,13 +93,14 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceModifierMappingReply rep;
|
xGetDeviceModifierMappingReply rep;
|
||||||
KeyClassPtr kp;
|
KeyClassPtr kp;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceModifierMappingReq);
|
REQUEST(xGetDeviceModifierMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
kp = dev->key;
|
kp = dev->key;
|
||||||
if (kp == NULL)
|
if (kp == NULL)
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structs */
|
#include "windowstr.h" /* window structs */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
|
@ -112,7 +111,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.count = 0;
|
rep.count = 0;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window struct */
|
#include "windowstr.h" /* window struct */
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
|
@ -114,7 +113,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
rep.this_client_count = 0;
|
rep.this_client_count = 0;
|
||||||
rep.all_clients_count = 0;
|
rep.all_clients_count = 0;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getvers.h"
|
#include "getvers.h"
|
||||||
|
|
15
Xi/grabdev.c
15
Xi/grabdev.c
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixevents.h" /* GrabDevice */
|
#include "dixevents.h" /* GrabDevice */
|
||||||
|
|
||||||
|
@ -122,9 +121,9 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||||
stuff->event_count, tmp, dev,
|
stuff->event_count, tmp, dev,
|
||||||
|
@ -153,7 +152,7 @@ int
|
||||||
CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||||
struct tmask *mask, DeviceIntPtr dev, int req)
|
struct tmask *mask, DeviceIntPtr dev, int req)
|
||||||
{
|
{
|
||||||
int i, j;
|
int rc, i, j;
|
||||||
int device;
|
int device;
|
||||||
DeviceIntPtr tdev;
|
DeviceIntPtr tdev;
|
||||||
|
|
||||||
|
@ -167,8 +166,10 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||||
if (device > 255)
|
if (device > 255)
|
||||||
return BadClass;
|
return BadClass;
|
||||||
|
|
||||||
tdev = LookupDeviceIntRec(device);
|
rc = dixLookupDevice(&tdev, device, client, DixReadAccess);
|
||||||
if (tdev == NULL || (dev != NULL && tdev != dev))
|
if (rc != BadDevice && rc != Success)
|
||||||
|
return rc;
|
||||||
|
if (rc == BadDevice || (dev != NULL && tdev != dev))
|
||||||
return BadClass;
|
return BadClass;
|
||||||
|
|
||||||
for (j = 0; j < ExtEventIndex; j++)
|
for (j = 0; j < ExtEventIndex; j++)
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
|
@ -117,14 +116,15 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count)
|
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
return BadDevice;
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
|
@ -115,14 +114,15 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
|
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
return BadDevice;
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -96,7 +95,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
INT32 *coords = NULL, *bufptr;
|
INT32 *coords = NULL, *bufptr;
|
||||||
xGetDeviceMotionEventsReply rep;
|
xGetDeviceMotionEventsReply rep;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
int num_events, axes, size = 0, tsize;
|
int rc, num_events, axes, size = 0, tsize;
|
||||||
unsigned long nEvents;
|
unsigned long nEvents;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
TimeStamp start, stop;
|
TimeStamp start, stop;
|
||||||
|
@ -106,9 +105,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
REQUEST(xGetDeviceMotionEventsReq);
|
REQUEST(xGetDeviceMotionEventsReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
v = dev->valuator;
|
v = dev->valuator;
|
||||||
if (v == NULL || v->numAxes == 0)
|
if (v == NULL || v->numAxes == 0)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
10
Xi/listdev.c
10
Xi/listdev.c
|
@ -63,8 +63,8 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h" /* FIXME */
|
#include "exglobals.h" /* FIXME */
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#include "listdev.h"
|
#include "listdev.h"
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
xListInputDevicesReply rep;
|
xListInputDevicesReply rep;
|
||||||
int numdevs = 0;
|
int numdevs = 0;
|
||||||
int namesize = 1; /* need 1 extra byte for strcpy */
|
int namesize = 1; /* need 1 extra byte for strcpy */
|
||||||
int size = 0;
|
int rc, size = 0;
|
||||||
int total_length;
|
int total_length;
|
||||||
char *devbuf;
|
char *devbuf;
|
||||||
char *classbuf;
|
char *classbuf;
|
||||||
|
@ -329,10 +329,16 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
AddOtherInputDevices();
|
AddOtherInputDevices();
|
||||||
|
|
||||||
for (d = inputInfo.devices; d; d = d->next) {
|
for (d = inputInfo.devices; d; d = d->next) {
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
SizeDeviceInfo(d, &namesize, &size);
|
SizeDeviceInfo(d, &namesize, &size);
|
||||||
numdevs++;
|
numdevs++;
|
||||||
}
|
}
|
||||||
for (d = inputInfo.off_devices; d; d = d->next) {
|
for (d = inputInfo.off_devices; d; d = d->next) {
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
SizeDeviceInfo(d, &namesize, &size);
|
SizeDeviceInfo(d, &namesize, &size);
|
||||||
numdevs++;
|
numdevs++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "opendev.h"
|
#include "opendev.h"
|
||||||
|
@ -107,13 +106,15 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
stuff->deviceid == inputInfo.keyboard->id)
|
stuff->deviceid == inputInfo.keyboard->id)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) { /* not open */
|
status = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
|
if (status == BadDevice) { /* not open */
|
||||||
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
||||||
if (dev->id == stuff->deviceid)
|
if (dev->id == stuff->deviceid)
|
||||||
break;
|
break;
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
}
|
} else if (status != Success)
|
||||||
|
return status;
|
||||||
|
|
||||||
OpenInputDevice(dev, client, &status);
|
OpenInputDevice(dev, client, &status);
|
||||||
if (status != Success)
|
if (status != Success)
|
||||||
|
|
|
@ -42,7 +42,6 @@ from The Open Group.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ int
|
||||||
ProcXQueryDeviceState(ClientPtr client)
|
ProcXQueryDeviceState(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
int i;
|
int rc, i;
|
||||||
int num_classes = 0;
|
int num_classes = 0;
|
||||||
int total_length = 0;
|
int total_length = 0;
|
||||||
char *buf, *savbuf;
|
char *buf, *savbuf;
|
||||||
|
@ -96,9 +95,9 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
v = dev->valuator;
|
v = dev->valuator;
|
||||||
if (v != NULL && v->motionHintWindow != NULL)
|
if (v != NULL && v->motionHintWindow != NULL)
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -164,7 +163,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
||||||
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count)
|
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
ret = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* Window */
|
#include "windowstr.h" /* Window */
|
||||||
|
#include "extnsionst.h" /* EventSwapPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -131,9 +131,9 @@ ProcXSendExtensionEvent(ClientPtr client)
|
||||||
(stuff->num_events * (sizeof(xEvent) >> 2)))
|
(stuff->num_events * (sizeof(xEvent) >> 2)))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
/* The client's event type must be one defined by an extension. */
|
/* The client's event type must be one defined by an extension. */
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setbmap.h"
|
#include "setbmap.h"
|
||||||
|
@ -110,9 +109,9 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.status = MappingSuccess;
|
rep.status = MappingSuccess;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
|
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setdval.h"
|
#include "setdval.h"
|
||||||
|
@ -92,6 +91,7 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xSetDeviceValuatorsReply rep;
|
xSetDeviceValuatorsReply rep;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceValuatorsReq);
|
REQUEST(xSetDeviceValuatorsReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
||||||
|
@ -106,9 +106,9 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
stuff->num_valuators)
|
stuff->num_valuators)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->valuator == NULL)
|
if (dev->valuator == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dixevents.h"
|
#include "dixevents.h"
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setfocus.h"
|
#include "setfocus.h"
|
||||||
|
@ -102,8 +101,10 @@ ProcXSetDeviceFocus(ClientPtr client)
|
||||||
REQUEST(xSetDeviceFocusReq);
|
REQUEST(xSetDeviceFocusReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->device);
|
ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess);
|
||||||
if (dev == NULL || !dev->focus)
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo,
|
ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo,
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setmmap.h"
|
#include "setmmap.h"
|
||||||
|
@ -99,9 +98,9 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
REQUEST(xSetDeviceModifierMappingReq);
|
REQUEST(xSetDeviceModifierMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_SetDeviceModifierMapping;
|
rep.RepType = X_SetDeviceModifierMapping;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setmode.h"
|
#include "setmode.h"
|
||||||
|
@ -92,6 +91,7 @@ ProcXSetDeviceMode(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xSetDeviceModeReply rep;
|
xSetDeviceModeReply rep;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceModeReq);
|
REQUEST(xSetDeviceModeReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
||||||
|
@ -101,9 +101,9 @@ ProcXSetDeviceMode(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->valuator == NULL)
|
if (dev->valuator == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
if ((dev->grab) && !SameClient(dev->grab, client))
|
if ((dev->grab) && !SameClient(dev->grab, client))
|
||||||
|
|
|
@ -65,6 +65,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -153,6 +154,7 @@ AddOtherInputDevices(void)
|
||||||
void
|
void
|
||||||
OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
||||||
{
|
{
|
||||||
|
*status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "ungrdev.h"
|
#include "ungrdev.h"
|
||||||
|
@ -94,13 +93,14 @@ ProcXUngrabDevice(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xUngrabDeviceReq);
|
REQUEST(xUngrabDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
grab = dev->grab;
|
grab = dev->grab;
|
||||||
|
|
||||||
time = ClientTimeToServerTime(stuff->time);
|
time = ClientTimeToServerTime(stuff->time);
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixgrabs.h"
|
#include "dixgrabs.h"
|
||||||
|
|
||||||
|
@ -107,22 +106,23 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
||||||
REQUEST(xUngrabDeviceButtonReq);
|
REQUEST(xUngrabDeviceButtonReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->button == NULL)
|
if (dev->button == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixgrabs.h"
|
#include "dixgrabs.h"
|
||||||
|
|
||||||
|
@ -107,22 +106,23 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
||||||
REQUEST(xUngrabDeviceKeyReq);
|
REQUEST(xUngrabDeviceKeyReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->key == NULL)
|
if (dev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
|
||||||
MALFORMED_MESSAGE_ERROR();
|
MALFORMED_MESSAGE_ERROR();
|
||||||
}
|
}
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(deviceid);
|
dixLookupDevice(&dev, deviceid, serverClient, DixUnknownAccess);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
DebugF("[config/dbus] bogus device id %d given\n", deviceid);
|
DebugF("[config/dbus] bogus device id %d given\n", deviceid);
|
||||||
ret = BadMatch;
|
ret = BadMatch;
|
||||||
|
|
|
@ -717,20 +717,28 @@ LookupPointerDevice(void)
|
||||||
return inputInfo.pointer ? &inputInfo.pointer->public : NULL;
|
return inputInfo.pointer ? &inputInfo.pointer->public : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DevicePtr
|
int
|
||||||
LookupDevice(int id)
|
dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
int rc;
|
||||||
|
*pDev = NULL;
|
||||||
|
|
||||||
for (dev=inputInfo.devices; dev; dev=dev->next) {
|
for (dev=inputInfo.devices; dev; dev=dev->next) {
|
||||||
if (dev->id == (CARD8)id)
|
if (dev->id == (CARD8)id)
|
||||||
return (DevicePtr)dev;
|
goto found;
|
||||||
}
|
}
|
||||||
for (dev=inputInfo.off_devices; dev; dev=dev->next) {
|
for (dev=inputInfo.off_devices; dev; dev=dev->next) {
|
||||||
if (dev->id == (CARD8)id)
|
if (dev->id == (CARD8)id)
|
||||||
return (DevicePtr)dev;
|
goto found;
|
||||||
}
|
}
|
||||||
return NULL;
|
return BadDevice;
|
||||||
|
|
||||||
|
found:
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
|
if (rc == Success)
|
||||||
|
*pDev = dev;
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -82,7 +82,6 @@
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#define EXTENSION_PROC_ARGS void *
|
#define EXTENSION_PROC_ARGS void *
|
||||||
#include "extinit.h" /* For LookupDeviceIntRec */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DMX_EQ_DEBUG
|
#if DMX_EQ_DEBUG
|
||||||
|
@ -217,8 +216,9 @@ static void dmxeqProcessXInputEvent(xEvent *xe, EventRec *e)
|
||||||
{
|
{
|
||||||
deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)xe;
|
deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)xe;
|
||||||
int id = ev->deviceid & DEVICE_BITS;
|
int id = ev->deviceid & DEVICE_BITS;
|
||||||
DeviceIntPtr pDevice = LookupDeviceIntRec(id);
|
DeviceIntPtr pDevice;
|
||||||
|
|
||||||
|
dixLookupDevice(&pDevice, id, serverClient, DixUnknownAccess);
|
||||||
if (!pDevice) {
|
if (!pDevice) {
|
||||||
dmxLog(dmxError, "dmxeqProcessInputEvents: id %d not found\n", id);
|
dmxLog(dmxError, "dmxeqProcessInputEvents: id %d not found\n", id);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -77,7 +77,6 @@
|
||||||
|
|
||||||
#define EXTENSION_PROC_ARGS void *
|
#define EXTENSION_PROC_ARGS void *
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
|
|
||||||
#include "windowstr.h" /* screenIsSaved */
|
#include "windowstr.h" /* screenIsSaved */
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,4 @@ AssignTypeAndName (
|
||||||
char * /* name */
|
char * /* name */
|
||||||
);
|
);
|
||||||
|
|
||||||
DeviceIntPtr
|
|
||||||
LookupDeviceIntRec (
|
|
||||||
CARD8 /* id */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* EXTINIT_H */
|
#endif /* EXTINIT_H */
|
||||||
|
|
|
@ -201,8 +201,11 @@ extern DevicePtr LookupKeyboardDevice(void);
|
||||||
|
|
||||||
extern DevicePtr LookupPointerDevice(void);
|
extern DevicePtr LookupPointerDevice(void);
|
||||||
|
|
||||||
extern DevicePtr LookupDevice(
|
extern int dixLookupDevice(
|
||||||
int /* id */);
|
DeviceIntPtr * /* dev */,
|
||||||
|
int /* id */,
|
||||||
|
ClientPtr /* client */,
|
||||||
|
Mask /* access_mode */);
|
||||||
|
|
||||||
extern void QueryMinMaxKeyCodes(
|
extern void QueryMinMaxKeyCodes(
|
||||||
KeyCode* /*minCode*/,
|
KeyCode* /*minCode*/,
|
||||||
|
@ -436,9 +439,6 @@ extern int GetMotionHistory(
|
||||||
extern void SwitchCoreKeyboard(DeviceIntPtr pDev);
|
extern void SwitchCoreKeyboard(DeviceIntPtr pDev);
|
||||||
extern void SwitchCorePointer(DeviceIntPtr pDev);
|
extern void SwitchCorePointer(DeviceIntPtr pDev);
|
||||||
|
|
||||||
extern DeviceIntPtr LookupDeviceIntRec(
|
|
||||||
CARD8 deviceid);
|
|
||||||
|
|
||||||
/* Implemented by the DDX. */
|
/* Implemented by the DDX. */
|
||||||
extern int NewInputDeviceRequest(
|
extern int NewInputDeviceRequest(
|
||||||
InputOption *options,
|
InputOption *options,
|
||||||
|
|
|
@ -65,7 +65,7 @@ DeviceIntPtr dev = NULL;
|
||||||
if (id&(~0xff))
|
if (id&(~0xff))
|
||||||
dev = NULL;
|
dev = NULL;
|
||||||
|
|
||||||
dev= (DeviceIntPtr)LookupDevice(id);
|
dixLookupDevice(&dev, id, serverClient, DixUnknownAccess);
|
||||||
if (dev!=NULL)
|
if (dev!=NULL)
|
||||||
return dev;
|
return dev;
|
||||||
if ((!dev)&&(why_rtrn))
|
if ((!dev)&&(why_rtrn))
|
||||||
|
|
Loading…
Reference in New Issue