mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-22 01:20:26 +00:00
Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver
This commit is contained in:
commit
2d0a63126b
104 changed files with 2536 additions and 1654 deletions
131
dix/events.c
131
dix/events.c
|
|
@ -328,7 +328,8 @@ static void ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py)
|
|||
static void PostNewCursor(DeviceIntPtr pDev);
|
||||
|
||||
#define SyntheticMotion(dev, x, y) \
|
||||
PostSyntheticMotion(dev, x, y, dev->pSprite->screen, \
|
||||
PostSyntheticMotion(dev, x, y, noPanoramiXExtension ? 0 : \
|
||||
dev->pSprite->screen->myNum, \
|
||||
syncEvents.playingEvents ? \
|
||||
syncEvents.time.milliseconds : \
|
||||
currentTime.milliseconds);
|
||||
|
|
@ -2342,17 +2343,16 @@ static int
|
|||
XineramaWarpPointer(ClientPtr client)
|
||||
{
|
||||
WindowPtr dest = NULL;
|
||||
int x, y;
|
||||
int x, y, rc;
|
||||
SpritePtr pSprite = inputInfo.pointer->pSprite;
|
||||
|
||||
REQUEST(xWarpPointerReq);
|
||||
|
||||
|
||||
if (stuff->dstWid != None)
|
||||
{
|
||||
dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess);
|
||||
if (!dest)
|
||||
return BadWindow;
|
||||
if (stuff->dstWid != None) {
|
||||
rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
x = pSprite->hotPhys.x;
|
||||
y = pSprite->hotPhys.y;
|
||||
|
|
@ -2363,8 +2363,9 @@ XineramaWarpPointer(ClientPtr client)
|
|||
XID winID = stuff->srcWid;
|
||||
WindowPtr source;
|
||||
|
||||
source = SecurityLookupWindow(winID, client, SecurityReadAccess);
|
||||
if (!source) return BadWindow;
|
||||
rc = dixLookupWindow(&source, winID, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
winX = source->drawable.x;
|
||||
winY = source->drawable.y;
|
||||
|
|
@ -2416,7 +2417,7 @@ int
|
|||
ProcWarpPointer(ClientPtr client)
|
||||
{
|
||||
WindowPtr dest = NULL;
|
||||
int x, y;
|
||||
int x, y, rc;
|
||||
ScreenPtr newScreen;
|
||||
SpritePtr pSprite = inputInfo.pointer->pSprite;
|
||||
|
||||
|
|
@ -2429,11 +2430,10 @@ ProcWarpPointer(ClientPtr client)
|
|||
return XineramaWarpPointer(client);
|
||||
#endif
|
||||
|
||||
if (stuff->dstWid != None)
|
||||
{
|
||||
dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess);
|
||||
if (!dest)
|
||||
return BadWindow;
|
||||
if (stuff->dstWid != None) {
|
||||
rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
x = pSprite->hotPhys.x;
|
||||
y = pSprite->hotPhys.y;
|
||||
|
|
@ -2444,8 +2444,9 @@ ProcWarpPointer(ClientPtr client)
|
|||
XID winID = stuff->srcWid;
|
||||
WindowPtr source;
|
||||
|
||||
source = SecurityLookupWindow(winID, client, SecurityReadAccess);
|
||||
if (!source) return BadWindow;
|
||||
rc = dixLookupWindow(&source, winID, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
winX = source->drawable.x;
|
||||
winY = source->drawable.y;
|
||||
|
|
@ -3673,8 +3674,8 @@ SetInputFocus(
|
|||
Bool followOK)
|
||||
{
|
||||
register FocusClassPtr focus;
|
||||
register WindowPtr focusWin;
|
||||
int mode;
|
||||
WindowPtr focusWin;
|
||||
int mode, rc;
|
||||
TimeStamp time;
|
||||
|
||||
UpdateCurrentTime();
|
||||
|
|
@ -3691,14 +3692,12 @@ SetInputFocus(
|
|||
focusWin = (WindowPtr)(long)focusID;
|
||||
else if ((focusID == FollowKeyboard) && followOK)
|
||||
focusWin = inputInfo.keyboard->focus->win;
|
||||
else if (!(focusWin = SecurityLookupWindow(focusID, client,
|
||||
SecurityReadAccess)))
|
||||
return BadWindow;
|
||||
else
|
||||
{
|
||||
else {
|
||||
rc = dixLookupWindow(&focusWin, focusID, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
/* It is a match error to try to set the input focus to an
|
||||
unviewable window. */
|
||||
|
||||
if(!focusWin->realized)
|
||||
return(BadMatch);
|
||||
}
|
||||
|
|
@ -3787,6 +3786,7 @@ ProcGrabPointer(ClientPtr client)
|
|||
CursorPtr cursor, oldCursor;
|
||||
REQUEST(xGrabPointerReq);
|
||||
TimeStamp time;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGrabPointerReq);
|
||||
UpdateCurrentTime();
|
||||
|
|
@ -3812,24 +3812,24 @@ ProcGrabPointer(ClientPtr client)
|
|||
client->errorValue = stuff->eventMask;
|
||||
return BadValue;
|
||||
}
|
||||
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (stuff->confineTo == None)
|
||||
confineTo = NullWindow;
|
||||
else
|
||||
{
|
||||
confineTo = SecurityLookupWindow(stuff->confineTo, client,
|
||||
SecurityReadAccess);
|
||||
if (!confineTo)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&confineTo, stuff->confineTo, client,
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
if (stuff->cursor == None)
|
||||
cursor = NullCursor;
|
||||
else
|
||||
{
|
||||
cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
|
||||
RT_CURSOR, SecurityReadAccess);
|
||||
RT_CURSOR, DixReadAccess);
|
||||
if (!cursor)
|
||||
{
|
||||
client->errorValue = stuff->cursor;
|
||||
|
|
@ -3904,7 +3904,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
|
|||
else
|
||||
{
|
||||
newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
|
||||
RT_CURSOR, SecurityReadAccess);
|
||||
RT_CURSOR, DixReadAccess);
|
||||
if (!newCursor)
|
||||
{
|
||||
client->errorValue = stuff->cursor;
|
||||
|
|
@ -3954,9 +3954,10 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
|
|||
unsigned this_mode, unsigned other_mode, Window grabWindow,
|
||||
unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status)
|
||||
{
|
||||
register WindowPtr pWin;
|
||||
WindowPtr pWin;
|
||||
register GrabPtr grab;
|
||||
TimeStamp time;
|
||||
int rc;
|
||||
|
||||
UpdateCurrentTime();
|
||||
if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync))
|
||||
|
|
@ -3974,9 +3975,9 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
|
|||
client->errorValue = ownerEvents;
|
||||
return BadValue;
|
||||
}
|
||||
pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess);
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
time = ClientTimeToServerTime(ctime);
|
||||
grab = dev->grab;
|
||||
if (grab && !SameClient(grab, client))
|
||||
|
|
@ -4063,14 +4064,16 @@ ProcQueryPointer(ClientPtr client)
|
|||
{
|
||||
xQueryPointerReply rep;
|
||||
WindowPtr pWin, t;
|
||||
REQUEST(xResourceReq);
|
||||
DeviceIntPtr mouse = inputInfo.pointer;
|
||||
SpritePtr pSprite = mouse->pSprite;
|
||||
int rc;
|
||||
|
||||
REQUEST(xResourceReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xResourceReq);
|
||||
pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess);
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (mouse->valuator->motionHintWindow)
|
||||
MaybeStopHint(mouse, client);
|
||||
rep.type = X_Reply;
|
||||
|
|
@ -4257,8 +4260,8 @@ ProcSendEvent(ClientPtr client)
|
|||
effectiveFocus = pWin = inputFocus;
|
||||
}
|
||||
else
|
||||
pWin = SecurityLookupWindow(stuff->destination, client,
|
||||
SecurityReadAccess);
|
||||
dixLookupWindow(&pWin, stuff->destination, client, DixReadAccess);
|
||||
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue))
|
||||
|
|
@ -4294,11 +4297,12 @@ ProcUngrabKey(ClientPtr client)
|
|||
WindowPtr pWin;
|
||||
GrabRec tempGrab;
|
||||
DeviceIntPtr keybd = inputInfo.keyboard;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xUngrabKeyReq);
|
||||
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) ||
|
||||
(stuff->key < keybd->key->curKeySyms.minKeyCode))
|
||||
|
|
@ -4335,6 +4339,7 @@ ProcGrabKey(ClientPtr client)
|
|||
REQUEST(xGrabKeyReq);
|
||||
GrabPtr grab;
|
||||
DeviceIntPtr keybd = inputInfo.keyboard;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGrabKeyReq);
|
||||
if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse))
|
||||
|
|
@ -4367,9 +4372,9 @@ ProcGrabKey(ClientPtr client)
|
|||
client->errorValue = stuff->modifiers;
|
||||
return BadValue;
|
||||
}
|
||||
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
grab = CreateGrab(client->index, keybd, pWin,
|
||||
(Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents,
|
||||
|
|
@ -4389,6 +4394,7 @@ ProcGrabButton(ClientPtr client)
|
|||
REQUEST(xGrabButtonReq);
|
||||
CursorPtr cursor;
|
||||
GrabPtr grab;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGrabButtonReq);
|
||||
if ((stuff->pointerMode != GrabModeSync) &&
|
||||
|
|
@ -4419,23 +4425,23 @@ ProcGrabButton(ClientPtr client)
|
|||
client->errorValue = stuff->eventMask;
|
||||
return BadValue;
|
||||
}
|
||||
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (stuff->confineTo == None)
|
||||
confineTo = NullWindow;
|
||||
else {
|
||||
confineTo = SecurityLookupWindow(stuff->confineTo, client,
|
||||
SecurityReadAccess);
|
||||
if (!confineTo)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&confineTo, stuff->confineTo, client,
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
if (stuff->cursor == None)
|
||||
cursor = NullCursor;
|
||||
else
|
||||
{
|
||||
cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
|
||||
RT_CURSOR, SecurityReadAccess);
|
||||
RT_CURSOR, DixReadAccess);
|
||||
if (!cursor)
|
||||
{
|
||||
client->errorValue = stuff->cursor;
|
||||
|
|
@ -4460,6 +4466,7 @@ ProcUngrabButton(ClientPtr client)
|
|||
REQUEST(xUngrabButtonReq);
|
||||
WindowPtr pWin;
|
||||
GrabRec tempGrab;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xUngrabButtonReq);
|
||||
if ((stuff->modifiers != AnyModifier) &&
|
||||
|
|
@ -4468,9 +4475,9 @@ ProcUngrabButton(ClientPtr client)
|
|||
client->errorValue = stuff->modifiers;
|
||||
return BadValue;
|
||||
}
|
||||
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
|
||||
if (!pWin)
|
||||
return BadWindow;
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
tempGrab.resource = client->clientAsMask;
|
||||
tempGrab.device = inputInfo.pointer;
|
||||
tempGrab.window = pWin;
|
||||
|
|
@ -4631,7 +4638,7 @@ ProcRecolorCursor(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xRecolorCursorReq);
|
||||
pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
|
||||
RT_CURSOR, SecurityWriteAccess);
|
||||
RT_CURSOR, DixWriteAccess);
|
||||
if ( !pCursor)
|
||||
{
|
||||
client->errorValue = stuff->cursor;
|
||||
|
|
|
|||
Loading…
Reference in a new issue