diff options
Diffstat (limited to 'dix')
-rw-r--r-- | dix/colormap.c | 22 | ||||
-rw-r--r-- | dix/cursor.c | 12 | ||||
-rw-r--r-- | dix/dispatch.c | 38 | ||||
-rw-r--r-- | dix/dixfonts.c | 6 | ||||
-rw-r--r-- | dix/dixutils.c | 70 | ||||
-rw-r--r-- | dix/events.c | 123 | ||||
-rw-r--r-- | dix/globals.c | 2 | ||||
-rw-r--r-- | dix/main.c | 25 | ||||
-rw-r--r-- | dix/privates.c | 2 | ||||
-rw-r--r-- | dix/resource.c | 4 | ||||
-rw-r--r-- | dix/window.c | 56 |
11 files changed, 306 insertions, 54 deletions
diff --git a/dix/colormap.c b/dix/colormap.c index 306ff941f..28677d53e 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.1.4.4.2.3 2004/03/04 20:16:04 kaleb Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.5 2004/08/13 08:16:14 keithp Exp $ */ /* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */ /*********************************************************** @@ -190,7 +190,14 @@ static void FindColorInRootCmap ( #define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1) #define NUMGREEN(vis) ((vis->greenMask >> vis->offsetGreen) + 1) #define NUMBLUE(vis) ((vis->blueMask >> vis->offsetBlue) + 1) -#define RGBMASK(vis) (vis->redMask | vis->greenMask | vis->blueMask) +#if COMPOSITE +#define ALPHAMASK(vis) ((vis)->nplanes < 32 ? 0 : \ + (CARD32) ~((vis)->redMask|(vis)->greenMask|(vis)->blueMask)) +#else +#define ALPHAMASK(vis) 0 +#endif + +#define RGBMASK(vis) (vis->redMask | vis->greenMask | vis->blueMask | ALPHAMASK(vis)) /* GetNextBitsOrBreak(bits, mask, base) -- * (Suggestion: First read the macro, then read this explanation. @@ -865,7 +872,9 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client) pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP); *pPix = (pixR << pVisual->offsetRed) | (pixG << pVisual->offsetGreen) | - (pixB << pVisual->offsetBlue); + (pixB << pVisual->offsetBlue) | + ALPHAMASK(pVisual); + *pred = pmap->red[pixR].co.local.red; *pgreen = pmap->green[pixG].co.local.green; *pblue = pmap->blue[pixB].co.local.blue; @@ -955,7 +964,8 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client) (void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0); return (BadAlloc); } - *pPix = pixR | pixG | pixB; + *pPix = pixR | pixG | pixB | ALPHAMASK(pVisual); + break; } @@ -1929,6 +1939,10 @@ AllocDirect (client, pmap, c, r, g, b, contig, pixels, prmask, pgmask, pbmask) pmap->numPixelsBlue[client] += npixB; pmap->freeBlue -= npixB; + + for (pDst = pixels; pDst < pixels + c; pDst++) + *pDst |= ALPHAMASK(pmap->pVisual); + DEALLOCATE_LOCAL(ppixBlue); DEALLOCATE_LOCAL(ppixGreen); DEALLOCATE_LOCAL(ppixRed); diff --git a/dix/cursor.c b/dix/cursor.c index fc81a5197..9e0724fb4 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -68,6 +68,10 @@ typedef struct _GlyphShare { static GlyphSharePtr sharedGlyphs = (GlyphSharePtr)NULL; +#ifdef XFIXES +static CARD32 cursorSerial; +#endif + static void FreeCursorBits(CursorBitsPtr bits) { @@ -189,6 +193,10 @@ AllocCursorARGB(psrcbits, pmaskbits, argb, cm, pCurs->bits = bits; pCurs->refcnt = 1; +#ifdef XFIXES + pCurs->serialNumber = ++cursorSerial; + pCurs->name = None; +#endif pCurs->foreRed = foreRed; pCurs->foreGreen = foreGreen; @@ -379,6 +387,10 @@ AllocGlyphCursor(source, sourceChar, mask, maskChar, CheckForEmptyMask(bits); pCurs->bits = bits; pCurs->refcnt = 1; +#ifdef XFIXES + pCurs->serialNumber = ++cursorSerial; + pCurs->name = None; +#endif pCurs->foreRed = foreRed; pCurs->foreGreen = foreGreen; diff --git a/dix/dispatch.c b/dix/dispatch.c index e6602969a..be6f006b4 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.1.4.4.2.3 2004/03/08 00:36:56 alanc Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5 2004/07/31 01:48:27 anholt Exp $ */ /* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ /************************************************************ @@ -132,6 +132,7 @@ extern char *ConnectionInfo; Selection *CurrentSelections; int NumCurrentSelections; +CallbackListPtr SelectionCallback = NULL; static ClientPtr grabClient; #define GrabNone 0 @@ -253,7 +254,7 @@ FlushClientCaches(id) #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ #define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ -Bool SmartScheduleDisable; +Bool SmartScheduleDisable = FALSE; long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; @@ -463,6 +464,9 @@ Dispatch(void) client->errorValue, result); break; } +#ifdef DAMAGEEXT + FlushIfCriticalOutputPending (); +#endif } FlushAllOutput(); #ifdef SMART_SCHEDULE @@ -631,7 +635,7 @@ ProcChangeSaveSet(client) return BadMatch; if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) { - result = AlterSaveSetForClient(client, pWin, stuff->mode); + result = AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); if (client->noClientException != Success) return(client->noClientException); else @@ -1044,6 +1048,14 @@ ProcSetSelectionOwner(client) CurrentSelections[i].window = stuff->window; CurrentSelections[i].pWin = pWin; CurrentSelections[i].client = (pWin ? client : NullClient); + if (SelectionCallback) + { + SelectionInfoRec info; + + info.selection = &CurrentSelections[i]; + info.kind= SelectionSetOwner; + CallCallbacks(&SelectionCallback, &info); + } return (client->noClientException); } else @@ -2117,7 +2129,9 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) Mask plane = 0; char *pBuf; xGetImageReply xgi; +#ifdef XCSECURITY RegionPtr pVisibleRegion = NULL; +#endif if ((format != XYPixmap) && (format != ZPixmap)) { @@ -3724,7 +3738,7 @@ void InitClient(client, i, ospriv) client->lastGC = (GCPtr) NULL; client->lastGCID = INVALID; client->numSaved = 0; - client->saveSet = (pointer *)NULL; + client->saveSet = (SaveSetElt *)NULL; client->noClientException = Success; #ifdef DEBUG client->requestLogIndex = 0; @@ -4057,6 +4071,14 @@ DeleteWindowFromAnySelections(pWin) for (i = 0; i< NumCurrentSelections; i++) if (CurrentSelections[i].pWin == pWin) { + if (SelectionCallback) + { + SelectionInfoRec info; + + info.selection = &CurrentSelections[i]; + info.kind = SelectionWindowDestroy; + CallCallbacks(&SelectionCallback, &info); + } CurrentSelections[i].pWin = (WindowPtr)NULL; CurrentSelections[i].window = None; CurrentSelections[i].client = NullClient; @@ -4072,6 +4094,14 @@ DeleteClientFromAnySelections(client) for (i = 0; i< NumCurrentSelections; i++) if (CurrentSelections[i].client == client) { + if (SelectionCallback) + { + SelectionInfoRec info; + + info.selection = &CurrentSelections[i]; + info.kind = SelectionWindowDestroy; + CallCallbacks(&SelectionCallback, &info); + } CurrentSelections[i].pWin = (WindowPtr)NULL; CurrentSelections[i].window = None; CurrentSelections[i].client = NullClient; diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 98f734f64..595a6bdf3 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.1.4.4.2.4 2004/03/08 00:36:56 alanc Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.2 2004/04/23 19:04:44 eich Exp $ */ /* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.28 2003/11/08 02:02:03 dawes Exp $ */ /************************************************************************ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -23,8 +23,7 @@ SOFTWARE. ************************************************************************/ /* The panoramix components contained the following notice */ -/***************************************************************** - +/* Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -50,7 +49,6 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ - /* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ #define NEED_REPLIES diff --git a/dix/dixutils.c b/dix/dixutils.c index 40f80d348..5bd5841a9 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -152,6 +152,22 @@ ClientTimeToServerTime(c) * beware of too-small buffers */ +static unsigned char +ISOLatin1ToLower (unsigned char source) +{ + unsigned char dest; + if ((source >= XK_A) && (source <= XK_Z)) + dest = source + (XK_a - XK_A); + else if ((source >= XK_Agrave) && (source <= XK_Odiaeresis)) + dest = source + (XK_agrave - XK_Agrave); + else if ((source >= XK_Ooblique) && (source <= XK_Thorn)) + dest = source + (XK_oslash - XK_Ooblique); + else + dest = source; + return dest; +} + + void CopyISOLatin1Lowered(dest, source, length) register unsigned char *dest, *source; @@ -160,17 +176,27 @@ CopyISOLatin1Lowered(dest, source, length) register int i; for (i = 0; i < length; i++, source++, dest++) + *dest = ISOLatin1ToLower (*source); + *dest = '\0'; +} + +int +CompareISOLatin1Lowered(unsigned char *s1, int s1len, + unsigned char *s2, int s2len) +{ + unsigned char c1, c2; + + for (;;) { - if ((*source >= XK_A) && (*source <= XK_Z)) - *dest = *source + (XK_a - XK_A); - else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis)) - *dest = *source + (XK_agrave - XK_Agrave); - else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn)) - *dest = *source + (XK_oslash - XK_Ooblique); - else - *dest = *source; + /* note -- compare against zero so that -1 ignores len */ + c1 = s1len-- ? *s1++ : '\0'; + c2 = s2len-- ? *s2++ : '\0'; + if (!c1 || + (c1 != c2 && + (c1 = ISOLatin1ToLower (c1)) != (c2 = ISOLatin1ToLower (c2)))) + break; } - *dest = '\0'; + return (int) c1 - (int) c2; } #ifdef XCSECURITY @@ -321,13 +347,14 @@ LookupClient(rid, client) int -AlterSaveSetForClient(client, pWin, mode) - ClientPtr client; - WindowPtr pWin; - unsigned mode; +AlterSaveSetForClient(ClientPtr client, + WindowPtr pWin, + unsigned mode, + Bool toRoot, + Bool remap) { int numnow; - pointer *pTmp = NULL; + SaveSetElt *pTmp = NULL; int j; numnow = client->numSaved; @@ -335,7 +362,7 @@ AlterSaveSetForClient(client, pWin, mode) if (numnow) { pTmp = client->saveSet; - while ((j < numnow) && (pTmp[j] != (pointer)pWin)) + while ((j < numnow) && (SaveSetWindow(pTmp[j]) != (pointer)pWin)) j++; } if (mode == SetModeInsert) @@ -343,12 +370,14 @@ AlterSaveSetForClient(client, pWin, mode) if (j < numnow) /* duplicate */ return(Success); numnow++; - pTmp = (pointer *)xrealloc(client->saveSet, sizeof(pointer) * numnow); + pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow); if (!pTmp) return(BadAlloc); client->saveSet = pTmp; client->numSaved = numnow; - client->saveSet[numnow - 1] = (pointer)pWin; + SaveSetAssignWindow(client->saveSet[numnow - 1], pWin); + SaveSetAssignToRoot(client->saveSet[numnow - 1], toRoot); + SaveSetAssignRemap(client->saveSet[numnow - 1], remap); return(Success); } else if ((mode == SetModeDelete) && (j < numnow)) @@ -361,15 +390,14 @@ AlterSaveSetForClient(client, pWin, mode) numnow--; if (numnow) { - pTmp = (pointer *)xrealloc(client->saveSet, - sizeof(pointer) * numnow); + pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow); if (pTmp) client->saveSet = pTmp; } else { xfree(client->saveSet); - client->saveSet = (pointer *)NULL; + client->saveSet = (SaveSetElt *)NULL; } client->numSaved = numnow; return(Success); @@ -388,7 +416,7 @@ DeleteWindowFromAnySaveSet(pWin) { client = clients[i]; if (client && client->numSaved) - (void)AlterSaveSetForClient(client, pWin, SetModeDelete); + (void)AlterSaveSetForClient(client, pWin, SetModeDelete, FALSE, TRUE); } } diff --git a/dix/events.c b/dix/events.c index 11cdca280..17b5d4182 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1,3 +1,4 @@ +/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.6 2004/08/09 02:08:35 kem Exp $ */ /* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */ /************************************************************ @@ -105,6 +106,20 @@ extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); #include "security.h" #endif +#ifdef XEVIE +extern WindowPtr *WindowTable; +extern int xevieFlag; +extern int xevieClientIndex; +extern DeviceIntPtr xeviemouse; +extern DeviceIntPtr xeviekb; +extern Mask xevieMask; +extern Mask xevieFilters[128]; +extern int xevieEventSent; +extern int xevieKBEventSent; +int xeviegrabState = 0; +xEvent *xeviexE; +#endif + #include "XIproto.h" #include "exevents.h" #include "extnsionst.h" @@ -181,11 +196,6 @@ static WindowPtr *spriteTrace = (WindowPtr *)NULL; static int spriteTraceSize = 0; static int spriteTraceGood; -typedef struct { - int x, y; - ScreenPtr pScreen; -} HotSpot; - static struct { CursorPtr current; BoxRec hotLimits; /* logical constraints of hot spot */ @@ -206,6 +216,11 @@ static struct { #endif } sprite; /* info about the cursor sprite */ +#ifdef XEVIE +WindowPtr xeviewin; +HotSpot xeviehot; +#endif + static void DoEnterLeaveEvents( WindowPtr /*fromWin*/, WindowPtr /*toWin*/, @@ -2035,6 +2050,46 @@ WindowsRestructured() (void) CheckMotion((xEvent *)NULL); } +#ifdef PANORAMIX +/* This was added to support reconfiguration under Xdmx. The problem is + * that if the 0th screen (i.e., WindowTable[0]) is moved to an origin + * other than 0,0, the information in the private sprite structure must + * be updated accordingly, or XYToWindow (and other routines) will not + * compute correctly. */ +void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) +{ + ScreenPtr pScreen = win->drawable.pScreen; + GrabPtr grab; + + if (noPanoramiXExtension) return; + + sprite.hot.x -= xoff; + sprite.hot.y -= yoff; + + sprite.hotPhys.x -= xoff; + sprite.hotPhys.y -= yoff; + + sprite.hotLimits.x1 -= xoff; + sprite.hotLimits.y1 -= yoff; + sprite.hotLimits.x2 -= xoff; + sprite.hotLimits.y2 -= yoff; + + if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg1)) + REGION_TRANSLATE(sprite.screen, &sprite.Reg1, xoff, yoff); + if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg2)) + REGION_TRANSLATE(sprite.screen, &sprite.Reg2, xoff, yoff); + + /* FIXME: if we call ConfineCursorToWindow, must we do anything else? */ + if ((grab = inputInfo.pointer->grab) && grab->confineTo) { + if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) + sprite.hotPhys.x = sprite.hotPhys.y = 0; + ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); + } else + ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], + TRUE, FALSE); +} +#endif + void DefineInitialRootWindow(win) register WindowPtr win; @@ -2637,6 +2692,52 @@ ProcessKeyboardEvent (xE, keybd, count) GrabPtr grab = keybd->grab; Bool deactivateGrab = FALSE; register KeyClassPtr keyc = keybd->key; +#ifdef XEVIE + static Window rootWin = 0; + + if(!xeviegrabState && xevieFlag && clients[xevieClientIndex] && + (xevieMask & xevieFilters[xE->u.u.type])) { + key = xE->u.u.detail; + kptr = &keyc->down[key >> 3]; + bit = 1 << (key & 7); + if((xE->u.u.type == KeyPress && (*kptr & bit)) || + (xE->u.u.type == KeyRelease && !(*kptr & bit))) + {} else { +#ifdef XKB + if(!noXkbExtension) + xevieKBEventSent = 0; +#endif + if(!xevieKBEventSent) + { + xeviekb = keybd; + if(!rootWin) { + WindowPtr pWin = xeviewin->parent; + while(pWin) { + if(!pWin->parent) { + rootWin = pWin->drawable.id; + break; + } + pWin = pWin->parent; + }; + } + xE->u.keyButtonPointer.event = xeviewin->drawable.id; + xE->u.keyButtonPointer.root = rootWin; + xE->u.keyButtonPointer.child = (xeviewin->firstChild) ? xeviewin->firstChild-> +drawable.id:0; + xE->u.keyButtonPointer.rootX = xeviehot.x; + xE->u.keyButtonPointer.rootY = xeviehot.y; + xE->u.keyButtonPointer.state = keyc->state; + WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); +#ifdef XKB + if(noXkbExtension) +#endif + return; + }else { + xevieKBEventSent = 0; + } + } + } +#endif if (!syncEvents.playingEvents) { @@ -2782,6 +2883,18 @@ ProcessPointerEvent (xE, mouse, count) #ifdef XKB XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo; #endif +#ifdef XEVIE + if(xevieFlag && clients[xevieClientIndex] && !xeviegrabState && + (xevieMask & xevieFilters[xE->u.u.type])) { + if(xevieEventSent) + xevieEventSent = 0; + else { + xeviemouse = mouse; + WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); + return; + } + } +#endif if (!syncEvents.playingEvents) NoticeTime(xE) diff --git a/dix/globals.c b/dix/globals.c index 0ffedc828..4b62e4867 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/globals.c,v 1.1.4.3.4.2 2004/03/04 20:16:04 kaleb Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/globals.c,v 1.2 2004/04/23 19:04:44 eich Exp $ */ /* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.12tsi Exp $ */ /************************************************************ diff --git a/dix/main.c b/dix/main.c index ed6b6f6e1..0d0842215 100644 --- a/dix/main.c +++ b/dix/main.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 1.1.4.5.2.4 2004/03/08 00:36:56 alanc Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 1.3 2004/06/30 20:06:53 kem Exp $ */ /* $XFree86: xc/programs/Xserver/dix/main.c,v 3.43 2003/10/30 21:21:02 herrb Exp $ */ /*********************************************************** @@ -251,6 +251,8 @@ main(int argc, char *argv[], char *envp[]) display = "0"; + InitGlobals(); + /* Quartz support on Mac OS X requires that the Cocoa event loop be in * the main thread. This allows the X server main to be called again * from another thread. */ @@ -498,6 +500,21 @@ main(int argc, char *argv[], char *envp[]) return(0); } +static int VendorRelease = VENDOR_RELEASE; +static char *VendorString = VENDOR_STRING; + +void +SetVendorRelease(int release) +{ + VendorRelease = release; +} + +void +SetVendorString(char *string) +{ + VendorString = string; +} + static int padlength[4] = {0, 3, 2, 1}; #ifndef PANORAMIX @@ -521,7 +538,7 @@ CreateConnectionBlock() /* Leave off the ridBase and ridMask, these must be sent with connection */ - setup.release = VENDOR_RELEASE; + setup.release = VendorRelease; /* * per-server image and bitmap parameters are defined in Xmd.h */ @@ -533,7 +550,7 @@ CreateConnectionBlock() setup.bitmapBitOrder = screenInfo.bitmapBitOrder; setup.motionBufferSize = NumMotionEvents(); setup.numRoots = screenInfo.numScreens; - setup.nbytesVendor = strlen(VENDOR_STRING); + setup.nbytesVendor = strlen(VendorString); setup.numFormats = screenInfo.numPixmapFormats; setup.maxRequestSize = MAX_REQUEST_SIZE; QueryMinMaxKeyCodes(&setup.minKeyCode, &setup.maxKeyCode); @@ -550,7 +567,7 @@ CreateConnectionBlock() sizesofar = sizeof(xConnSetup); pBuf = ConnectionInfo + sizeof(xConnSetup); - memmove(pBuf, VENDOR_STRING, (int)setup.nbytesVendor); + memmove(pBuf, VendorString, (int)setup.nbytesVendor); sizesofar += setup.nbytesVendor; pBuf += setup.nbytesVendor; i = padlength[setup.nbytesVendor & 3]; diff --git a/dix/privates.c b/dix/privates.c index 64d705e24..672738f29 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -358,7 +358,7 @@ InitCmapPrivFunc initPrivFunc; pColormap->devPrivates = privs; - if (!privs || !(*initPrivFunc)(pColormap)) + if (!privs || !(*initPrivFunc)(pColormap,index)) { colormapPrivateCount--; return -1; diff --git a/dix/resource.c b/dix/resource.c index 7984f01ac..e394fdd57 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -74,7 +74,7 @@ Equipment Corporation. ******************************************************************/ /* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/dix/resource.c,v 1.1.4.4.2.3 2004/03/08 00:36:56 alanc Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/resource.c,v 1.3 2004/04/25 22:42:09 gisburn Exp $ */ /* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ /* Routines to manage various kinds of resources: @@ -559,7 +559,7 @@ FreeResource(id, skipDeleteFuncType) } } if (!gotOne) - FatalError("Freeing resource id=%lX which isn't there", + ErrorF("Freeing resource id=%lX which isn't there.\n", (unsigned long)id); } diff --git a/dix/window.c b/dix/window.c index 36289db5b..6660bfbd6 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.1.4.4.2.3 2004/03/08 00:36:56 alanc Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.6 2004/07/31 08:24:13 anholt Exp $ */ /* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* @@ -291,6 +291,9 @@ SetWindowToDefaults(register WindowPtr pWin) pWin->srcBuffer = DBE_FRONT_BUFFER; pWin->dstBuffer = DBE_FRONT_BUFFER; #endif +#ifdef COMPOSITE + pWin->redirectDraw = 0; +#endif } static void @@ -1661,6 +1664,19 @@ void SetWinSize (pWin) register WindowPtr pWin; { +#ifdef COMPOSITE + if (pWin->redirectDraw) + { + BoxRec box; + + box.x1 = pWin->drawable.x; + box.y1 = pWin->drawable.y; + box.x2 = pWin->drawable.x + pWin->drawable.width; + box.y2 = pWin->drawable.y + pWin->drawable.height; + REGION_RESET (pScreen, &pWin->winSize, &box); + } + else +#endif ClippedRegionFromBox(pWin->parent, &pWin->winSize, pWin->drawable.x, pWin->drawable.y, (int)pWin->drawable.width, @@ -1691,6 +1707,19 @@ SetBorderSize (pWin) if (HasBorder (pWin)) { bw = wBorderWidth (pWin); +#ifdef COMPOSITE + if (pWin->redirectDraw) + { + BoxRec box; + + box.x1 = pWin->drawable.x - bw; + box.y1 = pWin->drawable.y - bw; + box.x2 = pWin->drawable.x + pWin->drawable.width + bw; + box.y2 = pWin->drawable.y + pWin->drawable.height + bw; + REGION_RESET (pScreen, &pWin->borderSize, &box); + } + else +#endif ClippedRegionFromBox(pWin->parent, &pWin->borderSize, pWin->drawable.x - bw, pWin->drawable.y - bw, (int)(pWin->drawable.width + (bw<<1)), @@ -3152,10 +3181,17 @@ HandleSaveSet(client) for (j=0; j<client->numSaved; j++) { - pWin = (WindowPtr)client->saveSet[j]; - pParent = pWin->parent; - while (pParent && (wClient (pParent) == client)) - pParent = pParent->parent; + pWin = SaveSetWindow(client->saveSet[j]); +#ifdef XFIXES + if (SaveSetToRoot(client->saveSet[j])) + pParent = WindowTable[pWin->drawable.pScreen->myNum]; + else +#endif + { + pParent = pWin->parent; + while (pParent && (wClient (pParent) == client)) + pParent = pParent->parent; + } if (pParent) { if (pParent != pWin->parent) @@ -3167,12 +3203,15 @@ HandleSaveSet(client) if(!pWin->realized && pWin->mapped) pWin->mapped = FALSE; } - MapWindow(pWin, client); +#ifdef XFIXES + if (SaveSetRemap (client->saveSet[j])) +#endif + MapWindow(pWin, client); } } xfree(client->saveSet); client->numSaved = 0; - client->saveSet = (pointer *)NULL; + client->saveSet = (SaveSetElt *)NULL; } Bool @@ -3227,8 +3266,9 @@ SendVisibilityNotify(pWin) WindowPtr pWin; { xEvent event; +#ifndef NO_XINERAMA_PORT unsigned int visibility = pWin->visibility; - +#endif #ifdef PANORAMIX /* This is not quite correct yet, but it's close */ if(!noPanoramiXExtension) { |