diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
commit | 8da83836b60f7cdb75d08482f4311fa0e2ab4e1d (patch) | |
tree | 092efcfc39e3e293baaf04c4c84027ee453d3e13 /Xext/xtest.c | |
parent | eace88989c3b65d5c20e9f37ea9b23c7c8e19335 (diff) | |
parent | ae869fc7669764729e13fdd70149ed636753f2a3 (diff) |
Merge branch 'master' into mpx
Conflicts:
XTrap/xtrapddmi.c
Xext/security.c
Xext/xprint.c
Xext/xtest.c
Xext/xvdisp.c
Xi/exevents.c
Xi/grabdevb.c
Xi/grabdevk.c
Xi/opendev.c
Xi/ungrdev.c
Xi/ungrdevb.c
Xi/ungrdevk.c
dix/cursor.c
dix/devices.c
dix/dixutils.c
dix/events.c
dix/getevents.c
dix/main.c
dix/window.c
hw/xfree86/ramdac/xf86Cursor.c
include/dix.h
include/input.h
include/inputstr.h
mi/midispcur.c
mi/miinitext.c
mi/misprite.c
render/animcur.c
xfixes/cursor.c
xkb/xkbAccessX.c
Diffstat (limited to 'Xext/xtest.c')
-rw-r--r-- | Xext/xtest.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c index 371be4e9e..8d27e16a5 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -49,15 +49,10 @@ from The Open Group. #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #define EXTENSION_EVENT_BASE 64 -#include "extinit.h" /* LookupDeviceIntRec */ #endif /* XINPUT */ #include "modinit.h" -#if 0 -static unsigned char XTestReqCode; -#endif - #ifdef XINPUT extern int DeviceValuator; #endif /* XINPUT */ @@ -89,18 +84,9 @@ static DISPATCH_PROC(SProcXTestGrabControl); void XTestExtensionInit(INITARGS) { -#if 0 - ExtensionEntry *extEntry; - - if ((extEntry = AddExtension(XTestExtensionName, 0, 0, - ProcXTestDispatch, SProcXTestDispatch, - XTestResetProc, StandardMinorOpcode)) != 0) - XTestReqCode = (unsigned char)extEntry->base; -#else - (void) AddExtension(XTestExtensionName, 0, 0, - ProcXTestDispatch, SProcXTestDispatch, - XTestResetProc, StandardMinorOpcode); -#endif + AddExtension(XTestExtensionName, 0, 0, + ProcXTestDispatch, SProcXTestDispatch, + XTestResetProc, StandardMinorOpcode); } /*ARGSUSED*/ @@ -140,22 +126,23 @@ ProcXTestCompareCursor(client) WindowPtr pWin; CursorPtr pCursor; int n, rc; - DeviceIntPtr pointer = PickPointer(client); + DeviceIntPtr ptr = PickPointer(client); REQUEST_SIZE_MATCH(xXTestCompareCursorReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; if (stuff->cursor == None) pCursor = NullCursor; else if (stuff->cursor == XTestCurrentCursor) - pCursor = GetSpriteCursor(pointer); + pCursor = GetSpriteCursor(ptr); else { - pCursor = (CursorPtr)LookupIDByType(stuff->cursor, RT_CURSOR); - if (!pCursor) + rc = dixLookupResource((pointer *)&pCursor, stuff->cursor, RT_CURSOR, + client, DixReadAccess); + if (rc != Success) { client->errorValue = stuff->cursor; - return (BadCursor); + return (rc == BadValue) ? BadCursor : rc; } } rep.type = X_Reply; @@ -287,11 +274,12 @@ ProcXTestFakeInput(client) #ifdef XINPUT if (extension) { - dev = LookupDeviceIntRec(stuff->deviceid & 0177); - if (!dev) + rc = dixLookupDevice(&dev, stuff->deviceid & 0177, client, + DixWriteAccess); + if (rc != Success) { client->errorValue = stuff->deviceid & 0177; - return BadValue; + return rc; } if (nev > 1) { @@ -368,7 +356,7 @@ ProcXTestFakeInput(client) else { rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client, - DixUnknownAccess); + DixGetAttrAccess); if (rc != Success) return rc; if (root->parent) @@ -461,7 +449,7 @@ ProcXTestFakeInput(client) break; } if (screenIsSaved == SCREEN_SAVER_ON) - SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset); + dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); ev->u.keyButtonPointer.time = currentTime.milliseconds; (*dev->public.processInputProc)(ev, dev, nev); return client->noClientException; |