summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
Diffstat (limited to 'dix')
-rw-r--r--dix/colormap.c40
-rw-r--r--dix/devices.c4
-rw-r--r--dix/dispatch.c40
-rw-r--r--dix/dixfonts.c8
-rw-r--r--dix/events.c24
-rw-r--r--dix/extension.c4
-rw-r--r--dix/gc.c4
-rw-r--r--dix/getevents.c16
-rw-r--r--dix/globals.c1
-rw-r--r--dix/glyphcurs.c3
-rw-r--r--dix/grabs.c24
-rw-r--r--dix/main.c2
-rw-r--r--dix/pixmap.c2
-rw-r--r--dix/property.c16
-rw-r--r--dix/resource.c6
-rw-r--r--dix/swaprep.c12
-rw-r--r--dix/window.c2
17 files changed, 108 insertions, 100 deletions
diff --git a/dix/colormap.c b/dix/colormap.c
index d07cff7db..c4c8c8bfe 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -744,7 +744,7 @@ UpdateColors (ColormapPtr pmap)
pVisual = pmap->pVisual;
size = pVisual->ColormapEntries;
- defs = (xColorItem *)ALLOCATE_LOCAL(size * sizeof(xColorItem));
+ defs = (xColorItem *)xalloc(size * sizeof(xColorItem));
if (!defs)
return;
n = 0;
@@ -794,7 +794,7 @@ UpdateColors (ColormapPtr pmap)
}
if (n)
(*pmap->pScreen->StoreColors)(pmap, n, defs);
- DEALLOCATE_LOCAL(defs);
+ xfree(defs);
}
/* Get a read-only color from a ColorMap (probably slow for large maps)
@@ -1745,14 +1745,14 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
for(p = pixels; p < pixels + c; p++)
*p = 0;
- ppixRed = (Pixel *)ALLOCATE_LOCAL(npixR * sizeof(Pixel));
- ppixGreen = (Pixel *)ALLOCATE_LOCAL(npixG * sizeof(Pixel));
- ppixBlue = (Pixel *)ALLOCATE_LOCAL(npixB * sizeof(Pixel));
+ ppixRed = (Pixel *)xalloc(npixR * sizeof(Pixel));
+ ppixGreen = (Pixel *)xalloc(npixG * sizeof(Pixel));
+ ppixBlue = (Pixel *)xalloc(npixB * sizeof(Pixel));
if (!ppixRed || !ppixGreen || !ppixBlue)
{
- if (ppixBlue) DEALLOCATE_LOCAL(ppixBlue);
- if (ppixGreen) DEALLOCATE_LOCAL(ppixGreen);
- if (ppixRed) DEALLOCATE_LOCAL(ppixRed);
+ if (ppixBlue) xfree(ppixBlue);
+ if (ppixGreen) xfree(ppixGreen);
+ if (ppixRed) xfree(ppixRed);
return(BadAlloc);
}
@@ -1790,9 +1790,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
if (okB)
for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++)
pmap->blue[*ppix].refcnt = 0;
- DEALLOCATE_LOCAL(ppixBlue);
- DEALLOCATE_LOCAL(ppixGreen);
- DEALLOCATE_LOCAL(ppixRed);
+ xfree(ppixBlue);
+ xfree(ppixGreen);
+ xfree(ppixRed);
return(BadAlloc);
}
@@ -1834,9 +1834,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
for (pDst = pixels; pDst < pixels + c; pDst++)
*pDst |= ALPHAMASK(pmap->pVisual);
- DEALLOCATE_LOCAL(ppixBlue);
- DEALLOCATE_LOCAL(ppixGreen);
- DEALLOCATE_LOCAL(ppixRed);
+ xfree(ppixBlue);
+ xfree(ppixGreen);
+ xfree(ppixRed);
return (Success);
}
@@ -1852,7 +1852,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
npix = c << r;
if ((r >= 32) || (npix > pmap->freeRed) || (npix < c))
return(BadAlloc);
- if(!(ppixTemp = (Pixel *)ALLOCATE_LOCAL(npix * sizeof(Pixel))))
+ if(!(ppixTemp = (Pixel *)xalloc(npix * sizeof(Pixel))))
return(BadAlloc);
ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask);
@@ -1882,7 +1882,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
pmap->numPixelsRed[client] += npix;
pmap->freeRed -= npix;
}
- DEALLOCATE_LOCAL(ppixTemp);
+ xfree(ppixTemp);
return (ok ? Success : BadAlloc);
}
@@ -2082,7 +2082,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b,
npixClientNew = c << (r + g + b);
npixShared = (c << r) + (c << g) + (c << b);
- psharedList = (SHAREDCOLOR **)ALLOCATE_LOCAL(npixShared *
+ psharedList = (SHAREDCOLOR **)xalloc(npixShared *
sizeof(SHAREDCOLOR *));
if (!psharedList)
return FALSE;
@@ -2197,7 +2197,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b,
}
}
}
- DEALLOCATE_LOCAL(psharedList);
+ xfree(psharedList);
return TRUE;
}
@@ -2672,7 +2672,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
Colormap *pmaps;
int imap, nummaps, found;
- pmaps = (Colormap *) ALLOCATE_LOCAL(
+ pmaps = (Colormap *) xalloc(
pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap));
if(!pmaps)
return(FALSE);
@@ -2687,6 +2687,6 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
break;
}
}
- DEALLOCATE_LOCAL(pmaps);
+ xfree(pmaps);
return (found);
}
diff --git a/dix/devices.c b/dix/devices.c
index 3395cd33d..5e82759bc 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2048,7 +2048,7 @@ ProcGetMotionEvents(ClientPtr client)
{
if (CompareTimeStamps(stop, currentTime) == LATER)
stop = currentTime;
- coords = (xTimecoord *)ALLOCATE_LOCAL(mouse->valuator->numMotionEvents
+ coords = (xTimecoord *)xalloc(mouse->valuator->numMotionEvents
* sizeof(xTimecoord));
if (!coords)
return BadAlloc;
@@ -2082,7 +2082,7 @@ ProcGetMotionEvents(ClientPtr client)
(char *)coords);
}
if (coords)
- DEALLOCATE_LOCAL(coords);
+ xfree(coords);
return Success;
}
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 814c2a853..19d02fd0c 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -379,7 +379,7 @@ Dispatch(void)
InitSelections();
nClients = 0;
- clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients);
+ clientReady = (int *) xalloc(sizeof(int) * MaxClients);
if (!clientReady)
return;
@@ -508,7 +508,7 @@ Dispatch(void)
ddxBeforeReset ();
#endif
KillAllClients();
- DEALLOCATE_LOCAL(clientReady);
+ xfree(clientReady);
dispatchException &= ~DE_RESET;
#ifdef XSERVER_DTRACE
FreeRequestNames();
@@ -900,7 +900,7 @@ ProcQueryTree(ClientPtr client)
{
int curChild = 0;
- childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window));
+ childIDs = (Window *) xalloc(numChildren * sizeof(Window));
if (!childIDs)
return BadAlloc;
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
@@ -915,7 +915,7 @@ ProcQueryTree(ClientPtr client)
{
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs);
- DEALLOCATE_LOCAL(childIDs);
+ xfree(childIDs);
}
return(client->noClientException);
@@ -1411,7 +1411,7 @@ ProcQueryFont(ClientPtr client)
rlength = sizeof(xQueryFontReply) +
FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) +
nprotoxcistructs * sizeof(xCharInfo);
- reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength);
+ reply = (xQueryFontReply *)xalloc(rlength);
if(!reply)
{
return(BadAlloc);
@@ -1423,7 +1423,7 @@ ProcQueryFont(ClientPtr client)
QueryFont( pFont, reply, nprotoxcistructs);
WriteReplyToClient(client, rlength, reply);
- DEALLOCATE_LOCAL(reply);
+ xfree(reply);
return(client->noClientException);
}
}
@@ -1562,7 +1562,7 @@ ProcCreatePixmap(ClientPtr client)
CreatePmap:
pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap)
(pDraw->pScreen, stuff->width,
- stuff->height, stuff->depth);
+ stuff->height, stuff->depth, 0);
if (pMap)
{
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
@@ -2277,7 +2277,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
length += widthBytesLine;
}
}
- if(!(pBuf = (char *) ALLOCATE_LOCAL(length)))
+ if(!(pBuf = (char *) xalloc(length)))
return (BadAlloc);
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
}
@@ -2378,7 +2378,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if (pVisibleRegion)
REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
if (!im_return)
- DEALLOCATE_LOCAL(pBuf);
+ xfree(pBuf);
return (client->noClientException);
}
@@ -2650,7 +2650,7 @@ ProcListInstalledColormaps(ClientPtr client)
goto out;
preply = (xListInstalledColormapsReply *)
- ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) +
+ xalloc(sizeof(xListInstalledColormapsReply) +
pWin->drawable.pScreen->maxInstalledCmaps *
sizeof(Colormap));
if(!preply)
@@ -2665,7 +2665,7 @@ ProcListInstalledColormaps(ClientPtr client)
WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply);
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
- DEALLOCATE_LOCAL(preply);
+ xfree(preply);
rc = client->noClientException;
out:
return (rc == BadValue) ? BadColor : rc;
@@ -2794,7 +2794,7 @@ ProcAllocColorCells (ClientPtr client)
}
nmasks = stuff->planes;
length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
- ppixels = (Pixel *)ALLOCATE_LOCAL(length);
+ ppixels = (Pixel *)xalloc(length);
if(!ppixels)
return(BadAlloc);
pmasks = ppixels + npixels;
@@ -2802,7 +2802,7 @@ ProcAllocColorCells (ClientPtr client)
if( (rc = AllocColorCells(client->index, pcmp, npixels, nmasks,
(Bool)stuff->contiguous, ppixels, pmasks)) )
{
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
if (client->noClientException != Success)
return(client->noClientException);
else
@@ -2821,7 +2821,7 @@ ProcAllocColorCells (ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels);
}
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
return (client->noClientException);
}
else
@@ -2863,7 +2863,7 @@ ProcAllocColorPlanes(ClientPtr client)
acpr.sequenceNumber = client->sequence;
acpr.nPixels = npixels;
length = (long)npixels * sizeof(Pixel);
- ppixels = (Pixel *)ALLOCATE_LOCAL(length);
+ ppixels = (Pixel *)xalloc(length);
if(!ppixels)
return(BadAlloc);
if( (rc = AllocColorPlanes(client->index, pcmp, npixels,
@@ -2871,7 +2871,7 @@ ProcAllocColorPlanes(ClientPtr client)
(Bool)stuff->contiguous, ppixels,
&acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
{
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
if (client->noClientException != Success)
return(client->noClientException);
else
@@ -2886,7 +2886,7 @@ ProcAllocColorPlanes(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels);
}
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
return (client->noClientException);
}
else
@@ -3016,12 +3016,12 @@ ProcQueryColors(ClientPtr client)
xQueryColorsReply qcr;
count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2;
- prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb));
+ prgbs = (xrgb *)xalloc(count * sizeof(xrgb));
if(!prgbs && count)
return(BadAlloc);
if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) )
{
- if (prgbs) DEALLOCATE_LOCAL(prgbs);
+ if (prgbs) xfree(prgbs);
if (client->noClientException != Success)
return(client->noClientException);
else
@@ -3040,7 +3040,7 @@ ProcQueryColors(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
}
- if (prgbs) DEALLOCATE_LOCAL(prgbs);
+ if (prgbs) xfree(prgbs);
return(client->noClientException);
}
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 4ea630210..2979c6424 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -778,7 +778,7 @@ finish:
reply.nFonts = nnames;
reply.sequenceNumber = client->sequence;
- bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2);
+ bufptr = bufferStart = (char *) xalloc(reply.length << 2);
if (!bufptr && reply.length) {
SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc);
@@ -803,7 +803,7 @@ finish:
client->pSwapReplyFunc = ReplySwapVector[X_ListFonts];
WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply);
(void) WriteToClient(client, stringLens + nnames, bufferStart);
- DEALLOCATE_LOCAL(bufferStart);
+ xfree(bufferStart);
bail:
if (c->slept)
@@ -1808,7 +1808,7 @@ SetDefaultFontPath(char *path)
/* get enough for string, plus values -- use up commas */
len = strlen(path) + 1;
- nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len);
+ nump = cp = newpath = (unsigned char *) xalloc(len);
if (!newpath)
return BadAlloc;
pp = (unsigned char *) path;
@@ -1829,7 +1829,7 @@ SetDefaultFontPath(char *path)
err = SetFontPathElements(num, newpath, &bad, TRUE);
- DEALLOCATE_LOCAL(newpath);
+ xfree(newpath);
return err;
}
diff --git a/dix/events.c b/dix/events.c
index e13e290f4..2488a9b7d 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1098,9 +1098,10 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
#endif
sprite.hotPhys.x = XE_KBPTR.rootX;
sprite.hotPhys.y = XE_KBPTR.rootY;
- /* do motion compression */
+ /* do motion compression, but not if from different devices */
if (tail &&
(tail->event->u.u.type == MotionNotify) &&
+ (tail->device == device) &&
(tail->pScreen == sprite.hotPhys.pScreen))
{
tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x;
@@ -3174,7 +3175,7 @@ drawable.id:0;
#ifdef XKB
/* This function is used to set the key pressed or key released state -
this is only used when the pressing of keys does not cause
- CoreProcessKeyEvent to be called, as in for example Mouse Keys.
+ the device's processInputProc to be called, as in for example Mouse Keys.
*/
void
FixKeyState (xEvent *xE, DeviceIntPtr keybd)
@@ -3187,22 +3188,19 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd)
kptr = &keyc->down[key >> 3];
bit = 1 << (key & 7);
- if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) {
+ if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease)||
+ (xE->u.u.type==DeviceKeyPress)||(xE->u.u.type==DeviceKeyRelease))
+ ) {
DebugF("FixKeyState: Key %d %s\n",key,
- (xE->u.u.type==KeyPress?"down":"up"));
+ (((xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress))?"down":"up"));
}
- switch (xE->u.u.type)
- {
- case KeyPress:
+ if (xE->u.u.type == KeyPress || xE->u.u.type == DeviceKeyPress)
*kptr |= bit;
- break;
- case KeyRelease:
+ else if (xE->u.u.type == KeyRelease || xE->u.u.type == DeviceKeyRelease)
*kptr &= ~bit;
- break;
- default:
- FatalError("Impossible keyboard event");
- }
+ else
+ FatalError("Impossible keyboard event");
}
#endif
diff --git a/dix/extension.c b/dix/extension.c
index b765008e8..0e97976db 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -324,7 +324,7 @@ ProcListExtensions(ClientPtr client)
total_length += strlen(extensions[i]->aliases[j]) + 1;
}
reply.length = (total_length + 3) >> 2;
- buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length);
+ buffer = bufptr = (char *)xalloc(total_length);
if (!buffer)
return(BadAlloc);
for (i=0; i<NumExtensions; i++)
@@ -348,7 +348,7 @@ ProcListExtensions(ClientPtr client)
if (reply.length)
{
WriteToClient(client, total_length, buffer);
- DEALLOCATE_LOCAL(buffer);
+ xfree(buffer);
}
return(client->noClientException);
}
diff --git a/dix/gc.c b/dix/gc.c
index 443f6c686..83f48d4e3 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -677,7 +677,7 @@ CreateDefaultTile (GCPtr pGC)
(*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen);
pTile = (PixmapPtr)
(*pGC->pScreen->CreatePixmap)(pGC->pScreen,
- w, h, pGC->depth);
+ w, h, pGC->depth, 0);
pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen);
if (!pTile || !pgcScratch)
{
@@ -1020,7 +1020,7 @@ CreateDefaultStipple(int screenNum)
h = 16;
(* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen);
if (!(pScreen->PixmapPerDepth[0] =
- (*pScreen->CreatePixmap)(pScreen, w, h, 1)))
+ (*pScreen->CreatePixmap)(pScreen, w, h, 1, 0)))
return FALSE;
/* fill stipple with 1 */
tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid;
diff --git a/dix/getevents.c b/dix/getevents.c
index c3af27f7e..d3adecea8 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -95,7 +95,14 @@ set_key_up(DeviceIntPtr pDev, int key_code)
static Bool
key_is_down(DeviceIntPtr pDev, int key_code)
{
- return pDev->key->postdown[key_code >> 3] >> (key_code & 7);
+ return !!(pDev->key->postdown[key_code >> 3] & (1 << (key_code & 7)));
+}
+
+static Bool
+key_autorepeats(DeviceIntPtr pDev, int key_code)
+{
+ return !!(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] &
+ (1 << (key_code & 7)));
}
/**
@@ -444,10 +451,11 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
* FIXME: In theory, if you're repeating with two keyboards in non-XKB,
* you could get unbalanced events here. */
if (type == KeyPress && key_is_down(pDev, key_code)) {
+ /* If autorepeating is disabled either globally or just for that key,
+ * or we have a modifier, don't generate a repeat event. */
if (!pDev->kbdfeed->ctrl.autoRepeat ||
- pDev->key->modifierMap[key_code] ||
- !(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3]
- & (1 << (key_code & 7))))
+ !key_autorepeats(pDev, key_code) ||
+ pDev->key->modifierMap[key_code])
return 0;
#ifdef XKB
diff --git a/dix/globals.c b/dix/globals.c
index f86c6026d..d76b604da 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -136,7 +136,6 @@ Bool screenSaverSuspended = FALSE;
char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
char *defaultTextFont = COMPILEDDEFAULTFONT;
char *defaultCursorFont = COMPILEDCURSORFONT;
-char *rgbPath = RGB_DB;
char *defaultDisplayClass = COMPILEDDISPLAYCLASS;
FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
every compilation of dix code */
diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c
index 70b1ff8f7..905b5fb13 100644
--- a/dix/glyphcurs.c
+++ b/dix/glyphcurs.c
@@ -98,7 +98,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned cha
bzero(pbits, nby);
ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width,
- cm->height, 1);
+ cm->height, 1,
+ CREATE_PIXMAP_USAGE_SCRATCH);
pGC = GetScratchGC(1, pScreen);
if (!ppix || !pGC)
{
diff --git a/dix/grabs.c b/dix/grabs.c
index a42a46f10..85e101c6a 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -378,16 +378,16 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
i++;
if (!i)
return TRUE;
- deletes = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr));
- adds = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr));
- updates = (Mask ***)ALLOCATE_LOCAL(i * sizeof(Mask **));
- details = (Mask **)ALLOCATE_LOCAL(i * sizeof(Mask *));
+ deletes = (GrabPtr *)xalloc(i * sizeof(GrabPtr));
+ adds = (GrabPtr *)xalloc(i * sizeof(GrabPtr));
+ updates = (Mask ***)xalloc(i * sizeof(Mask **));
+ details = (Mask **)xalloc(i * sizeof(Mask *));
if (!deletes || !adds || !updates || !details)
{
- if (details) DEALLOCATE_LOCAL(details);
- if (updates) DEALLOCATE_LOCAL(updates);
- if (adds) DEALLOCATE_LOCAL(adds);
- if (deletes) DEALLOCATE_LOCAL(deletes);
+ if (details) xfree(details);
+ if (updates) xfree(updates);
+ if (adds) xfree(adds);
+ if (deletes) xfree(deletes);
return FALSE;
}
ndels = nadds = nups = 0;
@@ -482,10 +482,10 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
*updates[i] = details[i];
}
}
- DEALLOCATE_LOCAL(details);
- DEALLOCATE_LOCAL(updates);
- DEALLOCATE_LOCAL(adds);
- DEALLOCATE_LOCAL(deletes);
+ xfree(details);
+ xfree(updates);
+ xfree(adds);
+ xfree(deletes);
return ok;
#undef UPDATE
diff --git a/dix/main.c b/dix/main.c
index ca0028a39..543e94c86 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -440,6 +440,8 @@ main(int argc, char *argv[], char *envp[])
}
}
+ NotifyParentProcess();
+
Dispatch();
/* Now free up whatever must be freed */
diff --git a/dix/pixmap.c b/dix/pixmap.c
index 6096cc6b5..82e388cf3 100644
--- a/dix/pixmap.c
+++ b/dix/pixmap.c
@@ -59,7 +59,7 @@ GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth,
pScreen->pScratchPixmap = NULL;
else
/* width and height of 0 means don't allocate any pixmap data */
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
+ pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (pPixmap) {
if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
diff --git a/dix/property.c b/dix/property.c
index 713507a09..3c0eaf1c9 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -135,31 +135,31 @@ ProcRotateProperties(ClientPtr client)
if (!stuff->nAtoms)
return(Success);
atoms = (Atom *) & stuff[1];
- props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr));
+ props = (PropertyPtr *)xalloc(stuff->nAtoms * sizeof(PropertyPtr));
if (!props)
return(BadAlloc);
for (i = 0; i < stuff->nAtoms; i++)
{
if (!ValidAtom(atoms[i])) {
- DEALLOCATE_LOCAL(props);
+ xfree(props);
client->errorValue = atoms[i];
return BadAtom;
}
for (j = i + 1; j < stuff->nAtoms; j++)
if (atoms[j] == atoms[i])
{
- DEALLOCATE_LOCAL(props);
+ xfree(props);
return BadMatch;
}
pProp = FindProperty(pWin, atoms[i]);
if (!pProp) {
- DEALLOCATE_LOCAL(props);
+ xfree(props);
return BadMatch;
}
rc = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, pProp,
DixReadAccess|DixWriteAccess);
if (rc != Success) {
- DEALLOCATE_LOCAL(props);
+ xfree(props);
client->errorValue = atoms[i];
return rc;
}
@@ -182,7 +182,7 @@ ProcRotateProperties(ClientPtr client)
props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms];
}
}
- DEALLOCATE_LOCAL(props);
+ xfree(props);
return Success;
}
@@ -600,7 +600,7 @@ ProcListProperties(ClientPtr client)
numProps++;
}
if (numProps)
- if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom))))
+ if(!(pAtoms = (Atom *)xalloc(numProps * sizeof(Atom))))
return(BadAlloc);
xlpr.type = X_Reply;
@@ -619,7 +619,7 @@ ProcListProperties(ClientPtr client)
{
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
- DEALLOCATE_LOCAL(pAtoms);
+ xfree(pAtoms);
}
return(client->noClientException);
}
diff --git a/dix/resource.c b/dix/resource.c
index 857776dc5..6c1b04dc7 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -492,13 +492,13 @@ RebuildTable(int client)
*/
j = 2 * clientTable[client].buckets;
- tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *));
+ tails = (ResourcePtr **)xalloc(j * sizeof(ResourcePtr *));
if (!tails)
return;
resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr));
if (!resources)
{
- DEALLOCATE_LOCAL(tails);
+ xfree(tails);
return;
}
for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
@@ -521,7 +521,7 @@ RebuildTable(int client)
*tptr = &res->next;
}
}
- DEALLOCATE_LOCAL(tails);
+ xfree(tails);
clientTable[client].buckets *= 2;
xfree(clientTable[client].resources);
clientTable[client].resources = resources;
diff --git a/dix/swaprep.c b/dix/swaprep.c
index 7d3251ae3..91469e17b 100644
--- a/dix/swaprep.c
+++ b/dix/swaprep.c
@@ -101,7 +101,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
CARD32 tmpbuf[1];
/* Allocate as big a buffer as we can... */
- while (!(pbufT = (CARD32 *) ALLOCATE_LOCAL(bufsize)))
+ while (!(pbufT = (CARD32 *) xalloc(bufsize)))
{
bufsize >>= 1;
if (bufsize == 4)
@@ -133,7 +133,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
}
if (pbufT != tmpbuf)
- DEALLOCATE_LOCAL ((char *) pbufT);
+ xfree ((char *) pbufT);
}
/**
@@ -149,7 +149,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
short tmpbuf[2];
/* Allocate as big a buffer as we can... */
- while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize)))
+ while (!(pbufT = (short *) xalloc(bufsize)))
{
bufsize >>= 1;
if (bufsize == 4)
@@ -181,7 +181,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
}
if (pbufT != tmpbuf)
- DEALLOCATE_LOCAL ((char *) pbufT);
+ xfree ((char *) pbufT);
}
@@ -1267,7 +1267,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
{
char *pInfoTBase;
- pInfoTBase = (char *) ALLOCATE_LOCAL(size);
+ pInfoTBase = (char *) xalloc(size);
if (!pInfoTBase)
{
pClient->noClientException = -1;
@@ -1275,7 +1275,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
}
SwapConnSetupInfo(pInfo, pInfoTBase);
(void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
- DEALLOCATE_LOCAL(pInfoTBase);
+ xfree(pInfoTBase);
}
_X_EXPORT void
diff --git a/dix/window.c b/dix/window.c
index 17ab2a7a3..f183aa3b7 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -313,7 +313,7 @@ MakeRootTile(WindowPtr pWin)
int i, j;
pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
- pScreen->rootDepth);
+ pScreen->rootDepth, 0);
pWin->backgroundState = BackgroundPixmap;
pGC = GetScratchGC(pScreen->rootDepth, pScreen);