diff options
-rw-r--r-- | dix/dispatch.c | 35 | ||||
-rw-r--r-- | dix/dixutils.c | 80 | ||||
-rw-r--r-- | dix/events.c | 7 | ||||
-rw-r--r-- | dix/window.c | 24 |
4 files changed, 113 insertions, 33 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index 811e39274..fca0de709 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1,4 +1,4 @@ -/* $XdotOrg$ */ +/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.3 2004/06/21 13:40:25 ago 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 @@ -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,15 @@ 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 @@ -3724,7 +3737,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 +4070,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 +4093,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/dixutils.c b/dix/dixutils.c index 40f80d348..f78497b65 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,18 @@ 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; +#ifdef XFIXES + SaveSetElt *pTmp = NULL; +#else pointer *pTmp = NULL; +#endif int j; numnow = client->numSaved; @@ -335,7 +366,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 +374,18 @@ AlterSaveSetForClient(client, pWin, mode) if (j < numnow) /* duplicate */ return(Success); numnow++; +#ifdef XFIXES + pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(SaveSetElt) * numnow); +#else pTmp = (pointer *)xrealloc(client->saveSet, sizeof(pointer) * numnow); +#endif 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 +398,22 @@ AlterSaveSetForClient(client, pWin, mode) numnow--; if (numnow) { - pTmp = (pointer *)xrealloc(client->saveSet, - sizeof(pointer) * numnow); +#ifdef XFIXES + pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(SaveSetElt) * numnow); +#else + pTmp = (pointer *)xrealloc(client->saveSet, sizeof(pointer) * numnow); +#endif if (pTmp) client->saveSet = pTmp; } else { xfree(client->saveSet); +#ifdef XFIXES + client->saveSet = (SaveSetElt *)NULL; +#else client->saveSet = (pointer *)NULL; +#endif } client->numSaved = numnow; return(Success); @@ -388,7 +432,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 956594d8a..e2664c2e8 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.2 2004/04/23 19:04:44 eich Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.3 2004/06/30 20:06:53 kem Exp $ */ /* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */ /************************************************************ @@ -182,11 +182,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 */ diff --git a/dix/window.c b/dix/window.c index 4c20cd278..005f5fd69 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1,4 +1,4 @@ -/* $XdotOrg$ */ +/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.2 2004/04/23 19:04:44 eich Exp $ */ /* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* @@ -3152,10 +3152,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) @@ -3172,7 +3179,11 @@ HandleSaveSet(client) } xfree(client->saveSet); client->numSaved = 0; +#ifdef XFIXES + client->saveSet = (SaveSetElt *)NULL; +#else client->saveSet = (pointer *)NULL; +#endif } Bool @@ -3227,8 +3238,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) { |