xace: add hooks + new access codes: XKB extension.
Removes "LookupKeyboardDevice" and "LookupPointerDevice" in favor of inputInfo.keyboard and inputInfo.pointer, respectively; all use cases are non-XI compliant anyway.
This commit is contained in:
parent
5c03d13181
commit
8b54865720
|
@ -52,7 +52,7 @@ SOFTWARE.
|
||||||
#define NEED_REPLIES
|
#define NEED_REPLIES
|
||||||
#define NEED_EVENTS
|
#define NEED_EVENTS
|
||||||
#include <X11/X.h> /* From library include environment */
|
#include <X11/X.h> /* From library include environment */
|
||||||
#include "input.h" /* From server include env. (must be before Xlib.h!) */
|
#include "inputstr.h" /* From server include env. (must be before Xlib.h!) */
|
||||||
#ifdef PC
|
#ifdef PC
|
||||||
# include "scrintst.h" /* Screen struct */
|
# include "scrintst.h" /* Screen struct */
|
||||||
# include "extnsist.h"
|
# include "extnsist.h"
|
||||||
|
@ -96,8 +96,8 @@ int XETrapSimulateXEvent(register xXTrapInputReq *request,
|
||||||
xEvent xev;
|
xEvent xev;
|
||||||
register int x = request->input.x;
|
register int x = request->input.x;
|
||||||
register int y = request->input.y;
|
register int y = request->input.y;
|
||||||
DevicePtr keydev = LookupKeyboardDevice();
|
DevicePtr keydev = (DevicePtr)inputInfo.keyboard;
|
||||||
DevicePtr ptrdev = LookupPointerDevice();
|
DevicePtr ptrdev = (DevicePtr)inputInfo.pointer;
|
||||||
|
|
||||||
if (request->input.screen < screenInfo.numScreens)
|
if (request->input.screen < screenInfo.numScreens)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/Xos.h>
|
#include <X11/Xos.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include "input.h" /* Server DevicePtr definitions */
|
#include "inputstr.h" /* Server DevicePtr definitions */
|
||||||
#include "misc.h" /* Server swapping macros */
|
#include "misc.h" /* Server swapping macros */
|
||||||
#include "dixstruct.h" /* Server ClientRec definitions */
|
#include "dixstruct.h" /* Server ClientRec definitions */
|
||||||
#include "resource.h" /* Used with the MakeAtom call */
|
#include "resource.h" /* Used with the MakeAtom call */
|
||||||
|
@ -277,7 +277,7 @@ Bool XETrapRedirectDevices()
|
||||||
/* Do we need to redirect the keyboard device? */
|
/* Do we need to redirect the keyboard device? */
|
||||||
if (XETrapKbdDev == NULL)
|
if (XETrapKbdDev == NULL)
|
||||||
{
|
{
|
||||||
if ((XETrapKbdDev = LookupKeyboardDevice()) == NULL)
|
if ((XETrapKbdDev = (DevicePtr)inputInfo.keyboard) == NULL)
|
||||||
{
|
{
|
||||||
retval = False;
|
retval = False;
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ Bool XETrapRedirectDevices()
|
||||||
#ifndef VECTORED_EVENTS
|
#ifndef VECTORED_EVENTS
|
||||||
if (XETrapPtrDev == NULL)
|
if (XETrapPtrDev == NULL)
|
||||||
{
|
{
|
||||||
if ((XETrapPtrDev = LookupPointerDevice()) == 0L)
|
if ((XETrapPtrDev = (DevicePtr)inputInfo.pointer) == 0L)
|
||||||
{
|
{
|
||||||
retval = False;
|
retval = False;
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,7 @@ ProcXTestFakeInput(client)
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
if (!extension)
|
if (!extension)
|
||||||
#endif /* XINPUT */
|
#endif /* XINPUT */
|
||||||
dev = (DeviceIntPtr)LookupKeyboardDevice();
|
dev = inputInfo.keyboard;
|
||||||
if (ev->u.u.detail < dev->key->curKeySyms.minKeyCode ||
|
if (ev->u.u.detail < dev->key->curKeySyms.minKeyCode ||
|
||||||
ev->u.u.detail > dev->key->curKeySyms.maxKeyCode)
|
ev->u.u.detail > dev->key->curKeySyms.maxKeyCode)
|
||||||
{
|
{
|
||||||
|
@ -360,7 +360,7 @@ ProcXTestFakeInput(client)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif /* XINPUT */
|
#endif /* XINPUT */
|
||||||
dev = (DeviceIntPtr)LookupPointerDevice();
|
dev = inputInfo.pointer;
|
||||||
if (ev->u.keyButtonPointer.root == None)
|
if (ev->u.keyButtonPointer.root == None)
|
||||||
root = GetCurrentRootWindow();
|
root = GetCurrentRootWindow();
|
||||||
else
|
else
|
||||||
|
@ -449,7 +449,7 @@ ProcXTestFakeInput(client)
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
if (!extension)
|
if (!extension)
|
||||||
#endif /* XINPUT */
|
#endif /* XINPUT */
|
||||||
dev = (DeviceIntPtr)LookupPointerDevice();
|
dev = inputInfo.pointer;
|
||||||
if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons)
|
if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons)
|
||||||
{
|
{
|
||||||
client->errorValue = ev->u.u.detail;
|
client->errorValue = ev->u.u.detail;
|
||||||
|
|
|
@ -62,6 +62,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevb.h"
|
#include "grabdevb.h"
|
||||||
|
@ -127,8 +128,12 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
return ret;
|
return ret;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else {
|
||||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
mdev = inputInfo.keyboard;
|
||||||
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
|
||||||
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevk.h"
|
#include "grabdevk.h"
|
||||||
|
@ -125,8 +126,12 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
return ret;
|
return ret;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else {
|
||||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
mdev = inputInfo.keyboard;
|
||||||
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
|
||||||
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
mdev = inputInfo.keyboard;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
@ -120,7 +120,7 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
mdev = inputInfo.keyboard;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
@ -705,18 +705,6 @@ RegisterKeyboardDevice(DeviceIntPtr device)
|
||||||
RegisterOtherDevice(device);
|
RegisterOtherDevice(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT DevicePtr
|
|
||||||
LookupKeyboardDevice(void)
|
|
||||||
{
|
|
||||||
return inputInfo.keyboard ? &inputInfo.keyboard->public : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
_X_EXPORT DevicePtr
|
|
||||||
LookupPointerDevice(void)
|
|
||||||
{
|
|
||||||
return inputInfo.pointer ? &inputInfo.pointer->public : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode)
|
dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -691,7 +691,7 @@ ephyrUpdateModifierState(unsigned int state)
|
||||||
int i;
|
int i;
|
||||||
CARD8 mask;
|
CARD8 mask;
|
||||||
|
|
||||||
pkeydev = (DeviceIntPtr)LookupKeyboardDevice();
|
pkeydev = inputInfo.keyboard;
|
||||||
|
|
||||||
if (!pkeydev)
|
if (!pkeydev)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -232,7 +232,7 @@ VxWorksKeyboardRead (int fd)
|
||||||
void
|
void
|
||||||
VxWorksKeyboardLeds (int leds)
|
VxWorksKeyboardLeds (int leds)
|
||||||
{
|
{
|
||||||
DeviceIntPtr pKeyboard = (DeviceIntPtr) LookupKeyboardDevice ();
|
DeviceIntPtr pKeyboard = inputInfo.keyboard;
|
||||||
KeyboardCtrl *ctrl = &pKeyboard->kbdfeed->ctrl;
|
KeyboardCtrl *ctrl = &pKeyboard->kbdfeed->ctrl;
|
||||||
led_ioctl_info led_info;
|
led_ioctl_info led_info;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -139,8 +139,6 @@ _X_HIDDEN void *dixLookupTab[] = {
|
||||||
SYMFUNC(InitKeyboardDeviceStruct)
|
SYMFUNC(InitKeyboardDeviceStruct)
|
||||||
SYMFUNC(SendMappingNotify)
|
SYMFUNC(SendMappingNotify)
|
||||||
SYMFUNC(InitPointerDeviceStruct)
|
SYMFUNC(InitPointerDeviceStruct)
|
||||||
SYMFUNC(LookupKeyboardDevice)
|
|
||||||
SYMFUNC(LookupPointerDevice)
|
|
||||||
/* dispatch.c */
|
/* dispatch.c */
|
||||||
SYMFUNC(SetInputCheck)
|
SYMFUNC(SetInputCheck)
|
||||||
SYMFUNC(SendErrorToClient)
|
SYMFUNC(SendErrorToClient)
|
||||||
|
|
|
@ -439,7 +439,7 @@ KdKeybdProc(DeviceIntPtr pDevice, int onoff)
|
||||||
switch (onoff)
|
switch (onoff)
|
||||||
{
|
{
|
||||||
case DEVICE_INIT:
|
case DEVICE_INIT:
|
||||||
if (pDev != LookupKeyboardDevice())
|
if (pDev != (DevicePtr)inputInfo.keyboard)
|
||||||
{
|
{
|
||||||
return !Success;
|
return !Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1100,7 +1100,7 @@ xglxKeybdProc (DeviceIntPtr pDevice,
|
||||||
int xkbOp, xkbEvent, xkbError, xkbMajor, xkbMinor;
|
int xkbOp, xkbEvent, xkbError, xkbMajor, xkbMinor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pDev != LookupKeyboardDevice ())
|
if (pDev != (DevicePtr)inputInfo.keyboard)
|
||||||
return !Success;
|
return !Success;
|
||||||
|
|
||||||
xmodMap = XGetModifierMapping (xdisplay);
|
xmodMap = XGetModifierMapping (xdisplay);
|
||||||
|
|
|
@ -224,7 +224,7 @@ xglKeybdProc (DeviceIntPtr pDevice,
|
||||||
|
|
||||||
switch (onoff) {
|
switch (onoff) {
|
||||||
case DEVICE_INIT:
|
case DEVICE_INIT:
|
||||||
if (pDev != LookupKeyboardDevice ())
|
if (pDev != (DevicePtr)inputInfo.keyboard)
|
||||||
return !Success;
|
return !Success;
|
||||||
|
|
||||||
ret = InitKeyboardDeviceStruct (pDev,
|
ret = InitKeyboardDeviceStruct (pDev,
|
||||||
|
|
|
@ -197,10 +197,6 @@ extern void RegisterPointerDevice(
|
||||||
extern void RegisterKeyboardDevice(
|
extern void RegisterKeyboardDevice(
|
||||||
DeviceIntPtr /*device*/);
|
DeviceIntPtr /*device*/);
|
||||||
|
|
||||||
extern DevicePtr LookupKeyboardDevice(void);
|
|
||||||
|
|
||||||
extern DevicePtr LookupPointerDevice(void);
|
|
||||||
|
|
||||||
extern int dixLookupDevice(
|
extern int dixLookupDevice(
|
||||||
DeviceIntPtr * /* dev */,
|
DeviceIntPtr * /* dev */,
|
||||||
int /* id */,
|
int /* id */,
|
||||||
|
|
|
@ -262,6 +262,7 @@ typedef struct
|
||||||
extern int XkbReqCode;
|
extern int XkbReqCode;
|
||||||
extern int XkbEventBase;
|
extern int XkbEventBase;
|
||||||
extern int XkbDisableLockActions;
|
extern int XkbDisableLockActions;
|
||||||
|
extern int XkbKeyboardErrorCode;
|
||||||
extern char * XkbBaseDirectory;
|
extern char * XkbBaseDirectory;
|
||||||
extern char * XkbBinDirectory;
|
extern char * XkbBinDirectory;
|
||||||
extern char * XkbInitialMap;
|
extern char * XkbInitialMap;
|
||||||
|
@ -352,29 +353,44 @@ extern void XkbFreeNames(
|
||||||
Bool /* freeMap */
|
Bool /* freeMap */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DeviceIntPtr _XkbLookupAnyDevice(
|
extern int _XkbLookupAnyDevice(
|
||||||
int /* id */,
|
DeviceIntPtr *pDev,
|
||||||
int * /* why_rtrn */
|
int id,
|
||||||
|
ClientPtr client,
|
||||||
|
Mask access_mode,
|
||||||
|
int *xkb_err
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DeviceIntPtr _XkbLookupKeyboard(
|
extern int _XkbLookupKeyboard(
|
||||||
int /* id */,
|
DeviceIntPtr *pDev,
|
||||||
int * /* why_rtrn */
|
int id,
|
||||||
|
ClientPtr client,
|
||||||
|
Mask access_mode,
|
||||||
|
int *xkb_err
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DeviceIntPtr _XkbLookupBellDevice(
|
extern int _XkbLookupBellDevice(
|
||||||
int /* id */,
|
DeviceIntPtr *pDev,
|
||||||
int * /* why_rtrn */
|
int id,
|
||||||
|
ClientPtr client,
|
||||||
|
Mask access_mode,
|
||||||
|
int *xkb_err
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DeviceIntPtr _XkbLookupLedDevice(
|
extern int _XkbLookupLedDevice(
|
||||||
int /* id */,
|
DeviceIntPtr *pDev,
|
||||||
int * /* why_rtrn */
|
int id,
|
||||||
|
ClientPtr client,
|
||||||
|
Mask access_mode,
|
||||||
|
int *xkb_err
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DeviceIntPtr _XkbLookupButtonDevice(
|
extern int _XkbLookupButtonDevice(
|
||||||
int /* id */,
|
DeviceIntPtr *pDev,
|
||||||
int * /* why_rtrn */
|
int id,
|
||||||
|
ClientPtr client,
|
||||||
|
Mask access_mode,
|
||||||
|
int *xkb_err
|
||||||
);
|
);
|
||||||
|
|
||||||
extern XkbDescPtr XkbAllocKeyboard(
|
extern XkbDescPtr XkbAllocKeyboard(
|
||||||
|
|
|
@ -53,7 +53,7 @@ deviceValuator * val;
|
||||||
int x,y;
|
int x,y;
|
||||||
int nAxes, i, count;
|
int nAxes, i, count;
|
||||||
|
|
||||||
if ((dev==(DeviceIntPtr)LookupPointerDevice())||(!dev->public.on))
|
if (dev == inputInfo.pointer || !dev->public.on)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nAxes = (dev->valuator?dev->valuator->numAxes:0);
|
nAxes = (dev->valuator?dev->valuator->numAxes:0);
|
||||||
|
|
|
@ -46,7 +46,7 @@ xEvent ev;
|
||||||
int x,y;
|
int x,y;
|
||||||
DevicePtr ptr;
|
DevicePtr ptr;
|
||||||
|
|
||||||
if ((ptr = LookupPointerDevice())==NULL)
|
if ((ptr = (DevicePtr)inputInfo.pointer)==NULL)
|
||||||
return;
|
return;
|
||||||
GetSpritePosition(&x,&y);
|
GetSpritePosition(&x,&y);
|
||||||
ev.u.u.type = event;
|
ev.u.u.type = event;
|
||||||
|
|
101
xkb/xkb.c
101
xkb/xkb.c
|
@ -38,6 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#define XKBSRV_NEED_FILE_FUNCS
|
#define XKBSRV_NEED_FILE_FUNCS
|
||||||
#include <xkbsrv.h>
|
#include <xkbsrv.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
|
#include "xace.h"
|
||||||
#include "xkb.h"
|
#include "xkb.h"
|
||||||
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
|
@ -45,7 +46,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
int XkbEventBase;
|
int XkbEventBase;
|
||||||
static int XkbErrorBase;
|
static int XkbErrorBase;
|
||||||
int XkbReqCode;
|
int XkbReqCode;
|
||||||
static int XkbKeyboardErrorCode;
|
int XkbKeyboardErrorCode;
|
||||||
CARD32 xkbDebugFlags = 0;
|
CARD32 xkbDebugFlags = 0;
|
||||||
static CARD32 xkbDebugCtrls = 0;
|
static CARD32 xkbDebugCtrls = 0;
|
||||||
|
|
||||||
|
@ -53,19 +54,23 @@ static RESTYPE RT_XKBCLIENT;
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
#define CHK_DEVICE(d,sp,lf) {\
|
#define CHK_DEVICE(dev, id, client, access_mode, lf) {\
|
||||||
int why;\
|
int why;\
|
||||||
d = (DeviceIntPtr)lf((sp),&why);\
|
int rc = lf(&(dev), id, client, access_mode, &why);\
|
||||||
if (!dev) {\
|
if (rc != Success) {\
|
||||||
client->errorValue = _XkbErrCode2(why,(sp));\
|
client->errorValue = _XkbErrCode2(why, id);\
|
||||||
return XkbKeyboardErrorCode;\
|
return rc;\
|
||||||
}\
|
}\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHK_KBD_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupKeyboard)
|
#define CHK_KBD_DEVICE(dev, id, client, mode) \
|
||||||
#define CHK_LED_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupLedDevice)
|
CHK_DEVICE(dev, id, client, mode, _XkbLookupKeyboard)
|
||||||
#define CHK_BELL_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupBellDevice)
|
#define CHK_LED_DEVICE(dev, id, client, mode) \
|
||||||
#define CHK_ANY_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupAnyDevice)
|
CHK_DEVICE(dev, id, client, mode, _XkbLookupLedDevice)
|
||||||
|
#define CHK_BELL_DEVICE(dev, id, client, mode) \
|
||||||
|
CHK_DEVICE(dev, id, client, mode, _XkbLookupBellDevice)
|
||||||
|
#define CHK_ANY_DEVICE(dev, id, client, mode) \
|
||||||
|
CHK_DEVICE(dev, id, client, mode, _XkbLookupAnyDevice)
|
||||||
|
|
||||||
#define CHK_ATOM_ONLY2(a,ev,er) {\
|
#define CHK_ATOM_ONLY2(a,ev,er) {\
|
||||||
if (((a)==None)||(!ValidAtom((a)))) {\
|
if (((a)==None)||(!ValidAtom((a)))) {\
|
||||||
|
@ -206,7 +211,7 @@ ProcXkbSelectEvents(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_ANY_DEVICE(dev,stuff->deviceSpec);
|
CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess);
|
||||||
|
|
||||||
if (((stuff->affectWhich&XkbMapNotifyMask)!=0)&&(stuff->affectMap)) {
|
if (((stuff->affectWhich&XkbMapNotifyMask)!=0)&&(stuff->affectMap)) {
|
||||||
client->mapNotifyMask&= ~stuff->affectMap;
|
client->mapNotifyMask&= ~stuff->affectMap;
|
||||||
|
@ -351,7 +356,7 @@ ProcXkbBell(ClientPtr client)
|
||||||
REQUEST(xkbBellReq);
|
REQUEST(xkbBellReq);
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
int base;
|
int rc, base;
|
||||||
int newPercent,oldPitch,oldDuration;
|
int newPercent,oldPitch,oldDuration;
|
||||||
pointer ctrl;
|
pointer ctrl;
|
||||||
|
|
||||||
|
@ -360,7 +365,7 @@ ProcXkbBell(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_BELL_DEVICE(dev,stuff->deviceSpec);
|
CHK_BELL_DEVICE(dev, stuff->deviceSpec, client, DixBellAccess);
|
||||||
CHK_ATOM_OR_NONE(stuff->name);
|
CHK_ATOM_OR_NONE(stuff->name);
|
||||||
|
|
||||||
if ((stuff->forceSound)&&(stuff->eventOnly)) {
|
if ((stuff->forceSound)&&(stuff->eventOnly)) {
|
||||||
|
@ -448,10 +453,10 @@ ProcXkbBell(ClientPtr client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
if (stuff->window!=None) {
|
if (stuff->window!=None) {
|
||||||
pWin= (WindowPtr)LookupIDByType(stuff->window,RT_WINDOW);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (pWin==NULL) {
|
if (rc != Success) {
|
||||||
client->errorValue= stuff->window;
|
client->errorValue= stuff->window;
|
||||||
return BadValue;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else pWin= NULL;
|
else pWin= NULL;
|
||||||
|
@ -499,7 +504,7 @@ ProcXkbGetState(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess);
|
||||||
|
|
||||||
xkb= &dev->key->xkbInfo->state;
|
xkb= &dev->key->xkbInfo->state;
|
||||||
bzero(&rep,sizeof(xkbGetStateReply));
|
bzero(&rep,sizeof(xkbGetStateReply));
|
||||||
|
@ -544,7 +549,7 @@ ProcXkbLatchLockState(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags & _XkbClientInitialized))
|
if (!(client->xkbClientFlags & _XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev, stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
CHK_MASK_MATCH(0x01, stuff->affectModLocks, stuff->modLocks);
|
CHK_MASK_MATCH(0x01, stuff->affectModLocks, stuff->modLocks);
|
||||||
CHK_MASK_MATCH(0x01, stuff->affectModLatches, stuff->modLatches);
|
CHK_MASK_MATCH(0x01, stuff->affectModLatches, stuff->modLatches);
|
||||||
|
|
||||||
|
@ -612,7 +617,7 @@ ProcXkbGetControls(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
|
|
||||||
xkb = dev->key->xkbInfo->desc->ctrls;
|
xkb = dev->key->xkbInfo->desc->ctrls;
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
|
@ -689,7 +694,7 @@ ProcXkbSetControls(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags & _XkbClientInitialized))
|
if (!(client->xkbClientFlags & _XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev, stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask);
|
CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask);
|
||||||
|
|
||||||
for (tmpd = inputInfo.keyboard; tmpd; tmpd = tmpd->next) {
|
for (tmpd = inputInfo.keyboard; tmpd; tmpd = tmpd->next) {
|
||||||
|
@ -1370,7 +1375,7 @@ ProcXkbGetMap(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
CHK_MASK_OVERLAP(0x01,stuff->full,stuff->partial);
|
CHK_MASK_OVERLAP(0x01,stuff->full,stuff->partial);
|
||||||
CHK_MASK_LEGAL(0x02,stuff->full,XkbAllMapComponentsMask);
|
CHK_MASK_LEGAL(0x02,stuff->full,XkbAllMapComponentsMask);
|
||||||
CHK_MASK_LEGAL(0x03,stuff->partial,XkbAllMapComponentsMask);
|
CHK_MASK_LEGAL(0x03,stuff->partial,XkbAllMapComponentsMask);
|
||||||
|
@ -2299,7 +2304,7 @@ ProcXkbSetMap(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask);
|
CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask);
|
||||||
|
|
||||||
XkbSetCauseXkbReq(&cause,X_kbSetMap,client);
|
XkbSetCauseXkbReq(&cause,X_kbSetMap,client);
|
||||||
|
@ -2569,7 +2574,7 @@ ProcXkbGetCompatMap(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
|
|
||||||
xkb = dev->key->xkbInfo->desc;
|
xkb = dev->key->xkbInfo->desc;
|
||||||
compat= xkb->compat;
|
compat= xkb->compat;
|
||||||
|
@ -2613,7 +2618,7 @@ ProcXkbSetCompatMap(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
|
|
||||||
data = (char *)&stuff[1];
|
data = (char *)&stuff[1];
|
||||||
xkbi = dev->key->xkbInfo;
|
xkbi = dev->key->xkbInfo;
|
||||||
|
@ -2748,7 +2753,7 @@ ProcXkbGetIndicatorState(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess);
|
||||||
|
|
||||||
sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,
|
sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,
|
||||||
XkbXI_IndicatorStateMask);
|
XkbXI_IndicatorStateMask);
|
||||||
|
@ -2859,7 +2864,7 @@ XkbIndicatorPtr leds;
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
|
|
||||||
xkb= dev->key->xkbInfo->desc;
|
xkb= dev->key->xkbInfo->desc;
|
||||||
leds= xkb->indicators;
|
leds= xkb->indicators;
|
||||||
|
@ -2878,7 +2883,7 @@ int
|
||||||
ProcXkbSetIndicatorMap(ClientPtr client)
|
ProcXkbSetIndicatorMap(ClientPtr client)
|
||||||
{
|
{
|
||||||
register int i,bit;
|
register int i,bit;
|
||||||
int nIndicators,why;
|
int nIndicators;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
XkbSrvInfoPtr xkbi;
|
XkbSrvInfoPtr xkbi;
|
||||||
xkbIndicatorMapWireDesc *from;
|
xkbIndicatorMapWireDesc *from;
|
||||||
|
@ -2891,11 +2896,8 @@ ProcXkbSetIndicatorMap(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
dev = _XkbLookupKeyboard(stuff->deviceSpec,&why);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
if (!dev) {
|
|
||||||
client->errorValue = _XkbErrCode2(why,stuff->deviceSpec);
|
|
||||||
return XkbKeyboardErrorCode;
|
|
||||||
}
|
|
||||||
xkbi= dev->key->xkbInfo;
|
xkbi= dev->key->xkbInfo;
|
||||||
|
|
||||||
if (stuff->which==0)
|
if (stuff->which==0)
|
||||||
|
@ -2971,7 +2973,7 @@ ProcXkbGetNamedIndicator(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_LED_DEVICE(dev,stuff->deviceSpec);
|
CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess);
|
||||||
CHK_ATOM_ONLY(stuff->indicator);
|
CHK_ATOM_ONLY(stuff->indicator);
|
||||||
|
|
||||||
sli= XkbFindSrvLedInfo(dev,stuff->ledClass,stuff->ledID,0);
|
sli= XkbFindSrvLedInfo(dev,stuff->ledClass,stuff->ledID,0);
|
||||||
|
@ -3057,7 +3059,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_LED_DEVICE(dev,stuff->deviceSpec);
|
CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
CHK_ATOM_ONLY(stuff->indicator);
|
CHK_ATOM_ONLY(stuff->indicator);
|
||||||
CHK_MASK_LEGAL(0x10,stuff->whichGroups,XkbIM_UseAnyGroup);
|
CHK_MASK_LEGAL(0x10,stuff->whichGroups,XkbIM_UseAnyGroup);
|
||||||
CHK_MASK_LEGAL(0x11,stuff->whichMods,XkbIM_UseAnyMods);
|
CHK_MASK_LEGAL(0x11,stuff->whichMods,XkbIM_UseAnyMods);
|
||||||
|
@ -3125,7 +3127,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
|
||||||
|
|
||||||
kbd= dev;
|
kbd= dev;
|
||||||
if ((sli->flags&XkbSLI_HasOwnState)==0)
|
if ((sli->flags&XkbSLI_HasOwnState)==0)
|
||||||
kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
kbd = inputInfo.keyboard;
|
||||||
XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause);
|
XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause);
|
||||||
return client->noClientException;
|
return client->noClientException;
|
||||||
}
|
}
|
||||||
|
@ -3433,7 +3435,7 @@ ProcXkbGetNames(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask);
|
CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask);
|
||||||
|
|
||||||
xkb = dev->key->xkbInfo->desc;
|
xkb = dev->key->xkbInfo->desc;
|
||||||
|
@ -3543,7 +3545,7 @@ ProcXkbSetNames(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixUnknownAccess);
|
||||||
CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask);
|
CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask);
|
||||||
|
|
||||||
xkb = dev->key->xkbInfo->desc;
|
xkb = dev->key->xkbInfo->desc;
|
||||||
|
@ -4379,7 +4381,7 @@ ProcXkbGetGeometry(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
CHK_ATOM_OR_NONE(stuff->name);
|
CHK_ATOM_OR_NONE(stuff->name);
|
||||||
|
|
||||||
geom= XkbLookupNamedGeometry(dev,stuff->name,&shouldFree);
|
geom= XkbLookupNamedGeometry(dev,stuff->name,&shouldFree);
|
||||||
|
@ -4842,7 +4844,7 @@ ProcXkbSetGeometry(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
CHK_ATOM_OR_NONE(stuff->name);
|
CHK_ATOM_OR_NONE(stuff->name);
|
||||||
|
|
||||||
xkb= dev->key->xkbInfo->desc;
|
xkb= dev->key->xkbInfo->desc;
|
||||||
|
@ -4897,6 +4899,7 @@ ProcXkbPerClientFlags(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xkbPerClientFlagsReply rep;
|
xkbPerClientFlagsReply rep;
|
||||||
XkbInterestPtr interest;
|
XkbInterestPtr interest;
|
||||||
|
Mask access_mode = DixGetAttrAccess | DixSetAttrAccess;
|
||||||
|
|
||||||
REQUEST(xkbPerClientFlagsReq);
|
REQUEST(xkbPerClientFlagsReq);
|
||||||
REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
|
REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
|
||||||
|
@ -4904,7 +4907,7 @@ ProcXkbPerClientFlags(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode);
|
||||||
CHK_MASK_LEGAL(0x01,stuff->change,XkbPCF_AllFlagsMask);
|
CHK_MASK_LEGAL(0x01,stuff->change,XkbPCF_AllFlagsMask);
|
||||||
CHK_MASK_MATCH(0x02,stuff->change,stuff->value);
|
CHK_MASK_MATCH(0x02,stuff->change,stuff->value);
|
||||||
|
|
||||||
|
@ -5040,7 +5043,7 @@ ProcXkbListComponents(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
|
|
||||||
status= Success;
|
status= Success;
|
||||||
str= (unsigned char *)&stuff[1];
|
str= (unsigned char *)&stuff[1];
|
||||||
|
@ -5123,6 +5126,7 @@ ProcXkbGetKbdByName(ClientPtr client)
|
||||||
Bool geom_changed;
|
Bool geom_changed;
|
||||||
XkbSrvLedInfoPtr old_sli;
|
XkbSrvLedInfoPtr old_sli;
|
||||||
XkbSrvLedInfoPtr sli;
|
XkbSrvLedInfoPtr sli;
|
||||||
|
Mask access_mode = DixGetAttrAccess | DixSetAttrAccess;
|
||||||
|
|
||||||
REQUEST(xkbGetKbdByNameReq);
|
REQUEST(xkbGetKbdByNameReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
|
REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
|
||||||
|
@ -5130,7 +5134,7 @@ ProcXkbGetKbdByName(ClientPtr client)
|
||||||
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
if (!(client->xkbClientFlags&_XkbClientInitialized))
|
||||||
return BadAccess;
|
return BadAccess;
|
||||||
|
|
||||||
CHK_KBD_DEVICE(dev,stuff->deviceSpec);
|
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode);
|
||||||
|
|
||||||
xkb = dev->key->xkbInfo->desc;
|
xkb = dev->key->xkbInfo->desc;
|
||||||
status= Success;
|
status= Success;
|
||||||
|
@ -5664,7 +5668,7 @@ char * str;
|
||||||
|
|
||||||
wanted= stuff->wanted;
|
wanted= stuff->wanted;
|
||||||
|
|
||||||
CHK_ANY_DEVICE(dev,stuff->deviceSpec);
|
CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
|
||||||
CHK_MASK_LEGAL(0x01,wanted,XkbXI_AllDeviceFeaturesMask);
|
CHK_MASK_LEGAL(0x01,wanted,XkbXI_AllDeviceFeaturesMask);
|
||||||
|
|
||||||
if ((!dev->button)||((stuff->nBtns<1)&&(!stuff->allBtns)))
|
if ((!dev->button)||((stuff->nBtns<1)&&(!stuff->allBtns)))
|
||||||
|
@ -5968,7 +5972,7 @@ DeviceIntPtr kbd;
|
||||||
|
|
||||||
kbd= dev;
|
kbd= dev;
|
||||||
if ((sli->flags&XkbSLI_HasOwnState)==0)
|
if ((sli->flags&XkbSLI_HasOwnState)==0)
|
||||||
kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
kbd = inputInfo.keyboard;
|
||||||
|
|
||||||
XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause);
|
XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause);
|
||||||
ledWire= (xkbDeviceLedsWireDesc *)mapWire;
|
ledWire= (xkbDeviceLedsWireDesc *)mapWire;
|
||||||
|
@ -5993,7 +5997,7 @@ xkbExtensionDeviceNotify ed;
|
||||||
|
|
||||||
change= stuff->change;
|
change= stuff->change;
|
||||||
|
|
||||||
CHK_ANY_DEVICE(dev,stuff->deviceSpec);
|
CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||||
CHK_MASK_LEGAL(0x01,change,XkbXI_AllFeaturesMask);
|
CHK_MASK_LEGAL(0x01,change,XkbXI_AllFeaturesMask);
|
||||||
|
|
||||||
wire= (char *)&stuff[1];
|
wire= (char *)&stuff[1];
|
||||||
|
@ -6043,7 +6047,7 @@ xkbExtensionDeviceNotify ed;
|
||||||
ed.nBtns= stuff->nBtns;
|
ed.nBtns= stuff->nBtns;
|
||||||
|
|
||||||
if (dev->key) kbd= dev;
|
if (dev->key) kbd= dev;
|
||||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
else kbd= inputInfo.keyboard;
|
||||||
acts= &dev->button->xkb_acts[stuff->firstBtn];
|
acts= &dev->button->xkb_acts[stuff->firstBtn];
|
||||||
for (i=0;i<stuff->nBtns;i++,acts++) {
|
for (i=0;i<stuff->nBtns;i++,acts++) {
|
||||||
if (acts->type!=XkbSA_NoAction)
|
if (acts->type!=XkbSA_NoAction)
|
||||||
|
@ -6069,10 +6073,15 @@ ProcXkbSetDebuggingFlags(ClientPtr client)
|
||||||
{
|
{
|
||||||
CARD32 newFlags,newCtrls,extraLength;
|
CARD32 newFlags,newCtrls,extraLength;
|
||||||
xkbSetDebuggingFlagsReply rep;
|
xkbSetDebuggingFlagsReply rep;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xkbSetDebuggingFlagsReq);
|
REQUEST(xkbSetDebuggingFlagsReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
|
REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
|
||||||
|
|
||||||
|
rc = XaceHook(XACE_SERVER_ACCESS, client, DixDebugAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
newFlags= xkbDebugFlags&(~stuff->affectFlags);
|
newFlags= xkbDebugFlags&(~stuff->affectFlags);
|
||||||
newFlags|= (stuff->flags&stuff->affectFlags);
|
newFlags|= (stuff->flags&stuff->affectFlags);
|
||||||
newCtrls= xkbDebugCtrls&(~stuff->affectCtrls);
|
newCtrls= xkbDebugCtrls&(~stuff->affectCtrls);
|
||||||
|
|
|
@ -689,7 +689,7 @@ ProcessPointerEvent( register xEvent * xE,
|
||||||
register DeviceIntPtr mouse,
|
register DeviceIntPtr mouse,
|
||||||
int count)
|
int count)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev = (DeviceIntPtr)LookupKeyboardDevice();
|
DeviceIntPtr dev = inputInfo.keyboard;
|
||||||
XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
|
XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
|
||||||
unsigned changed = 0;
|
unsigned changed = 0;
|
||||||
|
|
||||||
|
|
|
@ -1026,8 +1026,9 @@ DeviceIntPtr dev;
|
||||||
int button;
|
int button;
|
||||||
|
|
||||||
if (filter->keycode==0) { /* initial press */
|
if (filter->keycode==0) { /* initial press */
|
||||||
dev= _XkbLookupButtonDevice(pAction->devbtn.device,NULL);
|
_XkbLookupButtonDevice(&dev, pAction->devbtn.device, serverClient,
|
||||||
if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice()))
|
DixUnknownAccess, &button);
|
||||||
|
if (!dev || !dev->public.on || dev == inputInfo.pointer)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
button= pAction->devbtn.button;
|
button= pAction->devbtn.button;
|
||||||
|
@ -1066,8 +1067,9 @@ int button;
|
||||||
int button;
|
int button;
|
||||||
|
|
||||||
filter->active= 0;
|
filter->active= 0;
|
||||||
dev= _XkbLookupButtonDevice(filter->upAction.devbtn.device,NULL);
|
_XkbLookupButtonDevice(&dev, filter->upAction.devbtn.device,
|
||||||
if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice()))
|
serverClient, DixUnknownAccess, &button);
|
||||||
|
if (!dev || !dev->public.on || dev == inputInfo.pointer)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
button= filter->upAction.btn.button;
|
button= filter->upAction.btn.button;
|
||||||
|
|
|
@ -806,7 +806,7 @@ Bool
|
||||||
XkbFilterEvents(ClientPtr pClient,int nEvents,xEvent *xE)
|
XkbFilterEvents(ClientPtr pClient,int nEvents,xEvent *xE)
|
||||||
{
|
{
|
||||||
int i, button_mask;
|
int i, button_mask;
|
||||||
DeviceIntPtr pXDev = (DeviceIntPtr)LookupKeyboardDevice();
|
DeviceIntPtr pXDev = inputInfo.keyboard;
|
||||||
XkbSrvInfoPtr xkbi;
|
XkbSrvInfoPtr xkbi;
|
||||||
|
|
||||||
xkbi= pXDev->key->xkbInfo;
|
xkbi= pXDev->key->xkbInfo;
|
||||||
|
|
|
@ -239,7 +239,7 @@ unsigned oldState;
|
||||||
|
|
||||||
if (dev->key && dev->key->xkbInfo)
|
if (dev->key && dev->key->xkbInfo)
|
||||||
kbd= dev;
|
kbd= dev;
|
||||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
else kbd= inputInfo.keyboard;
|
||||||
|
|
||||||
state= &kbd->key->xkbInfo->state;
|
state= &kbd->key->xkbInfo->state;
|
||||||
ctrls= kbd->key->xkbInfo->desc->ctrls;
|
ctrls= kbd->key->xkbInfo->desc->ctrls;
|
||||||
|
@ -444,7 +444,7 @@ XkbIndicatorMapPtr map;
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
|
|
||||||
if ((sli->flags&XkbSLI_HasOwnState)==0)
|
if ((sli->flags&XkbSLI_HasOwnState)==0)
|
||||||
dev= (DeviceIntPtr)LookupKeyboardDevice();
|
dev= inputInfo.keyboard;
|
||||||
|
|
||||||
sli->usesBase&= ~which;
|
sli->usesBase&= ~which;
|
||||||
sli->usesLatched&= ~which;
|
sli->usesLatched&= ~which;
|
||||||
|
@ -731,7 +731,7 @@ xkbExtensionDeviceNotify my_ed;
|
||||||
return;
|
return;
|
||||||
if (dev->key && dev->key->xkbInfo)
|
if (dev->key && dev->key->xkbInfo)
|
||||||
kbd= dev;
|
kbd= dev;
|
||||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
else kbd= inputInfo.keyboard;
|
||||||
|
|
||||||
if (ed==NULL) {
|
if (ed==NULL) {
|
||||||
ed= &my_ed;
|
ed= &my_ed;
|
||||||
|
@ -808,7 +808,7 @@ xkbExtensionDeviceNotify my_ed;
|
||||||
return;
|
return;
|
||||||
if (dev->key && dev->key->xkbInfo)
|
if (dev->key && dev->key->xkbInfo)
|
||||||
kbd= dev;
|
kbd= dev;
|
||||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
else kbd= inputInfo.keyboard;
|
||||||
|
|
||||||
if (ed==NULL) {
|
if (ed==NULL) {
|
||||||
ed= &my_ed;
|
ed= &my_ed;
|
||||||
|
@ -869,7 +869,7 @@ Bool kb_changed;
|
||||||
return;
|
return;
|
||||||
if (dev->key && dev->key->xkbInfo)
|
if (dev->key && dev->key->xkbInfo)
|
||||||
kbd= dev;
|
kbd= dev;
|
||||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
else kbd= inputInfo.keyboard;
|
||||||
xkbi= kbd->key->xkbInfo;
|
xkbi= kbd->key->xkbInfo;
|
||||||
|
|
||||||
if (changes==NULL) {
|
if (changes==NULL) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ Bool xkbCares,isBtn;
|
||||||
if ((!isBtn)||((dev->button)&&(dev->button->xkb_acts))) {
|
if ((!isBtn)||((dev->button)&&(dev->button->xkb_acts))) {
|
||||||
DeviceIntPtr kbd;
|
DeviceIntPtr kbd;
|
||||||
if (dev->key) kbd= dev;
|
if (dev->key) kbd= dev;
|
||||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
else kbd= inputInfo.keyboard;
|
||||||
XkbHandleActions(dev,kbd,xE,count);
|
XkbHandleActions(dev,kbd,xE,count);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
143
xkb/xkbUtils.c
143
xkb/xkbUtils.c
|
@ -49,92 +49,115 @@ int XkbDisableLockActions = 0;
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
DeviceIntPtr
|
int
|
||||||
_XkbLookupAnyDevice(int id,int *why_rtrn)
|
_XkbLookupAnyDevice(DeviceIntPtr *pDev, int id, ClientPtr client,
|
||||||
|
Mask access_mode, int *xkb_err)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev = NULL;
|
int rc = XkbKeyboardErrorCode;
|
||||||
|
|
||||||
dev= (DeviceIntPtr)LookupKeyboardDevice();
|
if (id == XkbUseCoreKbd) {
|
||||||
if ((id==XkbUseCoreKbd)||(dev->id==id))
|
if (inputInfo.keyboard)
|
||||||
return dev;
|
id = inputInfo.keyboard->id;
|
||||||
|
else
|
||||||
dev= (DeviceIntPtr)LookupPointerDevice();
|
goto out;
|
||||||
if ((id==XkbUseCorePtr)||(dev->id==id))
|
}
|
||||||
return dev;
|
if (id == XkbUseCorePtr) {
|
||||||
|
if (inputInfo.pointer)
|
||||||
if (id&(~0xff))
|
id = inputInfo.pointer->id;
|
||||||
dev = NULL;
|
else
|
||||||
|
goto out;
|
||||||
dixLookupDevice(&dev, id, serverClient, DixUnknownAccess);
|
}
|
||||||
if (dev!=NULL)
|
rc = dixLookupDevice(pDev, id, client, access_mode);
|
||||||
return dev;
|
out:
|
||||||
if ((!dev)&&(why_rtrn))
|
if (rc != Success)
|
||||||
*why_rtrn= XkbErr_BadDevice;
|
*xkb_err = XkbErr_BadDevice;
|
||||||
return dev;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceIntPtr
|
int
|
||||||
_XkbLookupKeyboard(int id,int *why_rtrn)
|
_XkbLookupKeyboard(DeviceIntPtr *pDev, int id, ClientPtr client,
|
||||||
|
Mask access_mode, int *xkb_err)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if (id == XkbDfltXIId)
|
if (id == XkbDfltXIId)
|
||||||
id = XkbUseCoreKbd;
|
id = XkbUseCoreKbd;
|
||||||
if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
|
|
||||||
return NULL;
|
rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err);
|
||||||
else if ((!dev->key)||(!dev->key->xkbInfo)) {
|
if (rc != Success)
|
||||||
if (why_rtrn)
|
return rc;
|
||||||
*why_rtrn= XkbErr_BadClass;
|
|
||||||
return NULL;
|
dev = *pDev;
|
||||||
|
if (!dev->key || !dev->key->xkbInfo) {
|
||||||
|
*pDev = NULL;
|
||||||
|
*xkb_err= XkbErr_BadClass;
|
||||||
|
return XkbKeyboardErrorCode;
|
||||||
}
|
}
|
||||||
return dev;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceIntPtr
|
int
|
||||||
_XkbLookupBellDevice(int id,int *why_rtrn)
|
_XkbLookupBellDevice(DeviceIntPtr *pDev, int id, ClientPtr client,
|
||||||
|
Mask access_mode, int *xkb_err)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
|
rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err);
|
||||||
return NULL;
|
if (rc != Success)
|
||||||
else if ((!dev->kbdfeed)&&(!dev->bell)) {
|
return rc;
|
||||||
if (why_rtrn)
|
|
||||||
*why_rtrn= XkbErr_BadClass;
|
dev = *pDev;
|
||||||
return NULL;
|
if (!dev->kbdfeed && !dev->bell) {
|
||||||
|
*pDev = NULL;
|
||||||
|
*xkb_err= XkbErr_BadClass;
|
||||||
|
return XkbKeyboardErrorCode;
|
||||||
}
|
}
|
||||||
return dev;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceIntPtr
|
int
|
||||||
_XkbLookupLedDevice(int id,int *why_rtrn)
|
_XkbLookupLedDevice(DeviceIntPtr *pDev, int id, ClientPtr client,
|
||||||
|
Mask access_mode, int *xkb_err)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if (id == XkbDfltXIId)
|
if (id == XkbDfltXIId)
|
||||||
id = XkbUseCorePtr;
|
id = XkbUseCorePtr;
|
||||||
if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
|
|
||||||
return NULL;
|
rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err);
|
||||||
else if ((!dev->kbdfeed)&&(!dev->leds)) {
|
if (rc != Success)
|
||||||
if (why_rtrn)
|
return rc;
|
||||||
*why_rtrn= XkbErr_BadClass;
|
|
||||||
return NULL;
|
dev = *pDev;
|
||||||
|
if (!dev->kbdfeed && !dev->leds) {
|
||||||
|
*pDev = NULL;
|
||||||
|
*xkb_err= XkbErr_BadClass;
|
||||||
|
return XkbKeyboardErrorCode;
|
||||||
}
|
}
|
||||||
return dev;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceIntPtr
|
int
|
||||||
_XkbLookupButtonDevice(int id,int *why_rtrn)
|
_XkbLookupButtonDevice(DeviceIntPtr *pDev, int id, ClientPtr client,
|
||||||
|
Mask access_mode, int *xkb_err)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
|
rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err);
|
||||||
return NULL;
|
if (rc != Success)
|
||||||
else if (!dev->button) {
|
return rc;
|
||||||
if (why_rtrn)
|
|
||||||
*why_rtrn= XkbErr_BadClass;
|
dev = *pDev;
|
||||||
return NULL;
|
if (!dev->button) {
|
||||||
|
*pDev = NULL;
|
||||||
|
*xkb_err= XkbErr_BadClass;
|
||||||
|
return XkbKeyboardErrorCode;
|
||||||
}
|
}
|
||||||
return dev;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user