aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2015-04-16 18:03:18 +0200
committerMihai Moldovan <ionic@ionic.de>2015-04-16 18:03:18 +0200
commitcfc0202b42ad307391202ca776937b28ea7d2b03 (patch)
tree03acc5d7d7bb0d35152bfc597eb788b938f09647 /nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
parentfad840cfe558601a8ec02414f1235824bc9f3168 (diff)
parenta5f71f084e9f32e947a04da69edb7aae96d61697 (diff)
downloadnx-libs-cfc0202b42ad307391202ca776937b28ea7d2b03.tar.gz
nx-libs-cfc0202b42ad307391202ca776937b28ea7d2b03.tar.bz2
nx-libs-cfc0202b42ad307391202ca776937b28ea7d2b03.zip
Merge branch 'sunweaver-pr/nxupgradeagent-cleanup' into arctica-3.6.x
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXwindow.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXwindow.c566
1 files changed, 277 insertions, 289 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
index 95ecde951..76e86fd2a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
@@ -1,9 +1,3 @@
-#ifdef NXAGENT_UPGRADE
-
-#include "X/NXwindow.c"
-
-#else
-
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
@@ -21,6 +15,8 @@
/* */
/**************************************************************************/
+/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.12 2005/07/03 08:53:38 daniels Exp $ */
+/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */
/*
Copyright 1987, 1998 The Open Group
@@ -70,26 +66,40 @@ SOFTWARE.
*/
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
+/* 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
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+
+******************************************************************/
+
+/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.36 2003/11/14 23:52:50 torrey Exp $ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
#include "misc.h"
#include "scrnintstr.h"
@@ -113,11 +123,11 @@ SOFTWARE.
#include "globals.h"
#ifdef XAPPGROUP
-#include "Xagsrv.h"
+#include <X11/extensions/Xagsrv.h>
#endif
#ifdef XCSECURITY
#define _SECURITY_SERVER
-#include "security.h"
+#include <X11/extensions/security.h>
#endif
#include "Screen.h"
@@ -130,13 +140,6 @@ SOFTWARE.
#include "Drawable.h"
#include "Colormap.h"
-#if defined(NEED_SCREEN_REGIONS)
-#define REGION_PTR(pScreen,pWin) \
- register ScreenPtr pScreen = pWin->drawable.pScreen;
-#else
-#define REGION_PTR(pScreen,pWin) /* nothing */
-#endif
-
extern Bool nxagentWMIsRunning;
extern Bool nxagentScreenTrap;
@@ -150,6 +153,9 @@ extern Bool nxagentScreenTrap;
*
******/
+static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11};
+static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88};
+
int screenIsSaved = SCREEN_SAVER_OFF;
ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
@@ -161,12 +167,7 @@ extern void WindowHasNewCursor();
extern void RecalculateDeliverableEvents();
#endif
-static Bool TileScreenSaver(
-#if NeedFunctionPrototypes
- int /*i*/,
- int /*kind*/
-#endif
-);
+static Bool TileScreenSaver(int i, int kind);
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
@@ -215,9 +216,7 @@ WindowPtr nxagentRootTileWindow;
******/
int
-PrintChildren(p1, indent)
- WindowPtr p1;
- int indent;
+PrintChildren(WindowPtr p1, int indent)
{
WindowPtr p2;
int i;
@@ -250,10 +249,7 @@ PrintWindowTree()
#endif
int
-TraverseTree(pWin, func, data)
- register WindowPtr pWin;
- VisitWindowProcPtr func;
- pointer data;
+TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data)
{
register int result;
register WindowPtr pChild;
@@ -288,10 +284,7 @@ TraverseTree(pWin, func, data)
*****/
int
-WalkTree(pScreen, func, data)
- ScreenPtr pScreen;
- VisitWindowProcPtr func;
- pointer data;
+WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data)
{
return(TraverseTree(WindowTable[pScreen->myNum], func, data));
}
@@ -305,12 +298,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;
@@ -342,8 +330,13 @@ SetWindowToDefaults(pWin)
pWin->srcBuffer = DBE_FRONT_BUFFER;
pWin->dstBuffer = DBE_FRONT_BUFFER;
#endif
+#ifdef COMPOSITE
+ pWin->redirectDraw = 0;
+#endif
}
+#ifdef NXAGENT_SERVER
+
void nxagentClearSplash(WindowPtr pW)
{
int w, h;
@@ -365,20 +358,59 @@ void nxagentClearSplash(WindowPtr pW)
(*pScreen->ChangeWindowAttributes)(pW, CWBackPixmap|CWBackPixel);
}
+#endif /* NXAGENT_SERVER */
+
static void
-#if NeedFunctionPrototypes
MakeRootTile(WindowPtr pWin)
-#else
-MakeRootTile(pWin)
- WindowPtr pWin;
-#endif
{
- nxagentRootTileWindow = pWin;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ GCPtr pGC;
+ unsigned char back[128];
+ int len = BitmapBytePad(sizeof(long));
+ register unsigned char *from, *to;
+ register int i, j;
+
+ pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
+ pScreen->rootDepth);
+
+ pWin->backgroundState = BackgroundPixmap;
+ pGC = GetScratchGC(pScreen->rootDepth, pScreen);
+ if (!pWin->background.pixmap || !pGC)
+ FatalError("could not create root tile");
+
+ {
+ CARD32 attributes[2];
+
+ attributes[0] = pScreen->whitePixel;
+ attributes[1] = pScreen->blackPixel;
+
+ (void)ChangeGC(pGC, GCForeground | GCBackground, attributes);
+ }
+
+ ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
+
+ from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb;
+ to = back;
+
+ for (i = 4; i > 0; i--, from++)
+ for (j = len; j > 0; j--)
+ *to++ = *from;
+
+ if (blackRoot)
+ bzero(back, sizeof(back));
+
+ (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1,
+ 0, 0, len, 4, 0, XYBitmap, (char *)back);
+
+ FreeScratchGC(pGC);
+
+#ifdef NXAGENT_SERVER
+ nxagentRootTileWindow = pWin;
+#endif /* NXAGENT_SERVER */
}
WindowPtr
-AllocateWindow(pScreen)
- ScreenPtr pScreen;
+AllocateWindow(ScreenPtr pScreen)
{
WindowPtr pWin;
register char *ptr;
@@ -414,8 +446,7 @@ AllocateWindow(pScreen)
*****/
Bool
-CreateRootWindow(pScreen)
- ScreenPtr pScreen;
+CreateRootWindow(ScreenPtr pScreen)
{
WindowPtr pWin;
BoxRec box;
@@ -461,6 +492,7 @@ CreateRootWindow(pScreen)
#ifdef SHAPE
pWin->optional->boundingShape = NULL;
pWin->optional->clipShape = NULL;
+ pWin->optional->inputShape = NULL;
#endif
#ifdef XINPUT
pWin->optional->inputMasks = NULL;
@@ -529,9 +561,10 @@ CreateRootWindow(pScreen)
return TRUE;
}
+#ifdef NXAGENT_SERVER
+
void
-InitRootWindow(pWin)
- WindowPtr pWin;
+InitRootWindow(WindowPtr pWin)
{
ScreenPtr pScreen;
@@ -627,19 +660,45 @@ InitRootWindow(pWin)
#endif
}
+#else /* NXAGENT_SERVER */
+
+void
+InitRootWindow(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ if (!(*pScreen->CreateWindow)(pWin))
+ return; /* XXX */
+ (*pScreen->PositionWindow)(pWin, 0, 0);
+
+ pWin->cursorIsNone = FALSE;
+ pWin->optional->cursor = rootCursor;
+ rootCursor->refcnt++;
+ MakeRootTile(pWin);
+ pWin->backingStore = defaultBackingStore;
+ pWin->forcedBS = (defaultBackingStore != NotUseful);
+ /* We SHOULD check for an error value here XXX */
+ (*pScreen->ChangeWindowAttributes)(pWin,
+ CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore);
+
+ MapWindow(pWin, serverClient);
+}
+
+#endif /* NXAGENT_SERVER */
+
/* Set the region to the intersection of the rectangle and the
* window's winSize. The window is typically the parent of the
* window from which the region came.
*/
void
-ClippedRegionFromBox(pWin, Rgn, x, y, w, h)
- register WindowPtr pWin;
- RegionPtr Rgn;
- register int x, y;
- int w, h;
+ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn,
+ register int x, register int y,
+ register int w, register int h)
{
- REGION_PTR(pScreen, pWin)
+#ifndef NXAGENT_SERVER
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+#endif /* NXAGENT_SERVER */
BoxRec box;
box = *(REGION_EXTENTS(pScreen, &pWin->winSize));
@@ -663,8 +722,7 @@ ClippedRegionFromBox(pWin, Rgn, x, y, w, h)
}
WindowPtr
-RealChildHead(pWin)
- register WindowPtr pWin;
+RealChildHead(register WindowPtr pWin)
{
if (!pWin->parent &&
(screenIsSaved == SCREEN_SAVER_ON) &&
@@ -680,19 +738,9 @@ RealChildHead(pWin)
*****/
WindowPtr
-CreateWindow(wid, pParent, x, y, w, h, bw, class, vmask, vlist,
- depth, client, visual, error)
- Window wid;
- register WindowPtr pParent;
- int x,y;
- unsigned int w, h, bw;
- unsigned int class;
- register Mask vmask;
- XID *vlist;
- int depth;
- ClientPtr client;
- VisualID visual;
- int *error;
+CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w,
+ unsigned h, unsigned bw, unsigned class, register Mask vmask, XID *vlist,
+ int depth, ClientPtr client, VisualID visual, int *error)
{
register WindowPtr pWin;
WindowPtr pHead;
@@ -851,10 +899,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)
@@ -927,12 +975,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;
@@ -948,6 +991,8 @@ FreeWindowResources(pWin)
REGION_DESTROY(pScreen, wBoundingShape (pWin));
if (wClipShape (pWin))
REGION_DESTROY(pScreen, wClipShape (pWin));
+ if (wInputShape (pWin))
+ REGION_DESTROY(pScreen, wInputShape (pWin));
#endif
if (pWin->borderIsPixel == FALSE)
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
@@ -961,12 +1006,7 @@ FreeWindowResources(pWin)
}
static void
-#if NeedFunctionPrototypes
CrushTree(WindowPtr pWin)
-#else
-CrushTree(pWin)
- WindowPtr pWin;
-#endif
{
register WindowPtr pChild, pSib, pParent;
UnrealizeWindowProcPtr UnrealizeWindow;
@@ -1022,11 +1062,8 @@ CrushTree(pWin)
* If wid is None, don't send any events
*****/
-/*ARGSUSED*/
int
-DeleteWindow(value, wid)
- pointer value;
- XID wid;
+DeleteWindow(pointer value, XID wid)
{
register WindowPtr pParent;
register WindowPtr pWin = (WindowPtr)value;
@@ -1056,7 +1093,6 @@ DeleteWindow(value, wid)
if (pWin->prevSib)
pWin->prevSib->nextSib = pWin->nextSib;
}
- xfree(pWin);
if (pWin -> optional &&
pWin -> optional -> colormap &&
@@ -1065,14 +1101,12 @@ DeleteWindow(value, wid)
nxagentSetInstalledColormapWindows(pWin -> drawable.pScreen);
}
+ xfree(pWin);
return Success;
}
-/*ARGSUSED*/
void
-DestroySubwindows(pWin, client)
- register WindowPtr pWin;
- ClientPtr client;
+DestroySubwindows(register WindowPtr pWin, ClientPtr client)
{
/* XXX
* The protocol is quite clear that each window should be
@@ -1099,11 +1133,7 @@ DestroySubwindows(pWin, client)
*****/
int
-ChangeWindowAttributes(pWin, vmask, vlist, client)
- register WindowPtr pWin;
- Mask vmask;
- XID *vlist;
- ClientPtr client;
+ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
{
register Mask index2;
register XID *pVlist;
@@ -1650,7 +1680,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);
@@ -1665,10 +1695,7 @@ PatchUp:
*****/
void
-GetWindowAttributes(pWin, client, wa)
- register WindowPtr pWin;
- ClientPtr client;
- xGetWindowAttributesReply *wa;
+GetWindowAttributes(register WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply *wa)
{
wa->type = X_Reply;
wa->bitGravity = pWin->bitGravity;
@@ -1704,8 +1731,7 @@ GetWindowAttributes(pWin, client, wa)
WindowPtr
-MoveWindowInStack(pWin, pNextSib)
- register WindowPtr pWin, pNextSib;
+MoveWindowInStack(register WindowPtr pWin, register WindowPtr pNextSib)
{
register WindowPtr pParent = pWin->parent;
WindowPtr pFirstChange = pWin; /* highest window where list changes */
@@ -1774,12 +1800,22 @@ 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 );
}
RegionPtr
-CreateUnclippedWinSize (pWin)
- register WindowPtr pWin;
+CreateUnclippedWinSize (register WindowPtr pWin)
{
RegionPtr pRgn;
BoxRec box;
@@ -1791,8 +1827,9 @@ CreateUnclippedWinSize (pWin)
pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1);
#ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) {
- REGION_PTR(pScreen, pWin)
-
+#ifndef NXAGENT_SERVER
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+#endif /* NXAGENT_SERVER */
REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x,
- pWin->drawable.y);
if (wBoundingShape (pWin))
@@ -1806,17 +1843,30 @@ CreateUnclippedWinSize (pWin)
}
void
-SetWinSize (pWin)
- register WindowPtr pWin;
+SetWinSize (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,
(int)pWin->drawable.height);
#ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) {
- REGION_PTR(pScreen, pWin)
-
+#ifndef NXAGENT_SERVER
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+#endif /* NXAGENT_SERVER */
REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x,
- pWin->drawable.y);
if (wBoundingShape (pWin))
@@ -1832,21 +1882,34 @@ SetWinSize (pWin)
}
void
-SetBorderSize (pWin)
- register WindowPtr pWin;
+SetBorderSize (register WindowPtr pWin)
{
int bw;
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)),
(int)(pWin->drawable.height + (bw<<1)));
#ifdef SHAPE
if (wBoundingShape (pWin)) {
- REGION_PTR(pScreen, pWin)
-
+#ifndef NXAGENT_SERVER
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+#endif /* NXAGENT_SERVER */
REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x,
- pWin->drawable.y);
REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize,
@@ -1863,13 +1926,17 @@ SetBorderSize (pWin)
}
}
+/**
+ *
+ * \param x,y new window position
+ * \param oldx,oldy old window position
+ * \param destx,desty position relative to gravity
+ */
+
void
-GravityTranslate (x, y, oldx, oldy, dw, dh, gravity, destx, desty)
- register int x, y; /* new window position */
- int oldx, oldy; /* old window position */
- int dw, dh;
- unsigned gravity;
- register int *destx, *desty; /* position relative to gravity */
+GravityTranslate (register int x, register int y, int oldx, int oldy,
+ int dw, int dh, unsigned gravity,
+ register int *destx, register int *desty)
{
switch (gravity) {
case NorthGravity:
@@ -1917,9 +1984,7 @@ GravityTranslate (x, y, oldx, oldy, dw, dh, gravity, destx, desty)
/* XXX need to retile border on each window with ParentRelative origin */
void
-ResizeChildrenWinSize(pWin, dx, dy, dw, dh)
- register WindowPtr pWin;
- int dx, dy, dw, dh;
+ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
{
register ScreenPtr pScreen;
register WindowPtr pSib, pChild;
@@ -2027,14 +2092,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;
@@ -2051,15 +2111,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);
@@ -2074,19 +2128,14 @@ 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)
-
+#ifndef NXAGENT_SERVER
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+#endif /* NXAGENT_SERVER */
pRgn = REGION_CREATE(pScreen, pBox, 1);
if (wBoundingShape (pWin)) {
REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x,
@@ -2099,17 +2148,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;
@@ -2129,16 +2172,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;
@@ -2161,15 +2198,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;
@@ -2220,7 +2251,6 @@ IOverlapAnyWindow(pWin, box)
*/
static WindowPtr
-#if NeedFunctionPrototypes
WhereDoIGoInTheStack(
register WindowPtr pWin,
register WindowPtr pSib,
@@ -2229,13 +2259,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;
@@ -2334,21 +2357,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
@@ -2358,8 +2374,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);
@@ -2395,11 +2411,7 @@ ReflectStackChange(pWin, pSib, kind)
*****/
int
-ConfigureWindow(pWin, mask, vlist, client)
- register WindowPtr pWin;
- register Mask mask;
- XID *vlist;
- ClientPtr client;
+ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientPtr client)
{
#define RESTACK_WIN 0
#define MOVE_WIN 1
@@ -2629,7 +2641,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);
@@ -2706,10 +2721,7 @@ ActuallyDoSomething:
******/
int
-CirculateWindow(pParent, direction, client)
- WindowPtr pParent;
- int direction;
- ClientPtr client;
+CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
{
register WindowPtr pWin, pHead, pFirst;
xEvent event;
@@ -2778,15 +2790,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;
@@ -2801,10 +2807,8 @@ CompareWIDs(pWin, value)
*****/
int
-ReparentWindow(pWin, pParent, x, y, client)
- register WindowPtr pWin, pParent;
- int x,y;
- ClientPtr client;
+ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
+ int x, int y, ClientPtr client)
{
WindowPtr pPrev, pPriorParent;
Bool WasMapped = (Bool)(pWin->mapped);
@@ -2903,12 +2907,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;
@@ -2949,9 +2948,7 @@ RealizeTree(pWin)
*****/
int
-MapWindow(pWin, client)
- register WindowPtr pWin;
- ClientPtr client;
+MapWindow(register WindowPtr pWin, ClientPtr client)
{
register ScreenPtr pScreen;
@@ -3067,7 +3064,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);
@@ -3086,9 +3083,7 @@ MapWindow(pWin, client)
*****/
void
-MapSubwindows(pParent, client)
- register WindowPtr pParent;
- ClientPtr client;
+MapSubwindows(register WindowPtr pParent, ClientPtr client)
{
register WindowPtr pWin;
WindowPtr pFirstMapped = NullWindow;
@@ -3204,15 +3199,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;
@@ -3273,9 +3262,7 @@ UnrealizeTree(pWin, fromConfigure)
*****/
int
-UnmapWindow(pWin, fromConfigure)
- register WindowPtr pWin;
- Bool fromConfigure;
+UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
{
register WindowPtr pParent;
xEvent event;
@@ -3342,8 +3329,7 @@ UnmapWindow(pWin, fromConfigure)
*****/
void
-UnmapSubwindows(pWin)
- register WindowPtr pWin;
+UnmapSubwindows(register WindowPtr pWin)
{
register WindowPtr pChild, pHead;
xEvent event;
@@ -3434,18 +3420,24 @@ UnmapSubwindows(pWin)
void
-HandleSaveSet(client)
- register ClientPtr client;
+HandleSaveSet(register ClientPtr client)
{
register WindowPtr pParent, pWin;
register int j;
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)
@@ -3457,19 +3449,24 @@ 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;
}
+/**
+ *
+ * \param x,y in root
+ * \param box "return" value
+ */
Bool
-VisibleBoundingBoxFromPoint(pWin, x, y, box)
- register WindowPtr pWin;
- int x, y; /* in root */
- BoxPtr box; /* "return" value */
+VisibleBoundingBoxFromPoint(register WindowPtr pWin, int x, int y, BoxPtr box)
{
if (!pWin->realized)
return (FALSE);
@@ -3478,25 +3475,31 @@ VisibleBoundingBoxFromPoint(pWin, x, y, box)
return(FALSE);
}
+/**
+ *
+ * \param x,y in root
+ */
Bool
-PointInWindowIsVisible(pWin, x, y)
- register WindowPtr pWin;
- int x, y; /* in root */
+PointInWindowIsVisible(register WindowPtr pWin, int x, int y)
{
BoxRec box;
if (!pWin->realized)
return (FALSE);
if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip,
- x, y, &box))
+ x, y, &box)
+ && (!wInputShape(pWin) ||
+ POINT_IN_REGION(pWin->drawable.pScreen,
+ wInputShape(pWin),
+ x - pWin->drawable.x,
+ y - pWin->drawable.y, &box)))
return(TRUE);
return(FALSE);
}
RegionPtr
-NotClippedByChildren(pWin)
- register WindowPtr pWin;
+NotClippedByChildren(register WindowPtr pWin)
{
register ScreenPtr pScreen;
RegionPtr pReg;
@@ -3513,12 +3516,12 @@ NotClippedByChildren(pWin)
}
void
-SendVisibilityNotify(pWin)
- WindowPtr pWin;
+SendVisibilityNotify(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) {
@@ -3585,16 +3588,12 @@ SendVisibilityNotify(pWin)
#ifndef NOLOGOHACK
static void DrawLogo(
-#if NeedFunctionPrototypes
- WindowPtr /*pWin*/
-#endif
+ WindowPtr pWin
);
#endif
void
-SaveScreens(on, mode)
- int on;
- int mode;
+SaveScreens(int on, int mode)
{
int i;
int what;
@@ -3712,16 +3711,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;
@@ -3839,8 +3834,7 @@ TileScreenSaver(i, kind)
*/
WindowPtr
-FindWindowWithOptional (w)
- register WindowPtr w;
+FindWindowWithOptional (register WindowPtr w)
{
do
w = w->parent;
@@ -3857,8 +3851,7 @@ FindWindowWithOptional (w)
*/
void
-CheckWindowOptionalNeed (w)
- register WindowPtr w;
+CheckWindowOptionalNeed (register WindowPtr w)
{
register WindowOptPtr optional;
register WindowOptPtr parentOptional;
@@ -3885,6 +3878,8 @@ CheckWindowOptionalNeed (w)
return;
if (optional->clipShape != NULL)
return;
+ if (optional->inputShape != NULL)
+ return;
#endif
#ifdef XINPUT
if (optional->inputMasks != NULL)
@@ -3910,8 +3905,7 @@ CheckWindowOptionalNeed (w)
*/
Bool
-MakeWindowOptional (pWin)
- register WindowPtr pWin;
+MakeWindowOptional (register WindowPtr pWin)
{
register WindowOptPtr optional;
register WindowOptPtr parentOptional;
@@ -3931,6 +3925,7 @@ MakeWindowOptional (pWin)
#ifdef SHAPE
optional->boundingShape = NULL;
optional->clipShape = NULL;
+ optional->inputShape = NULL;
#endif
#ifdef XINPUT
optional->inputMasks = NULL;
@@ -3952,8 +3947,7 @@ MakeWindowOptional (pWin)
}
void
-DisposeWindowOptional (pWin)
- register WindowPtr pWin;
+DisposeWindowOptional (register WindowPtr pWin)
{
if (!pWin->optional)
return;
@@ -3994,12 +3988,7 @@ DisposeWindowOptional (pWin)
#ifndef NOLOGOHACK
static void
-#if NeedFunctionPrototypes
DrawLogo(WindowPtr pWin)
-#else
-DrawLogo(pWin)
- WindowPtr pWin;
-#endif
{
DrawablePtr pDraw;
ScreenPtr pScreen;
@@ -4176,4 +4165,3 @@ DrawLogo(pWin)
#endif
-#endif /* #ifdef NXAGENT_UPGRADE */