summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
commitadc7f9a4ebdfe11d4cd6de9388b63dfe36450b39 (patch)
tree23eb7becc5360b2cbe16aa8d45529880067f3989 /dix
parent90f1536dd315cd265bfc7ef35058761a65a01734 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'dix')
-rw-r--r--dix/colormap.c44
-rw-r--r--dix/cursor.c7
-rw-r--r--dix/devices.c31
-rw-r--r--dix/dispatch.c19
-rw-r--r--dix/dixfonts.c60
-rw-r--r--dix/dixutils.c36
-rw-r--r--dix/events.c163
-rw-r--r--dix/gc.c9
-rw-r--r--dix/globals.c5
-rw-r--r--dix/grabs.c51
-rw-r--r--dix/main.c43
-rw-r--r--dix/property.c14
-rw-r--r--dix/resource.c23
-rw-r--r--dix/swaprep.c8
-rw-r--r--dix/tables.c8
-rw-r--r--dix/window.c156
16 files changed, 105 insertions, 572 deletions
diff --git a/dix/colormap.c b/dix/colormap.c
index b3d8d1347..af959ed86 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.10 2002/04/14 00:45:54 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.12 2003/11/17 22:20:33 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -66,74 +66,55 @@ extern XID clientErrorValue;
extern int colormapPrivateCount;
static Pixel FindBestPixel(
-#if NeedFunctionPrototypes
EntryPtr /*pentFirst*/,
int /*size*/,
xrgb * /*prgb*/,
int /*channel*/
-#endif
);
static int AllComp(
-#if NeedFunctionPrototypes
EntryPtr /*pent*/,
xrgb * /*prgb*/
-#endif
);
static int RedComp(
-#if NeedFunctionPrototypes
EntryPtr /*pent*/,
xrgb * /*prgb*/
-#endif
);
static int GreenComp(
-#if NeedFunctionPrototypes
EntryPtr /*pent*/,
xrgb * /*prgb*/
-#endif
);
static int BlueComp(
-#if NeedFunctionPrototypes
EntryPtr /*pent*/,
xrgb * /*prgb*/
-#endif
);
static void FreePixels(
-#if NeedFunctionPrototypes
register ColormapPtr /*pmap*/,
register int /*client*/
-#endif
);
static void CopyFree(
-#if NeedFunctionPrototypes
int /*channel*/,
int /*client*/,
ColormapPtr /*pmapSrc*/,
ColormapPtr /*pmapDst*/
-#endif
);
static void FreeCell(
-#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
Pixel /*i*/,
int /*channel*/
-#endif
);
static void UpdateColors(
-#if NeedFunctionPrototypes
ColormapPtr /*pmap*/
-#endif
);
static int AllocDirect(
-#if NeedFunctionPrototypes
int /*client*/,
ColormapPtr /*pmap*/,
int /*c*/,
@@ -145,11 +126,9 @@ static int AllocDirect(
Pixel * /*prmask*/,
Pixel * /*pgmask*/,
Pixel * /*pbmask*/
-#endif
);
static int AllocPseudo(
-#if NeedFunctionPrototypes
int /*client*/,
ColormapPtr /*pmap*/,
int /*c*/,
@@ -158,11 +137,9 @@ static int AllocPseudo(
Pixel * /*pixels*/,
Pixel * /*pmask*/,
Pixel ** /*pppixFirst*/
-#endif
);
static Bool AllocCP(
-#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
EntryPtr /*pentFirst*/,
int /*count*/,
@@ -170,11 +147,9 @@ static Bool AllocCP(
Bool /*contig*/,
Pixel * /*pixels*/,
Pixel * /*pMask*/
-#endif
);
static Bool AllocShared(
-#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
Pixel * /*ppix*/,
int /*c*/,
@@ -185,29 +160,23 @@ static Bool AllocShared(
Pixel /*gmask*/,
Pixel /*bmask*/,
Pixel * /*ppixFirst*/
-#endif
);
static int FreeCo(
-#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
int /*client*/,
int /*color*/,
int /*npixIn*/,
Pixel * /*ppixIn*/,
Pixel /*mask*/
-#endif
);
static int TellNoMap(
-#if NeedFunctionPrototypes
WindowPtr /*pwin*/,
Colormap * /*pmid*/
-#endif
);
static void FindColorInRootCmap (
-#if NeedFunctionPrototypes
ColormapPtr /* pmap */,
EntryPtr /* pentFirst */,
int /* size */,
@@ -215,7 +184,6 @@ static void FindColorInRootCmap (
Pixel* /* pPixel */,
int /* channel */,
ColorCompareProcPtr /* comp */
-#endif
);
#define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1)
@@ -635,7 +603,7 @@ CopyFree (channel, client, pmapSrc, pmapDst)
int channel, client;
ColormapPtr pmapSrc, pmapDst;
{
- int z, npix, oldFree;
+ int z, npix;
EntryPtr pentSrcFirst, pentDstFirst;
EntryPtr pentSrc, pentDst;
Pixel *ppix;
@@ -649,21 +617,18 @@ CopyFree (channel, client, pmapSrc, pmapDst)
npix = (pmapSrc->numPixelsRed)[client];
pentSrcFirst = pmapSrc->red;
pentDstFirst = pmapDst->red;
- oldFree = pmapSrc->freeRed;
break;
case GREENMAP:
ppix = (pmapSrc->clientPixelsGreen)[client];
npix = (pmapSrc->numPixelsGreen)[client];
pentSrcFirst = pmapSrc->green;
pentDstFirst = pmapDst->green;
- oldFree = pmapSrc->freeGreen;
break;
case BLUEMAP:
ppix = (pmapSrc->clientPixelsBlue)[client];
npix = (pmapSrc->numPixelsBlue)[client];
pentSrcFirst = pmapSrc->blue;
pentDstFirst = pmapDst->blue;
- oldFree = pmapSrc->freeBlue;
break;
}
nalloc = 0;
@@ -1146,12 +1111,7 @@ typedef struct _bignum {
((r)->lower = BIGNUMLOWER-1))
static void
-#if NeedFunctionPrototypes
BigNumAdd (BigNumPtr x, BigNumPtr y, BigNumPtr r)
-#else
-BigNumAdd (x, y, r)
- BigNumPtr x, y, r;
-#endif
{
BigNumLower lower, carry = 0;
diff --git a/dix/cursor.c b/dix/cursor.c
index 29a429f34..2ef9e5e24 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.8 2003/01/12 02:44:26 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.9 2003/11/17 22:20:33 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -69,12 +69,7 @@ typedef struct _GlyphShare {
static GlyphSharePtr sharedGlyphs = (GlyphSharePtr)NULL;
static void
-#if NeedFunctionPrototypes
FreeCursorBits(CursorBitsPtr bits)
-#else
-FreeCursorBits(bits)
- CursorBitsPtr bits;
-#endif
{
if (--bits->refcnt > 0)
return;
diff --git a/dix/devices.c b/dix/devices.c
index 7028cd279..46af5eabc 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.20 2001/12/14 19:59:30 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.21 2003/11/17 22:20:33 dawes Exp $ */
/************************************************************
Copyright 1987, 1998 The Open Group
@@ -197,12 +197,7 @@ InitAndStartDevices()
}
static void
-#if NeedFunctionPrototypes
CloseDevice(register DeviceIntPtr dev)
-#else
-CloseDevice(dev)
- register DeviceIntPtr dev;
-#endif
{
KbdFeedbackPtr k, knext;
PtrFeedbackPtr p, pnext;
@@ -501,12 +496,7 @@ SetKeySymsMap(dst, src)
}
static Bool
-#if NeedFunctionPrototypes
InitModMap(register KeyClassPtr keyc)
-#else
-InitModMap(keyc)
- register KeyClassPtr keyc;
-#endif
{
int i, j;
CARD8 keysPerModifier[8];
@@ -1712,17 +1702,10 @@ ProcQueryKeymap(client)
#ifdef AddInputDevice
#undef AddInputDevice
-#if NeedFunctionPrototypes
DevicePtr
AddInputDevice(
DeviceProc deviceProc,
Bool autoStart)
-#else
-DevicePtr
-AddInputDevice(deviceProc, autoStart)
- DeviceProc deviceProc;
- Bool autoStart;
-#endif
{
return (DevicePtr)_AddInputDevice(deviceProc, autoStart);
}
@@ -1731,14 +1714,8 @@ AddInputDevice(deviceProc, autoStart)
#ifdef RegisterPointerDevice
#undef RegisterPointerDevice
-#if NeedFunctionPrototypes
void
RegisterPointerDevice(DevicePtr device)
-#else
-void
-RegisterPointerDevice(device)
- DevicePtr device;
-#endif
{
_RegisterPointerDevice((DeviceIntPtr)device);
}
@@ -1747,14 +1724,8 @@ RegisterPointerDevice(device)
#ifdef RegisterKeyboardDevice
#undef RegisterKeyboardDevice
-#if NeedFunctionPrototypes
void
RegisterKeyboardDevice(DevicePtr device)
-#else
-void
-RegisterKeyboardDevice(device)
- DevicePtr device;
-#endif
{
_RegisterKeyboardDevice((DeviceIntPtr)device);
}
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 24b825e41..cd1ce6790 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -68,7 +68,7 @@ SOFTWARE.
* *
*****************************************************************/
-/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.29 2003/01/12 02:44:26 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.33 2003/11/17 22:20:33 dawes Exp $ */
#ifdef PANORAMIX_DEBUG
#include <stdio.h>
@@ -136,15 +136,11 @@ HWEventQueuePtr checkForInput[2];
extern int connBlockScreenStart;
static void KillAllClients(
-#if NeedFunctionPrototypes
void
-#endif
);
static void DeleteClientFromAnySelections(
-#if NeedFunctionPrototypes
ClientPtr /*client*/
-#endif
);
static int nextFreeClientID; /* always MIN free client ID */
@@ -444,7 +440,7 @@ Dispatch(void)
client->requestLog[client->requestLogIndex] = MAJOROP;
client->requestLogIndex++;
#endif
- if (result > (MAX_BIG_REQUEST_SIZE << 2))
+ if (result > (maxBigRequestSize << 2))
result = BadLength;
else
result = (* client->requestVector[MAJOROP])(client);
@@ -1172,12 +1168,7 @@ ProcGrabServer(client)
}
static void
-#if NeedFunctionPrototypes
UngrabServer(ClientPtr client)
-#else
-UngrabServer(client)
- ClientPtr client;
-#endif
{
int i;
@@ -2226,7 +2217,7 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return)
pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw);
if (pVisibleRegion)
{
- REGION_TRANSLATE(pScreen, pVisibleRegion, -pDraw->x, -pDraw->y);
+ REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y);
}
}
#endif
@@ -2320,7 +2311,7 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return)
}
#ifdef XCSECURITY
if (pVisibleRegion)
- REGION_DESTROY(pScreen, pVisibleRegion);
+ REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
#endif
if (!im_return)
DEALLOCATE_LOCAL(pBuf);
@@ -3297,6 +3288,8 @@ ProcSetScreenSaver (client)
ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND;
else
ScreenSaverInterval = defaultScreenSaverInterval;
+
+ SetScreenSaverTimer();
return (client->noClientException);
}
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 5386c908b..d971260c7 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.27 2003/02/15 03:47:05 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.29 2003/11/17 22:20:34 dawes Exp $ */
/************************************************************************
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
@@ -193,23 +193,13 @@ FontWakeup(data, count, LastSelectMask)
/* XXX -- these two funcs may want to be broken into macros */
static void
-#if NeedFunctionPrototypes
UseFPE(FontPathElementPtr fpe)
-#else
-UseFPE(fpe)
- FontPathElementPtr fpe;
-#endif
{
fpe->refcount++;
}
static void
-#if NeedFunctionPrototypes
FreeFPE (FontPathElementPtr fpe)
-#else
-FreeFPE (fpe)
- FontPathElementPtr fpe;
-#endif
{
fpe->refcount--;
if (fpe->refcount == 0) {
@@ -220,13 +210,7 @@ FreeFPE (fpe)
}
static Bool
-#if NeedFunctionPrototypes
doOpenFont(ClientPtr client, OFclosurePtr c)
-#else
-doOpenFont(client, c)
- ClientPtr client;
- OFclosurePtr c;
-#endif
{
FontPtr pfont = NullFont;
FontPathElementPtr fpe = NULL;
@@ -576,13 +560,7 @@ QueryFont(pFont, pReply, nProtoCCIStructs)
}
static Bool
-#if NeedFunctionPrototypes
doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
-#else
-doListFontsAndAliases(client, c)
- ClientPtr client;
- LFclosurePtr c;
-#endif
{
FontPathElementPtr fpe;
int err = Successful;
@@ -998,7 +976,11 @@ doListFontsWithInfo(client, c)
c->saved = c->current;
c->haveSaved = TRUE;
c->savedNumFonts = numFonts;
- c->savedName = (char *) pFontInfo;
+ if (c->savedName)
+ xfree(c->savedName);
+ c->savedName = (char *)xalloc(namelen + 1);
+ if (c->savedName)
+ memmove(c->savedName, name, namelen + 1);
aliascount = 20;
}
memmove(c->current.pattern, name, namelen);
@@ -1105,6 +1087,7 @@ bail:
FreeFPE(c->fpe_list[i]);
xfree(c->reply);
xfree(c->fpe_list);
+ if (c->savedName) xfree(c->savedName);
xfree(c);
return TRUE;
}
@@ -1155,6 +1138,7 @@ StartListFontsWithInfo(client, length, pattern, max_names)
c->savedNumFonts = 0;
c->haveSaved = FALSE;
c->slept = FALSE;
+ c->savedName = 0;
doListFontsWithInfo(client, c);
return Success;
badAlloc:
@@ -1642,12 +1626,7 @@ ImageText(client, pDraw, pGC, nChars, data, xorg, yorg, reqType, did)
/* does the necessary magic to figure out the fpe type */
static int
-#if NeedFunctionPrototypes
DetermineFPEType(char *pathname)
-#else
-DetermineFPEType(pathname)
- char *pathname;
-#endif
{
int i;
@@ -1660,14 +1639,7 @@ DetermineFPEType(pathname)
static void
-#if NeedFunctionPrototypes
FreeFontPath(FontPathElementPtr *list, int n, Bool force)
-#else
-FreeFontPath(list, n, force)
- FontPathElementPtr *list;
- Bool force;
- int n;
-#endif
{
int i;
@@ -1694,15 +1666,7 @@ FreeFontPath(list, n, force)
}
static FontPathElementPtr
-#if NeedFunctionPrototypes
find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len)
-#else
-find_existing_fpe(list, num, name, len)
- FontPathElementPtr *list;
- int num;
- unsigned char *name;
- int len;
-#endif
{
FontPathElementPtr fpe;
int i;
@@ -1717,15 +1681,7 @@ find_existing_fpe(list, num, name, len)
static int
-#if NeedFunctionPrototypes
SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
-#else
-SetFontPathElements(npaths, paths, bad, persist)
- int npaths;
- unsigned char *paths;
- int *bad;
- Bool persist;
-#endif
{
int i, err = 0;
int valid_paths = 0;
diff --git a/dix/dixutils.c b/dix/dixutils.c
index 7e9bfa4bf..38cfd4e0d 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.13 2003/01/12 02:44:26 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -604,22 +604,13 @@ ProcessWorkQueueZombies(void)
}
Bool
-#if NeedFunctionPrototypes
QueueWorkProc (
Bool (*function)(
-#if NeedNestedPrototypes
ClientPtr /* pClient */,
pointer /* closure */
-#endif
),
ClientPtr client,
pointer closure)
-#else
-QueueWorkProc (function, client, closure)
- Bool (*function)();
- ClientPtr client;
- pointer closure;
-#endif
{
WorkQueuePtr q;
@@ -736,17 +727,10 @@ static int numCallbackListsToCleanup = 0;
static CallbackListPtr **listsToCleanup = NULL;
static Bool
-#if NeedFunctionPrototypes
_AddCallback(
CallbackListPtr *pcbl,
CallbackProcPtr callback,
pointer data)
-#else
-_AddCallback(pcbl, callback, data)
- CallbackListPtr *pcbl;
- CallbackProcPtr callback;
- pointer data;
-#endif
{
CallbackPtr cbr;
@@ -762,17 +746,10 @@ _AddCallback(pcbl, callback, data)
}
static Bool
-#if NeedFunctionPrototypes
_DeleteCallback(
CallbackListPtr *pcbl,
CallbackProcPtr callback,
pointer data)
-#else
-_DeleteCallback(pcbl, callback, data)
- CallbackListPtr *pcbl;
- CallbackProcPtr callback;
- pointer data;
-#endif
{
CallbackListPtr cbl = *pcbl;
CallbackPtr cbr, pcbr;
@@ -805,15 +782,9 @@ _DeleteCallback(pcbl, callback, data)
}
static void
-#if NeedFunctionPrototypes
_CallCallbacks(
CallbackListPtr *pcbl,
pointer call_data)
-#else
-_CallCallbacks(pcbl, call_data)
- CallbackListPtr *pcbl;
- pointer call_data;
-#endif
{
CallbackListPtr cbl = *pcbl;
CallbackPtr cbr, pcbr;
@@ -868,13 +839,8 @@ _CallCallbacks(pcbl, call_data)
}
static void
-#if NeedFunctionPrototypes
_DeleteCallbackList(
CallbackListPtr *pcbl)
-#else
-_DeleteCallbackList(pcbl)
- CallbackListPtr *pcbl;
-#endif
{
CallbackListPtr cbl = *pcbl;
CallbackPtr cbr, nextcbr;
diff --git a/dix/events.c b/dix/events.c
index ce8e53f92..2131b5fd4 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.46 2002/09/17 01:15:09 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.50 2003/11/17 22:20:34 dawes Exp $ */
/************************************************************
Copyright 1987, 1998 The Open Group
@@ -90,11 +90,7 @@ SOFTWARE.
#ifdef XKB
#include "XKBsrv.h"
-#if NeedFunctionPrototypes
extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
-#else
-extern Bool XkbFilterEvents();
-#endif
#endif
#ifdef XCSECURITY
@@ -204,18 +200,14 @@ static struct {
} sprite; /* info about the cursor sprite */
static void DoEnterLeaveEvents(
-#if NeedFunctionPrototypes
WindowPtr /*fromWin*/,
WindowPtr /*toWin*/,
int /*mode*/
-#endif
);
static WindowPtr XYToWindow(
-#if NeedFunctionPrototypes
int /*x*/,
int /*y*/
-#endif
);
extern int lastEvent;
@@ -613,12 +605,7 @@ SetCriticalEvent(event)
}
static void
-#if NeedFunctionPrototypes
SyntheticMotion(int x, int y)
-#else
-SyntheticMotion(x, y)
- int x, y;
-#endif
{
xEvent xE;
@@ -643,13 +630,7 @@ SyntheticMotion(x, y)
#ifdef SHAPE
static void
-#if NeedFunctionPrototypes
ConfineToShape(RegionPtr shape, int *px, int *py)
-#else
-ConfineToShape(shape, px, py)
- RegionPtr shape;
- int *px, *py;
-#endif
{
BoxRec box;
int x = *px, y = *py;
@@ -686,19 +667,11 @@ ConfineToShape(shape, px, py)
#endif
static void
-#if NeedFunctionPrototypes
CheckPhysLimits(
CursorPtr cursor,
Bool generateEvents,
Bool confineToScreen,
ScreenPtr pScreen)
-#else
-CheckPhysLimits(cursor, generateEvents, confineToScreen, pScreen)
- CursorPtr cursor;
- Bool generateEvents;
- Bool confineToScreen;
- ScreenPtr pScreen;
-#endif
{
HotSpot new;
@@ -739,15 +712,9 @@ CheckPhysLimits(cursor, generateEvents, confineToScreen, pScreen)
}
static void
-#if NeedFunctionPrototypes
CheckVirtualMotion(
register QdEventPtr qe,
register WindowPtr pWin)
-#else
-CheckVirtualMotion(qe, pWin)
- register QdEventPtr qe;
- register WindowPtr pWin;
-#endif
{
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
@@ -831,12 +798,7 @@ PointerConfinedToScreen()
}
static void
-#if NeedFunctionPrototypes
ChangeToCursor(CursorPtr cursor)
-#else
-ChangeToCursor(cursor)
- CursorPtr cursor;
-#endif
{
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
@@ -868,11 +830,7 @@ IsParent(a, b)
}
static void
-#if NeedFunctionPrototypes
PostNewCursor(void)
-#else
-PostNewCursor()
-#endif
{
register WindowPtr win;
register GrabPtr grab = inputInfo.pointer->grab;
@@ -942,12 +900,7 @@ XineramaGetCursorScreen()
#define TIMESLOP (5 * 60 * 1000) /* 5 minutes */
static void
-#if NeedFunctionPrototypes
MonthChangedOrBadTime(register xEvent *xE)
-#else
-MonthChangedOrBadTime(xE)
- register xEvent *xE;
-#endif
{
/* If the ddx/OS is careless about not processing timestamped events from
* different sources in sorted order, then it's possible for time to go
@@ -988,6 +941,13 @@ EnqueueEvent(xE, device, count)
xEvent *qxE;
NoticeTime(xE);
+
+#ifdef XKB
+ /* Fix for key repeating bug. */
+ if (xE->u.u.type == KeyRelease)
+ AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail);
+#endif
+
if (DeviceEventCallback)
{
DeviceEventInfoRec eventinfo;
@@ -1048,11 +1008,7 @@ EnqueueEvent(xE, device, count)
}
static void
-#if NeedFunctionPrototypes
PlayReleasedEvents(void)
-#else
-PlayReleasedEvents()
-#endif
{
register QdEventPtr *prev, qe;
register DeviceIntPtr dev;
@@ -1099,13 +1055,7 @@ PlayReleasedEvents()
}
static void
-#if NeedFunctionPrototypes
FreezeThaw(register DeviceIntPtr dev, Bool frozen)
-#else
-FreezeThaw(dev, frozen)
- register DeviceIntPtr dev;
- Bool frozen;
-#endif
{
dev->sync.frozen = frozen;
if (frozen)
@@ -1774,19 +1724,11 @@ MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient)
}
static void
-#if NeedFunctionPrototypes
FixUpEventFromWindow(
xEvent *xE,
WindowPtr pWin,
Window child,
Bool calcChild)
-#else
-FixUpEventFromWindow(xE, pWin, child, calcChild)
- xEvent *xE;
- WindowPtr pWin;
- Window child;
- Bool calcChild;
-#endif
{
if (calcChild)
{
@@ -1970,12 +1912,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
}
static WindowPtr
-#if NeedFunctionPrototypes
XYToWindow(int x, int y)
-#else
-XYToWindow(x, y)
- int x, y;
-#endif
{
register WindowPtr pWin;
@@ -2017,12 +1954,7 @@ XYToWindow(x, y)
}
static Bool
-#if NeedFunctionPrototypes
CheckMotion(xEvent *xE)
-#else
-CheckMotion(xE)
- xEvent *xE;
-#endif
{
WindowPtr prevSpriteWin = sprite.win;
@@ -2123,10 +2055,13 @@ DefineInitialRootWindow(win)
sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
sprite.physLimits = sprite.hotLimits;
sprite.confineWin = NullWindow;
+#ifdef SHAPE
+ sprite.hotShape = NullRegion;
+#endif
sprite.screen = pScreen;
/* gotta UNINIT these someplace */
- REGION_INIT(pScreen, &sprite.Reg1, NullBox, 1);
- REGION_INIT(pScreen, &sprite.Reg2, NullBox, 1);
+ REGION_NULL(pScreen, &sprite.Reg1);
+ REGION_NULL(pScreen, &sprite.Reg2);
}
#endif
}
@@ -2404,19 +2339,11 @@ BorderSizeNotEmpty(WindowPtr pWin)
passive grab set on the window to be activated. */
static Bool
-#if NeedFunctionPrototypes
CheckPassiveGrabsOnWindow(
WindowPtr pWin,
register DeviceIntPtr device,
register xEvent *xE,
int count)
-#else
-CheckPassiveGrabsOnWindow(pWin, device, xE, count)
- WindowPtr pWin;
- register DeviceIntPtr device;
- register xEvent *xE;
- int count;
-#endif
{
register GrabPtr grab = wPassiveGrabs(pWin);
GrabRec tempGrab;
@@ -3150,14 +3077,9 @@ EventSuppressForWindow(pWin, client, mask, checkOptional)
}
static WindowPtr
-#if NeedFunctionPrototypes
CommonAncestor(
register WindowPtr a,
register WindowPtr b)
-#else
-CommonAncestor(a, b)
- register WindowPtr a, b;
-#endif
{
for (b = b->parent; b; b = b->parent)
if (IsParent(b, a)) return b;
@@ -3165,19 +3087,12 @@ CommonAncestor(a, b)
}
static void
-#if NeedFunctionPrototypes
EnterLeaveEvent(
int type,
int mode,
int detail,
register WindowPtr pWin,
Window child)
-#else
-EnterLeaveEvent(type, mode, detail, pWin, child)
- int type, mode, detail;
- register WindowPtr pWin;
- Window child;
-#endif
{
xEvent event;
register DeviceIntPtr keybd = inputInfo.keyboard;
@@ -3258,13 +3173,7 @@ EnterLeaveEvent(type, mode, detail, pWin, child)
}
static void
-#if NeedFunctionPrototypes
EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail)
-#else
-EnterNotifies(ancestor, child, mode, detail)
- WindowPtr ancestor, child;
- int mode, detail;
-#endif
{
WindowPtr parent = child->parent;
@@ -3275,13 +3184,7 @@ EnterNotifies(ancestor, child, mode, detail)
}
static void
-#if NeedFunctionPrototypes
LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail)
-#else
-LeaveNotifies(child, ancestor, mode, detail)
- WindowPtr child, ancestor;
- int detail, mode;
-#endif
{
register WindowPtr pWin;
@@ -3295,13 +3198,7 @@ LeaveNotifies(child, ancestor, mode, detail)
}
static void
-#if NeedFunctionPrototypes
DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode)
-#else
-DoEnterLeaveEvents(fromWin, toWin, mode)
- WindowPtr fromWin, toWin;
- int mode;
-#endif
{
if (fromWin == toWin)
return;
@@ -3329,14 +3226,7 @@ DoEnterLeaveEvents(fromWin, toWin, mode)
}
static void
-#if NeedFunctionPrototypes
FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin)
-#else
-FocusEvent(dev, type, mode, detail, pWin)
- DeviceIntPtr dev;
- int type, mode, detail;
- register WindowPtr pWin;
-#endif
{
xEvent event;
@@ -3377,19 +3267,11 @@ FocusEvent(dev, type, mode, detail, pWin)
* no-op if child not descended from ancestor
*/
static Bool
-#if NeedFunctionPrototypes
FocusInEvents(
DeviceIntPtr dev,
WindowPtr ancestor, WindowPtr child, WindowPtr skipChild,
int mode, int detail,
Bool doAncestor)
-#else
-FocusInEvents(dev, ancestor, child, skipChild, mode, detail, doAncestor)
- DeviceIntPtr dev;
- WindowPtr ancestor, child, skipChild;
- int mode, detail;
- Bool doAncestor;
-#endif
{
if (child == NullWindow)
return ancestor == NullWindow;
@@ -3411,20 +3293,11 @@ FocusInEvents(dev, ancestor, child, skipChild, mode, detail, doAncestor)
/* dies horribly if ancestor is not an ancestor of child */
static void
-#if NeedFunctionPrototypes
FocusOutEvents(
DeviceIntPtr dev,
WindowPtr child, WindowPtr ancestor,
int mode, int detail,
Bool doAncestor)
-#else
-FocusOutEvents(dev, child, ancestor, mode, detail, doAncestor)
- DeviceIntPtr dev;
- WindowPtr child, ancestor;
- int mode;
- int detail;
- Bool doAncestor;
-#endif
{
register WindowPtr pWin;
@@ -3564,7 +3437,6 @@ DoFocusEvents(dev, fromWin, toWin, mode)
}
int
-#if NeedFunctionPrototypes
SetInputFocus(
ClientPtr client,
DeviceIntPtr dev,
@@ -3572,15 +3444,6 @@ SetInputFocus(
CARD8 revertTo,
Time ctime,
Bool followOK)
-#else
-SetInputFocus(client, dev, focusID, revertTo, ctime, followOK)
- ClientPtr client;
- DeviceIntPtr dev;
- Window focusID;
- CARD8 revertTo;
- Time ctime;
- Bool followOK;
-#endif
{
register FocusClassPtr focus;
register WindowPtr focusWin;
diff --git a/dix/gc.c b/dix/gc.c
index 6ab685d6c..11f215c8d 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.9 2001/12/14 19:59:32 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.10 2003/11/17 22:20:34 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -66,9 +66,7 @@ extern XID clientErrorValue;
extern FontPtr defaultFont;
static Bool CreateDefaultTile(
-#if NeedFunctionPrototypes
GCPtr /*pGC*/
-#endif
);
unsigned char DefaultDash[2] = {4, 4};
@@ -585,12 +583,7 @@ BUG:
*/
static GCPtr
-#if NeedFunctionPrototypes
AllocateGC(ScreenPtr pScreen)
-#else
-AllocateGC(pScreen)
- ScreenPtr pScreen;
-#endif
{
GCPtr pGC;
register char *ptr;
diff --git a/dix/globals.c b/dix/globals.c
index 3051ebbbb..1ec71aac1 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.10 2002/10/08 23:55:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.12 2003/11/10 18:21:46 tsi Exp $ */
/************************************************************
Copyright 1987, 1998 The Open Group
@@ -79,6 +79,7 @@ PtrCtrl defaultPointerControl = {
ClientPtr *clients;
ClientPtr serverClient;
int currentMaxClients; /* current size of clients array */
+long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
WindowPtr *WindowTable;
@@ -146,3 +147,5 @@ int argcGlobal;
char **argvGlobal;
DDXPointRec dixScreenOrigins[MAXSCREENS];
+
+volatile ScreenPtr currentRegionScreen;
diff --git a/dix/grabs.c b/dix/grabs.c
index bebbd3bec..7a9fbcdb5 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -46,7 +46,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.4 2002/02/19 11:09:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.5 2003/11/17 22:20:34 dawes Exp $ */
#include "X.h"
#include "misc.h"
@@ -65,7 +65,6 @@ SOFTWARE.
#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i))
GrabPtr
-#if NeedFunctionPrototypes
CreateGrab(
int client,
DeviceIntPtr device,
@@ -78,21 +77,6 @@ CreateGrab(
KeyCode keybut, /* key or button */
WindowPtr confineTo,
CursorPtr cursor)
-#else
-CreateGrab(client, device, window, eventMask, ownerEvents, keyboardMode,
- pointerMode, modDevice, modifiers, type, keybut, confineTo, cursor)
- int client;
- DeviceIntPtr device;
- WindowPtr window;
- Mask eventMask;
- Bool ownerEvents, keyboardMode, pointerMode;
- DeviceIntPtr modDevice;
- unsigned short modifiers;
- int type;
- KeyCode keybut; /* key or button */
- WindowPtr confineTo;
- CursorPtr cursor;
-#endif
{
GrabPtr grab;
@@ -125,12 +109,7 @@ CreateGrab(client, device, window, eventMask, ownerEvents, keyboardMode,
}
static void
-#if NeedFunctionPrototypes
FreeGrab(GrabPtr pGrab)
-#else
-FreeGrab(pGrab)
- GrabPtr pGrab;
-#endif
{
if (pGrab->modifiersDetail.pMask != NULL)
xfree(pGrab->modifiersDetail.pMask);
@@ -173,13 +152,7 @@ DeletePassiveGrab(value, id)
}
static Mask *
-#if NeedFunctionPrototypes
DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail)
-#else
-DeleteDetailFromMask(pDetailMask, detail)
- Mask *pDetailMask;
- unsigned short detail;
-#endif
{
register Mask *mask;
register int i;
@@ -199,16 +172,10 @@ DeleteDetailFromMask(pDetailMask, detail)
}
static Bool
-#if NeedFunctionPrototypes
IsInGrabMask(
DetailRec firstDetail,
DetailRec secondDetail,
unsigned short exception)
-#else
-IsInGrabMask(firstDetail, secondDetail, exception)
- DetailRec firstDetail, secondDetail;
- unsigned short exception;
-#endif
{
if (firstDetail.exact == exception)
{
@@ -227,15 +194,10 @@ IsInGrabMask(firstDetail, secondDetail, exception)
}
static Bool
-#if NeedFunctionPrototypes
IdenticalExactDetails(
unsigned short firstExact,
unsigned short secondExact,
unsigned short exception)
-#else
-IdenticalExactDetails(firstExact, secondExact, exception)
- unsigned short firstExact, secondExact, exception;
-#endif
{
if ((firstExact == exception) || (secondExact == exception))
return FALSE;
@@ -247,16 +209,10 @@ IdenticalExactDetails(firstExact, secondExact, exception)
}
static Bool
-#if NeedFunctionPrototypes
DetailSupersedesSecond(
DetailRec firstDetail,
DetailRec secondDetail,
unsigned short exception)
-#else
-DetailSupersedesSecond(firstDetail, secondDetail, exception)
- DetailRec firstDetail, secondDetail;
- unsigned short exception;
-#endif
{
if (IsInGrabMask(firstDetail, secondDetail, exception))
return TRUE;
@@ -269,12 +225,7 @@ DetailSupersedesSecond(firstDetail, secondDetail, exception)
}
static Bool
-#if NeedFunctionPrototypes
GrabSupersedesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
-#else
-GrabSupersedesSecond(pFirstGrab, pSecondGrab)
- GrabPtr pFirstGrab, pSecondGrab;
-#endif
{
if (!DetailSupersedesSecond(pFirstGrab->modifiersDetail,
pSecondGrab->modifiersDetail,
diff --git a/dix/main.c b/dix/main.c
index a31f33d8a..37add2a62 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.40 2003/02/17 16:55:31 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.44 2003/11/17 22:20:34 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -106,15 +106,11 @@ SOFTWARE.
#endif
extern int InitClientPrivates(
-#if NeedFunctionPrototypes
ClientPtr /*client*/
-#endif
);
extern void Dispatch(
-#if NeedFunctionPrototypes
void
-#endif
);
char *ConnectionInfo;
@@ -151,11 +147,9 @@ NotImplemented(xEvent *from, xEvent *to)
/*ARGSUSED*/
void
ReplyNotSwappd(
-#if NeedNestedPrototypes
ClientPtr pClient ,
int size ,
void * pbuf
-#endif
)
{
FatalError("Not implemented");
@@ -319,8 +313,8 @@ main(int argc, char *argv[], char *envp[])
}
else
ResetWellKnownSockets ();
- clients[0] = serverClient;
- currentMaxClients = 1;
+ clients[0] = serverClient;
+ currentMaxClients = 1;
if (!InitClientResources(serverClient)) /* for root resources */
FatalError("couldn't init server resources");
@@ -418,8 +412,11 @@ main(int argc, char *argv[], char *envp[])
for (i = 0; i < screenInfo.numScreens; i++)
InitRootWindow(WindowTable[i]);
- DefineInitialRootWindow(WindowTable[0]);
+ DefineInitialRootWindow(WindowTable[0]);
SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset);
+#ifdef DPMSExtension
+ SetDPMSTimers();
+#endif
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
@@ -437,6 +434,7 @@ main(int argc, char *argv[], char *envp[])
/* Now free up whatever must be freed */
if (screenIsSaved == SCREEN_SAVER_ON)
SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset);
+ FreeScreenSaverTimer();
CloseDownExtensions();
#ifdef PANORAMIX
@@ -463,7 +461,12 @@ main(int argc, char *argv[], char *envp[])
CloseDownEvents();
xfree(WindowTable);
WindowTable = NULL;
- FreeFonts ();
+ FreeFonts();
+
+#ifdef DPMSExtension
+ FreeDPMSTimers();
+#endif
+ FreeAuditTimer();
xfree(serverClient->devPrivates);
serverClient->devPrivates = NULL;
@@ -471,7 +474,12 @@ main(int argc, char *argv[], char *envp[])
if (dispatchException & DE_TERMINATE)
{
CloseWellKnownConnections();
- OsCleanup();
+ }
+
+ OsCleanup((dispatchException & DE_TERMINATE) != 0);
+
+ if (dispatchException & DE_TERMINATE)
+ {
ddxGiveUp();
break;
}
@@ -540,7 +548,7 @@ CreateConnectionBlock()
i = padlength[setup.nbytesVendor & 3];
sizesofar += i;
while (--i >= 0)
- *pBuf++ = 0;
+ *pBuf++ = 0;
for (i=0; i<screenInfo.numPixmapFormats; i++)
{
@@ -634,24 +642,15 @@ with its screen number, a pointer to its ScreenRec, argc, and argv.
*/
int
-#if NeedFunctionPrototypes
AddScreen(
Bool (* pfnInit)(
-#if NeedNestedPrototypes
int /*index*/,
ScreenPtr /*pScreen*/,
int /*argc*/,
char ** /*argv*/
-#endif
),
int argc,
char **argv)
-#else
-AddScreen(pfnInit, argc, argv)
- Bool (* pfnInit)();
- int argc;
- char **argv;
-#endif
{
int i;
diff --git a/dix/property.c b/dix/property.c
index ba12faffe..1af6156b5 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.13 2003/07/16 01:38:37 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -66,11 +66,13 @@ SOFTWARE.
#endif
#if defined(LBX) || defined(LBX_COMPAT)
+#if 0 /* no header in X11 environment, not used in X11 environment */
int fWriteToClient(ClientPtr client, int len, char *buf)
{
return WriteToClient(client, len, buf);
}
#endif
+#endif
/*****************************************************************
* Property Stuff
@@ -467,11 +469,11 @@ DeleteAllWindowProperties(pWin)
}
static int
-NullPropertyReply(client, propertyType, format, reply)
- ClientPtr client;
- ATOM propertyType;
- int format;
- xGetPropertyReply *reply;
+NullPropertyReply(
+ ClientPtr client,
+ ATOM propertyType,
+ int format,
+ xGetPropertyReply *reply)
{
reply->nItems = 0;
reply->length = 0;
diff --git a/dix/resource.c b/dix/resource.c
index d17586a77..d885c03ef 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -72,7 +72,7 @@ SOFTWARE.
* 1, and an otherwise arbitrary ID in the low 22 bits, we can create a
* resource "owned" by the client.
*/
-/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.12 2002/03/06 21:13:38 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */
#define NEED_EVENTS
#include "X.h"
@@ -95,9 +95,7 @@ SOFTWARE.
#include <assert.h>
static void RebuildTable(
-#if NeedFunctionPrototypes
int /*client*/
-#endif
);
#define SERVER_MINID 32
@@ -253,13 +251,7 @@ InitClientResources(client)
static int
-#if NeedFunctionPrototypes
Hash(int client, register XID id)
-#else
-Hash(client, id)
- int client;
- register XID id;
-#endif
{
id &= RESOURCE_ID_MASK;
switch (clientTable[client].hashsize)
@@ -281,17 +273,11 @@ Hash(client, id)
}
static XID
-#if NeedFunctionPrototypes
AvailableID(
register int client,
register XID id,
register XID maxid,
register XID goodid)
-#else
-AvailableID(client, id, maxid, goodid)
- register int client;
- register XID id, maxid, goodid;
-#endif
{
register ResourcePtr res;
@@ -427,8 +413,8 @@ AddResource(id, type, value)
rrec = &clientTable[client];
if (!rrec->buckets)
{
- ErrorF("AddResource(%x, %x, %x), client=%d \n",
- id, type, (unsigned long)value, client);
+ ErrorF("AddResource(%lx, %lx, %lx), client=%d \n",
+ (unsigned long)id, type, (unsigned long)value, client);
FatalError("client not in use\n");
}
if ((rrec->elements >= 4*rrec->buckets) &&
@@ -546,7 +532,8 @@ FreeResource(id, skipDeleteFuncType)
}
}
if (!gotOne)
- FatalError("Freeing resource id=%X which isn't there", id);
+ FatalError("Freeing resource id=%lX which isn't there",
+ (unsigned long)id);
}
diff --git a/dix/swaprep.c b/dix/swaprep.c
index e16f7c53f..494471730 100644
--- a/dix/swaprep.c
+++ b/dix/swaprep.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.7 2001/12/14 19:59:33 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.8 2003/11/17 22:20:35 dawes Exp $ */
/************************************************************
Copyright 1987, 1998 The Open Group
@@ -60,23 +60,17 @@ SOFTWARE.
#include "globals.h"
static void SwapFontInfo(
-#if NeedFunctionPrototypes
xQueryFontReply * /* pr */
-#endif
);
#ifndef LBX
static void SwapCharInfo(
-#if NeedFunctionPrototypes
xCharInfo * /* pInfo */
-#endif
);
static void SwapFont(
-#if NeedFunctionPrototypes
xQueryFontReply * /* pr */,
Bool /* hasGlyphs */
-#endif
);
#endif
diff --git a/dix/tables.c b/dix/tables.c
index 7f42c005d..a76bc7535 100644
--- a/dix/tables.c
+++ b/dix/tables.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.5 2002/02/19 11:09:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.6 2003/11/17 22:20:35 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -65,9 +65,7 @@ extern int
#endif
int (* InitialVector[3]) (
-#if NeedNestedPrototypes
ClientPtr /* client */
-#endif
) =
{
0,
@@ -76,9 +74,7 @@ int (* InitialVector[3]) (
};
int (* ProcVector[256]) (
-#if NeedNestedPrototypes
ClientPtr /* client */
-#endif
) =
{
ProcBadRequest,
@@ -212,9 +208,7 @@ int (* ProcVector[256]) (
};
int (* SwappedProcVector[256]) (
-#if NeedNestedPrototypes
ClientPtr /* client */
-#endif
) =
{
ProcBadRequest,
diff --git a/dix/window.c b/dix/window.c
index 30c0df032..0ed9cb083 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -70,7 +70,7 @@ SOFTWARE.
* *
*****************************************************************/
-/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.32 2003/01/12 02:44:26 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.37 2003/11/17 22:20:35 dawes Exp $ */
#include "misc.h"
#include "scrnintstr.h"
@@ -100,13 +100,6 @@ SOFTWARE.
#include "security.h"
#endif
-#if defined(NEED_SCREEN_REGIONS)
-#define REGION_PTR(pScreen,pWin) \
- register ScreenPtr pScreen = pWin->drawable.pScreen;
-#else
-#define REGION_PTR(pScreen,pWin) /* nothing */
-#endif
-
/******
* Window stuff for server
*
@@ -132,10 +125,8 @@ extern void RecalculateDeliverableEvents();
#endif
static Bool TileScreenSaver(
-#if NeedFunctionPrototypes
int /*i*/,
int /*kind*/
-#endif
);
@@ -260,12 +251,7 @@ Bool enableBackingStore = FALSE;
Bool disableSaveUnders = FALSE;
static void
-#if NeedFunctionPrototypes
SetWindowToDefaults(register WindowPtr pWin)
-#else
-SetWindowToDefaults(pWin)
- register WindowPtr pWin;
-#endif
{
pWin->prevSib = NullWindow;
pWin->firstChild = NullWindow;
@@ -300,12 +286,7 @@ SetWindowToDefaults(pWin)
}
static void
-#if NeedFunctionPrototypes
MakeRootTile(WindowPtr pWin)
-#else
-MakeRootTile(pWin)
- WindowPtr pWin;
-#endif
{
ScreenPtr pScreen = pWin->drawable.pScreen;
GCPtr pGC;
@@ -500,9 +481,8 @@ void
InitRootWindow(pWin)
WindowPtr pWin;
{
- ScreenPtr pScreen;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
- pScreen = pWin->drawable.pScreen;
if (!(*pScreen->CreateWindow)(pWin))
return; /* XXX */
(*pScreen->PositionWindow)(pWin, 0, 0);
@@ -532,7 +512,7 @@ ClippedRegionFromBox(pWin, Rgn, x, y, w, h)
register int x, y;
int w, h;
{
- REGION_PTR(pScreen, pWin)
+ ScreenPtr pScreen = pWin->drawable.pScreen;
BoxRec box;
box = *(REGION_EXTENTS(pScreen, &pWin->winSize));
@@ -744,10 +724,10 @@ CreateWindow(wid, pParent, x, y, w, h, bw, class, vmask, vlist,
pWin->drawable.y = pParent->drawable.y + y + (int)bw;
/* set up clip list correctly for unobscured WindowPtr */
- REGION_INIT(pScreen, &pWin->clipList, NullBox, 1);
- REGION_INIT(pScreen, &pWin->borderClip, NullBox, 1);
- REGION_INIT(pScreen, &pWin->winSize, NullBox, 1);
- REGION_INIT(pScreen, &pWin->borderSize, NullBox, 1);
+ REGION_NULL(pScreen, &pWin->clipList);
+ REGION_NULL(pScreen, &pWin->borderClip);
+ REGION_NULL(pScreen, &pWin->winSize);
+ REGION_NULL(pScreen, &pWin->borderSize);
pHead = RealChildHead(pParent);
if (pHead)
@@ -820,12 +800,7 @@ CreateWindow(wid, pParent, x, y, w, h, bw, class, vmask, vlist,
}
static void
-#if NeedFunctionPrototypes
FreeWindowResources(register WindowPtr pWin)
-#else
-FreeWindowResources(pWin)
- register WindowPtr pWin;
-#endif
{
register ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -854,12 +829,7 @@ FreeWindowResources(pWin)
}
static void
-#if NeedFunctionPrototypes
CrushTree(WindowPtr pWin)
-#else
-CrushTree(pWin)
- WindowPtr pWin;
-#endif
{
register WindowPtr pChild, pSib, pParent;
UnrealizeWindowProcPtr UnrealizeWindow;
@@ -1513,7 +1483,7 @@ PatchUp:
{
RegionRec exposed;
- REGION_INIT(pScreen, &exposed, NullBox, 0);
+ REGION_NULL(pScreen, &exposed);
REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize);
(*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER);
REGION_UNINIT(pScreen, &exposed);
@@ -1637,6 +1607,17 @@ MoveWindowInStack(pWin, pNextSib)
(*pWin->drawable.pScreen->RestackWindow)(pWin, pOldNextSib);
}
+#ifdef ROOTLESS
+ /*
+ * In rootless mode we can't optimize away window restacks.
+ * There may be non-X windows around, so even if the window
+ * is in the correct position from X's point of view,
+ * the underlying window system may want to reorder it.
+ */
+ else if (pWin->drawable.pScreen->RestackWindow)
+ (*pWin->drawable.pScreen->RestackWindow)(pWin, pWin->nextSib);
+#endif
+
return( pFirstChange );
}
@@ -1654,7 +1635,7 @@ CreateUnclippedWinSize (pWin)
pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1);
#ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) {
- REGION_PTR(pScreen, pWin)
+ ScreenPtr pScreen = pWin->drawable.pScreen;
REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x,
- pWin->drawable.y);
@@ -1678,7 +1659,7 @@ SetWinSize (pWin)
(int)pWin->drawable.height);
#ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) {
- REGION_PTR(pScreen, pWin)
+ ScreenPtr pScreen = pWin->drawable.pScreen;
REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x,
- pWin->drawable.y);
@@ -1708,7 +1689,7 @@ SetBorderSize (pWin)
(int)(pWin->drawable.height + (bw<<1)));
#ifdef SHAPE
if (wBoundingShape (pWin)) {
- REGION_PTR(pScreen, pWin)
+ ScreenPtr pScreen = pWin->drawable.pScreen;
REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x,
- pWin->drawable.y);
@@ -1876,14 +1857,9 @@ ResizeChildrenWinSize(pWin, dx, dy, dw, dh)
*/
static int
-#if NeedFunctionPrototypes
IsSiblingAboveMe(
register WindowPtr pMe,
register WindowPtr pSib)
-#else
-IsSiblingAboveMe(pMe, pSib)
- register WindowPtr pMe, pSib;
-#endif
{
register WindowPtr pWin;
@@ -1900,15 +1876,9 @@ IsSiblingAboveMe(pMe, pSib)
}
static BoxPtr
-#if NeedFunctionPrototypes
WindowExtents(
register WindowPtr pWin,
register BoxPtr pBox)
-#else
-WindowExtents(pWin, pBox)
- register WindowPtr pWin;
- register BoxPtr pBox;
-#endif
{
pBox->x1 = pWin->drawable.x - wBorderWidth (pWin);
pBox->y1 = pWin->drawable.y - wBorderWidth (pWin);
@@ -1923,18 +1893,12 @@ WindowExtents(pWin, pBox)
#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL)
static RegionPtr
-#if NeedFunctionPrototypes
MakeBoundingRegion (
register WindowPtr pWin,
BoxPtr pBox)
-#else
-MakeBoundingRegion (pWin, pBox)
- register WindowPtr pWin;
- BoxPtr pBox;
-#endif
{
RegionPtr pRgn;
- REGION_PTR(pScreen, pWin)
+ ScreenPtr pScreen = pWin->drawable.pScreen;
pRgn = REGION_CREATE(pScreen, pBox, 1);
if (wBoundingShape (pWin)) {
@@ -1948,17 +1912,11 @@ MakeBoundingRegion (pWin, pBox)
}
static Bool
-#if NeedFunctionPrototypes
ShapeOverlap (
WindowPtr pWin,
BoxPtr pWinBox,
WindowPtr pSib,
BoxPtr pSibBox)
-#else
-ShapeOverlap (pWin, pWinBox, pSib, pSibBox)
- WindowPtr pWin, pSib;
- BoxPtr pWinBox, pSibBox;
-#endif
{
RegionPtr pWinRgn, pSibRgn;
register ScreenPtr pScreen;
@@ -1978,16 +1936,10 @@ ShapeOverlap (pWin, pWinBox, pSib, pSibBox)
#endif
static Bool
-#if NeedFunctionPrototypes
AnyWindowOverlapsMe(
WindowPtr pWin,
WindowPtr pHead,
register BoxPtr box)
-#else
-AnyWindowOverlapsMe(pWin, pHead, box)
- WindowPtr pWin, pHead;
- register BoxPtr box;
-#endif
{
register WindowPtr pSib;
BoxRec sboxrec;
@@ -2010,15 +1962,9 @@ AnyWindowOverlapsMe(pWin, pHead, box)
}
static Bool
-#if NeedFunctionPrototypes
IOverlapAnyWindow(
WindowPtr pWin,
register BoxPtr box)
-#else
-IOverlapAnyWindow(pWin, box)
- WindowPtr pWin;
- register BoxPtr box;
-#endif
{
register WindowPtr pSib;
BoxRec sboxrec;
@@ -2069,7 +2015,6 @@ IOverlapAnyWindow(pWin, box)
*/
static WindowPtr
-#if NeedFunctionPrototypes
WhereDoIGoInTheStack(
register WindowPtr pWin,
register WindowPtr pSib,
@@ -2078,13 +2023,6 @@ WhereDoIGoInTheStack(
unsigned short w,
unsigned short h,
int smode)
-#else
-WhereDoIGoInTheStack(pWin, pSib, x, y, w, h, smode)
- register WindowPtr pWin, pSib;
- short x, y;
- unsigned short w, h;
- int smode;
-#endif
{
BoxRec box;
register ScreenPtr pScreen;
@@ -2183,21 +2121,14 @@ WhereDoIGoInTheStack(pWin, pSib, x, y, w, h, smode)
}
static void
-#if NeedFunctionPrototypes
ReflectStackChange(
register WindowPtr pWin,
register WindowPtr pSib,
VTKind kind)
-#else
-ReflectStackChange(pWin, pSib, kind)
- register WindowPtr pWin, pSib;
- VTKind kind;
-#endif
{
/* Note that pSib might be NULL */
Bool WasViewable = (Bool)pWin->viewable;
- WindowPtr pParent;
Bool anyMarked;
WindowPtr pFirstChange;
#ifdef DO_SAVE_UNDERS
@@ -2207,8 +2138,8 @@ ReflectStackChange(pWin, pSib, kind)
ScreenPtr pScreen = pWin->drawable.pScreen;
/* if this is a root window, can't be restacked */
- if (!(pParent = pWin->parent))
- return ;
+ if (!pWin->parent)
+ return;
pFirstChange = MoveWindowInStack(pWin, pSib);
@@ -2456,7 +2387,10 @@ ConfigureWindow(pWin, mask, vlist, client)
goto ActuallyDoSomething;
if (mask & CWStackMode)
{
+#ifndef ROOTLESS
+ /* See above for why we always reorder in rootless mode. */
if (pWin->nextSib != pSib)
+#endif
goto ActuallyDoSomething;
}
return(Success);
@@ -2588,15 +2522,9 @@ CirculateWindow(pParent, direction, client)
}
static int
-#if NeedFunctionPrototypes
CompareWIDs(
WindowPtr pWin,
pointer value) /* must conform to VisitWindowProcPtr */
-#else
-CompareWIDs(pWin, value)
- WindowPtr pWin;
- pointer value; /* must conform to VisitWindowProcPtr */
-#endif
{
Window *wid = (Window *)value;
@@ -2705,12 +2633,7 @@ ReparentWindow(pWin, pParent, x, y, client)
}
static void
-#if NeedFunctionPrototypes
RealizeTree(WindowPtr pWin)
-#else
-RealizeTree(pWin)
- WindowPtr pWin;
-#endif
{
register WindowPtr pChild;
RealizeWindowProcPtr Realize;
@@ -2862,7 +2785,7 @@ MapWindow(pWin, client)
(*pScreen->ClipNotify) (pWin, 0, 0);
if (pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(NullWindow, pWin, VTMap);
- REGION_INIT(pScreen, &temp, NullBox, 0);
+ REGION_NULL(pScreen, &temp);
REGION_COPY(pScreen, &temp, &pWin->clipList);
(*pScreen->WindowExposures) (pWin, &temp, NullRegion);
REGION_UNINIT(pScreen, &temp);
@@ -2997,15 +2920,9 @@ MapSubwindows(pParent, client)
}
static void
-#if NeedFunctionPrototypes
UnrealizeTree(
WindowPtr pWin,
Bool fromConfigure)
-#else
-UnrealizeTree(pWin, fromConfigure)
- WindowPtr pWin;
- Bool fromConfigure;
-#endif
{
register WindowPtr pChild;
UnrealizeWindowProcPtr Unrealize;
@@ -3370,9 +3287,7 @@ SendVisibilityNotify(pWin)
#ifndef NOLOGOHACK
static void DrawLogo(
-#if NeedFunctionPrototypes
WindowPtr /*pWin*/
-#endif
);
#endif
@@ -3487,16 +3402,12 @@ SaveScreens(on, mode)
}
}
screenIsSaved = what;
+ if (mode == ScreenSaverReset)
+ SetScreenSaverTimer();
}
static Bool
-#if NeedFunctionPrototypes
TileScreenSaver(int i, int kind)
-#else
-TileScreenSaver(i, kind)
- int i;
- int kind;
-#endif
{
int j;
int result;
@@ -3764,12 +3675,7 @@ DisposeWindowOptional (pWin)
#ifndef NOLOGOHACK
static void
-#if NeedFunctionPrototypes
DrawLogo(WindowPtr pWin)
-#else
-DrawLogo(pWin)
- WindowPtr pWin;
-#endif
{
DrawablePtr pDraw;
ScreenPtr pScreen;