mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
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
This commit is contained in:
@@ -51,12 +51,12 @@
|
||||
#include "servermd.h"
|
||||
#include "inputstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "xace.h"
|
||||
|
||||
static RESTYPE CursorClientType;
|
||||
static RESTYPE CursorHideCountType;
|
||||
static RESTYPE CursorWindowType;
|
||||
static int CursorScreenPrivateIndex = -1;
|
||||
static int CursorGeneration;
|
||||
static DevPrivateKey CursorScreenPrivateKey = &CursorScreenPrivateKey;
|
||||
static CursorPtr CursorCurrent;
|
||||
static CursorPtr pInvisibleCursor = NULL;
|
||||
|
||||
@@ -113,9 +113,9 @@ typedef struct _CursorScreen {
|
||||
CursorHideCountPtr pCursorHideCounts;
|
||||
} CursorScreenRec, *CursorScreenPtr;
|
||||
|
||||
#define GetCursorScreen(s) ((CursorScreenPtr) ((s)->devPrivates[CursorScreenPrivateIndex].ptr))
|
||||
#define GetCursorScreenIfSet(s) ((CursorScreenPrivateIndex != -1) ? GetCursorScreen(s) : NULL)
|
||||
#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (pointer) (p))
|
||||
#define GetCursorScreen(s) ((CursorScreenPtr)dixLookupPrivate(&(s)->devPrivates, CursorScreenPrivateKey))
|
||||
#define GetCursorScreenIfSet(s) GetCursorScreen(s)
|
||||
#define SetCursorScreen(s,p) dixSetPrivate(&(s)->devPrivates, CursorScreenPrivateKey, p)
|
||||
#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
|
||||
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
||||
|
||||
@@ -172,8 +172,6 @@ CursorCloseScreen (int index, ScreenPtr pScreen)
|
||||
deleteCursorHideCountsForScreen(pScreen);
|
||||
ret = (*pScreen->CloseScreen) (index, pScreen);
|
||||
xfree (cs);
|
||||
if (index == 0)
|
||||
CursorScreenPrivateIndex = -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -242,7 +240,7 @@ ProcXFixesSelectCursorInput (ClientPtr client)
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (stuff->eventMask & ~CursorAllEvents)
|
||||
@@ -347,14 +345,16 @@ ProcXFixesGetCursorImage (ClientPtr client)
|
||||
xXFixesGetCursorImageReply *rep;
|
||||
CursorPtr pCursor;
|
||||
CARD32 *image;
|
||||
int npixels;
|
||||
int width, height;
|
||||
int x, y;
|
||||
int npixels, width, height, rc, x, y;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq);
|
||||
pCursor = CursorCurrent;
|
||||
if (!pCursor)
|
||||
return BadCursor;
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
|
||||
pCursor, RT_NONE, NULL, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
GetSpritePosition (inputInfo.pointer, &x, &y);
|
||||
width = pCursor->bits->width;
|
||||
height = pCursor->bits->height;
|
||||
@@ -415,7 +415,7 @@ ProcXFixesSetCursorName (ClientPtr client)
|
||||
Atom atom;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
|
||||
VERIFY_CURSOR(pCursor, stuff->cursor, client, DixWriteAccess);
|
||||
VERIFY_CURSOR(pCursor, stuff->cursor, client, DixSetAttrAccess);
|
||||
tchar = (char *) &stuff[1];
|
||||
atom = MakeAtom (tchar, stuff->nbytes, TRUE);
|
||||
if (atom == BAD_RESOURCE)
|
||||
@@ -448,7 +448,7 @@ ProcXFixesGetCursorName (ClientPtr client)
|
||||
int len;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
|
||||
VERIFY_CURSOR(pCursor, stuff->cursor, client, DixReadAccess);
|
||||
VERIFY_CURSOR(pCursor, stuff->cursor, client, DixGetAttrAccess);
|
||||
if (pCursor->name)
|
||||
str = NameForAtom (pCursor->name);
|
||||
else
|
||||
@@ -497,12 +497,16 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
|
||||
char *name;
|
||||
int nbytes, nbytesRound;
|
||||
int width, height;
|
||||
int x, y;
|
||||
int rc, x, y;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq);
|
||||
pCursor = CursorCurrent;
|
||||
if (!pCursor)
|
||||
return BadCursor;
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
|
||||
pCursor, RT_NONE, NULL, DixReadAccess|DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
GetSpritePosition (inputInfo.pointer, &x, &y);
|
||||
width = pCursor->bits->width;
|
||||
height = pCursor->bits->height;
|
||||
@@ -679,8 +683,10 @@ ProcXFixesChangeCursor (ClientPtr client)
|
||||
REQUEST(xXFixesChangeCursorReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
|
||||
VERIFY_CURSOR (pSource, stuff->source, client, DixReadAccess);
|
||||
VERIFY_CURSOR (pDestination, stuff->destination, client, DixWriteAccess);
|
||||
VERIFY_CURSOR (pSource, stuff->source, client,
|
||||
DixReadAccess|DixGetAttrAccess);
|
||||
VERIFY_CURSOR (pDestination, stuff->destination, client,
|
||||
DixWriteAccess|DixSetAttrAccess);
|
||||
|
||||
ReplaceCursor (pSource, TestForCursor, (pointer) pDestination);
|
||||
return (client->noClientException);
|
||||
@@ -714,7 +720,8 @@ ProcXFixesChangeCursorByName (ClientPtr client)
|
||||
REQUEST(xXFixesChangeCursorByNameReq);
|
||||
|
||||
REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes);
|
||||
VERIFY_CURSOR(pSource, stuff->source, client, DixReadAccess);
|
||||
VERIFY_CURSOR(pSource, stuff->source, client,
|
||||
DixReadAccess|DixGetAttrAccess);
|
||||
tchar = (char *) &stuff[1];
|
||||
name = MakeAtom (tchar, stuff->nbytes, FALSE);
|
||||
if (name)
|
||||
@@ -842,10 +849,11 @@ ProcXFixesHideCursor (ClientPtr client)
|
||||
|
||||
REQUEST_SIZE_MATCH (xXFixesHideCursorReq);
|
||||
|
||||
pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW);
|
||||
if (!pWin) {
|
||||
ret = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW,
|
||||
client, DixGetAttrAccess);
|
||||
if (ret != Success) {
|
||||
client->errorValue = stuff->window;
|
||||
return BadWindow;
|
||||
return (ret == BadValue) ? BadWindow : ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -863,6 +871,11 @@ ProcXFixesHideCursor (ClientPtr client)
|
||||
* This is the first time this client has hid the cursor
|
||||
* for this screen.
|
||||
*/
|
||||
ret = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen,
|
||||
DixHideAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
ret = createCursorHideCount(client, pWin->drawable.pScreen);
|
||||
|
||||
if (ret == Success) {
|
||||
@@ -889,14 +902,16 @@ ProcXFixesShowCursor (ClientPtr client)
|
||||
{
|
||||
WindowPtr pWin;
|
||||
CursorHideCountPtr pChc;
|
||||
int rc;
|
||||
REQUEST(xXFixesShowCursorReq);
|
||||
|
||||
REQUEST_SIZE_MATCH (xXFixesShowCursorReq);
|
||||
|
||||
pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW);
|
||||
if (!pWin) {
|
||||
rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW,
|
||||
client, DixGetAttrAccess);
|
||||
if (rc != Success) {
|
||||
client->errorValue = stuff->window;
|
||||
return BadWindow;
|
||||
return (rc == BadValue) ? BadWindow : rc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -908,6 +923,11 @@ ProcXFixesShowCursor (ClientPtr client)
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen,
|
||||
DixShowAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
pChc->hideCount--;
|
||||
if (pChc->hideCount <= 0) {
|
||||
FreeResource(pChc->resource, 0);
|
||||
@@ -981,6 +1001,7 @@ createInvisibleCursor (void)
|
||||
CursorPtr pCursor;
|
||||
static unsigned int *psrcbits, *pmaskbits;
|
||||
CursorMetricRec cm;
|
||||
int rc;
|
||||
|
||||
psrcbits = (unsigned int *) xalloc(4);
|
||||
pmaskbits = (unsigned int *) xalloc(4);
|
||||
@@ -995,12 +1016,13 @@ createInvisibleCursor (void)
|
||||
cm.xhot = 0;
|
||||
cm.yhot = 0;
|
||||
|
||||
pCursor = AllocCursor(
|
||||
rc = AllocARGBCursor(
|
||||
(unsigned char *)psrcbits,
|
||||
(unsigned char *)pmaskbits,
|
||||
&cm,
|
||||
NULL, &cm,
|
||||
0, 0, 0,
|
||||
0, 0, 0);
|
||||
0, 0, 0,
|
||||
&pCursor, serverClient, (XID)0);
|
||||
|
||||
return pCursor;
|
||||
}
|
||||
@@ -1010,13 +1032,6 @@ XFixesCursorInit (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (CursorGeneration != serverGeneration)
|
||||
{
|
||||
CursorScreenPrivateIndex = AllocateScreenPrivateIndex ();
|
||||
if (CursorScreenPrivateIndex < 0)
|
||||
return FALSE;
|
||||
CursorGeneration = serverGeneration;
|
||||
}
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[i];
|
||||
|
||||
Reference in New Issue
Block a user