Integration of DAMAGE-XFIXES branch to trunk
https://freedesktop.org/bugzilla/show_bug.cgi?id=859 Modified Files: dispatch.c dixutils.c events.c window.c
This commit is contained in:
parent
d4a101d4ef
commit
0bca00e120
|
@ -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 $ */
|
/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */
|
||||||
/************************************************************
|
/************************************************************
|
||||||
|
|
||||||
|
@ -132,6 +132,7 @@ extern char *ConnectionInfo;
|
||||||
|
|
||||||
Selection *CurrentSelections;
|
Selection *CurrentSelections;
|
||||||
int NumCurrentSelections;
|
int NumCurrentSelections;
|
||||||
|
CallbackListPtr SelectionCallback = NULL;
|
||||||
|
|
||||||
static ClientPtr grabClient;
|
static ClientPtr grabClient;
|
||||||
#define GrabNone 0
|
#define GrabNone 0
|
||||||
|
@ -463,6 +464,9 @@ Dispatch(void)
|
||||||
client->errorValue, result);
|
client->errorValue, result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef DAMAGEEXT
|
||||||
|
FlushIfCriticalOutputPending ();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
FlushAllOutput();
|
FlushAllOutput();
|
||||||
#ifdef SMART_SCHEDULE
|
#ifdef SMART_SCHEDULE
|
||||||
|
@ -631,7 +635,7 @@ ProcChangeSaveSet(client)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete))
|
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)
|
if (client->noClientException != Success)
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
else
|
else
|
||||||
|
@ -1044,6 +1048,15 @@ ProcSetSelectionOwner(client)
|
||||||
CurrentSelections[i].window = stuff->window;
|
CurrentSelections[i].window = stuff->window;
|
||||||
CurrentSelections[i].pWin = pWin;
|
CurrentSelections[i].pWin = pWin;
|
||||||
CurrentSelections[i].client = (pWin ? client : NullClient);
|
CurrentSelections[i].client = (pWin ? client : NullClient);
|
||||||
|
if (SelectionCallback)
|
||||||
|
{
|
||||||
|
SelectionInfoRec info;
|
||||||
|
|
||||||
|
info.selection = &CurrentSelections[i];
|
||||||
|
info.kind= SelectionSetOwner;
|
||||||
|
CallCallbacks(&SelectionCallback, &info);
|
||||||
|
}
|
||||||
|
|
||||||
return (client->noClientException);
|
return (client->noClientException);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3724,7 +3737,7 @@ void InitClient(client, i, ospriv)
|
||||||
client->lastGC = (GCPtr) NULL;
|
client->lastGC = (GCPtr) NULL;
|
||||||
client->lastGCID = INVALID;
|
client->lastGCID = INVALID;
|
||||||
client->numSaved = 0;
|
client->numSaved = 0;
|
||||||
client->saveSet = (pointer *)NULL;
|
client->saveSet = (SaveSetElt *)NULL;
|
||||||
client->noClientException = Success;
|
client->noClientException = Success;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
client->requestLogIndex = 0;
|
client->requestLogIndex = 0;
|
||||||
|
@ -4057,6 +4070,14 @@ DeleteWindowFromAnySelections(pWin)
|
||||||
for (i = 0; i< NumCurrentSelections; i++)
|
for (i = 0; i< NumCurrentSelections; i++)
|
||||||
if (CurrentSelections[i].pWin == pWin)
|
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].pWin = (WindowPtr)NULL;
|
||||||
CurrentSelections[i].window = None;
|
CurrentSelections[i].window = None;
|
||||||
CurrentSelections[i].client = NullClient;
|
CurrentSelections[i].client = NullClient;
|
||||||
|
@ -4072,6 +4093,14 @@ DeleteClientFromAnySelections(client)
|
||||||
for (i = 0; i< NumCurrentSelections; i++)
|
for (i = 0; i< NumCurrentSelections; i++)
|
||||||
if (CurrentSelections[i].client == client)
|
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].pWin = (WindowPtr)NULL;
|
||||||
CurrentSelections[i].window = None;
|
CurrentSelections[i].window = None;
|
||||||
CurrentSelections[i].client = NullClient;
|
CurrentSelections[i].client = NullClient;
|
||||||
|
|
|
@ -152,6 +152,22 @@ ClientTimeToServerTime(c)
|
||||||
* beware of too-small buffers
|
* 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
|
void
|
||||||
CopyISOLatin1Lowered(dest, source, length)
|
CopyISOLatin1Lowered(dest, source, length)
|
||||||
register unsigned char *dest, *source;
|
register unsigned char *dest, *source;
|
||||||
|
@ -160,19 +176,29 @@ CopyISOLatin1Lowered(dest, source, length)
|
||||||
register int i;
|
register int i;
|
||||||
|
|
||||||
for (i = 0; i < length; i++, source++, dest++)
|
for (i = 0; i < length; i++, source++, dest++)
|
||||||
{
|
*dest = ISOLatin1ToLower (*source);
|
||||||
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;
|
|
||||||
}
|
|
||||||
*dest = '\0';
|
*dest = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
CompareISOLatin1Lowered(unsigned char *s1, int s1len,
|
||||||
|
unsigned char *s2, int s2len)
|
||||||
|
{
|
||||||
|
unsigned char c1, c2;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
return (int) c1 - (int) c2;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef XCSECURITY
|
#ifdef XCSECURITY
|
||||||
|
|
||||||
/* SecurityLookupWindow and SecurityLookupDrawable:
|
/* SecurityLookupWindow and SecurityLookupDrawable:
|
||||||
|
@ -321,13 +347,18 @@ LookupClient(rid, client)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
AlterSaveSetForClient(client, pWin, mode)
|
AlterSaveSetForClient(ClientPtr client,
|
||||||
ClientPtr client;
|
WindowPtr pWin,
|
||||||
WindowPtr pWin;
|
unsigned mode,
|
||||||
unsigned mode;
|
Bool toRoot,
|
||||||
|
Bool remap)
|
||||||
{
|
{
|
||||||
int numnow;
|
int numnow;
|
||||||
|
#ifdef XFIXES
|
||||||
|
SaveSetElt *pTmp = NULL;
|
||||||
|
#else
|
||||||
pointer *pTmp = NULL;
|
pointer *pTmp = NULL;
|
||||||
|
#endif
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
numnow = client->numSaved;
|
numnow = client->numSaved;
|
||||||
|
@ -335,7 +366,7 @@ AlterSaveSetForClient(client, pWin, mode)
|
||||||
if (numnow)
|
if (numnow)
|
||||||
{
|
{
|
||||||
pTmp = client->saveSet;
|
pTmp = client->saveSet;
|
||||||
while ((j < numnow) && (pTmp[j] != (pointer)pWin))
|
while ((j < numnow) && (SaveSetWindow(pTmp[j]) != (pointer)pWin))
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
if (mode == SetModeInsert)
|
if (mode == SetModeInsert)
|
||||||
|
@ -343,12 +374,18 @@ AlterSaveSetForClient(client, pWin, mode)
|
||||||
if (j < numnow) /* duplicate */
|
if (j < numnow) /* duplicate */
|
||||||
return(Success);
|
return(Success);
|
||||||
numnow++;
|
numnow++;
|
||||||
|
#ifdef XFIXES
|
||||||
|
pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(SaveSetElt) * numnow);
|
||||||
|
#else
|
||||||
pTmp = (pointer *)xrealloc(client->saveSet, sizeof(pointer) * numnow);
|
pTmp = (pointer *)xrealloc(client->saveSet, sizeof(pointer) * numnow);
|
||||||
|
#endif
|
||||||
if (!pTmp)
|
if (!pTmp)
|
||||||
return(BadAlloc);
|
return(BadAlloc);
|
||||||
client->saveSet = pTmp;
|
client->saveSet = pTmp;
|
||||||
client->numSaved = numnow;
|
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);
|
return(Success);
|
||||||
}
|
}
|
||||||
else if ((mode == SetModeDelete) && (j < numnow))
|
else if ((mode == SetModeDelete) && (j < numnow))
|
||||||
|
@ -361,15 +398,22 @@ AlterSaveSetForClient(client, pWin, mode)
|
||||||
numnow--;
|
numnow--;
|
||||||
if (numnow)
|
if (numnow)
|
||||||
{
|
{
|
||||||
pTmp = (pointer *)xrealloc(client->saveSet,
|
#ifdef XFIXES
|
||||||
sizeof(pointer) * numnow);
|
pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(SaveSetElt) * numnow);
|
||||||
|
#else
|
||||||
|
pTmp = (pointer *)xrealloc(client->saveSet, sizeof(pointer) * numnow);
|
||||||
|
#endif
|
||||||
if (pTmp)
|
if (pTmp)
|
||||||
client->saveSet = pTmp;
|
client->saveSet = pTmp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xfree(client->saveSet);
|
xfree(client->saveSet);
|
||||||
|
#ifdef XFIXES
|
||||||
|
client->saveSet = (SaveSetElt *)NULL;
|
||||||
|
#else
|
||||||
client->saveSet = (pointer *)NULL;
|
client->saveSet = (pointer *)NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
client->numSaved = numnow;
|
client->numSaved = numnow;
|
||||||
return(Success);
|
return(Success);
|
||||||
|
@ -388,7 +432,7 @@ DeleteWindowFromAnySaveSet(pWin)
|
||||||
{
|
{
|
||||||
client = clients[i];
|
client = clients[i];
|
||||||
if (client && client->numSaved)
|
if (client && client->numSaved)
|
||||||
(void)AlterSaveSetForClient(client, pWin, SetModeDelete);
|
(void)AlterSaveSetForClient(client, pWin, SetModeDelete, FALSE, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 $ */
|
/* $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 spriteTraceSize = 0;
|
||||||
static int spriteTraceGood;
|
static int spriteTraceGood;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int x, y;
|
|
||||||
ScreenPtr pScreen;
|
|
||||||
} HotSpot;
|
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
CursorPtr current;
|
CursorPtr current;
|
||||||
BoxRec hotLimits; /* logical constraints of hot spot */
|
BoxRec hotLimits; /* logical constraints of hot spot */
|
||||||
|
|
24
dix/window.c
24
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 $ */
|
/* $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++)
|
for (j=0; j<client->numSaved; j++)
|
||||||
{
|
{
|
||||||
pWin = (WindowPtr)client->saveSet[j];
|
pWin = SaveSetWindow(client->saveSet[j]);
|
||||||
pParent = pWin->parent;
|
#ifdef XFIXES
|
||||||
while (pParent && (wClient (pParent) == client))
|
if (SaveSetToRoot(client->saveSet[j]))
|
||||||
pParent = pParent->parent;
|
pParent = WindowTable[pWin->drawable.pScreen->myNum];
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
pParent = pWin->parent;
|
||||||
|
while (pParent && (wClient (pParent) == client))
|
||||||
|
pParent = pParent->parent;
|
||||||
|
}
|
||||||
if (pParent)
|
if (pParent)
|
||||||
{
|
{
|
||||||
if (pParent != pWin->parent)
|
if (pParent != pWin->parent)
|
||||||
|
@ -3172,7 +3179,11 @@ HandleSaveSet(client)
|
||||||
}
|
}
|
||||||
xfree(client->saveSet);
|
xfree(client->saveSet);
|
||||||
client->numSaved = 0;
|
client->numSaved = 0;
|
||||||
|
#ifdef XFIXES
|
||||||
|
client->saveSet = (SaveSetElt *)NULL;
|
||||||
|
#else
|
||||||
client->saveSet = (pointer *)NULL;
|
client->saveSet = (pointer *)NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
@ -3227,8 +3238,9 @@ SendVisibilityNotify(pWin)
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
{
|
{
|
||||||
xEvent event;
|
xEvent event;
|
||||||
|
#ifndef NO_XINERAMA_PORT
|
||||||
unsigned int visibility = pWin->visibility;
|
unsigned int visibility = pWin->visibility;
|
||||||
|
#endif
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
/* This is not quite correct yet, but it's close */
|
/* This is not quite correct yet, but it's close */
|
||||||
if(!noPanoramiXExtension) {
|
if(!noPanoramiXExtension) {
|
||||||
|
|
Loading…
Reference in New Issue