2009-09-28 08:09:51 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/***********************************************************
|
|
|
|
|
|
|
|
Copyright 1987, 1998 The Open Group
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
the above copyright notice appear in all copies and that both that
|
|
|
|
copyright notice and this permission notice appear in supporting
|
|
|
|
documentation.
|
|
|
|
|
|
|
|
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 THE
|
|
|
|
OPEN GROUP BE LIABLE FOR ANY CLAIM, 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 The Open Group shall not be
|
|
|
|
used in advertising or otherwise to promote the sale, use or other dealings
|
|
|
|
in this Software without prior written authorization from The Open Group.
|
|
|
|
|
|
|
|
|
|
|
|
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
|
|
|
provided that the above copyright notice appear in all copies and that
|
|
|
|
both that copyright notice and this permission notice appear in
|
|
|
|
supporting documentation, and that the name of Digital not be
|
|
|
|
used in advertising or publicity pertaining to distribution of the
|
|
|
|
software without specific, written prior permission.
|
|
|
|
|
|
|
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
|
|
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
|
|
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
|
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
|
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
|
|
SOFTWARE.
|
|
|
|
|
|
|
|
******************************************************************/
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
2010-06-11 15:20:00 +02:00
|
|
|
#include <X11/extensions/shapeconst.h>
|
2003-11-25 20:29:01 +01:00
|
|
|
#include "regionstr.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "region.h"
|
|
|
|
#include "mi.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "pixmapstr.h"
|
|
|
|
#include "mivalidate.h"
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
miClearToBackground(WindowPtr pWin,
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
Bool generateExposures)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
BoxRec box;
|
|
|
|
RegionRec reg;
|
|
|
|
BoxPtr extents;
|
|
|
|
int x1, y1, x2, y2;
|
|
|
|
|
|
|
|
/* compute everything using ints to avoid overflow */
|
|
|
|
|
|
|
|
x1 = pWin->drawable.x + x;
|
|
|
|
y1 = pWin->drawable.y + y;
|
|
|
|
if (w)
|
|
|
|
x2 = x1 + (int) w;
|
|
|
|
else
|
|
|
|
x2 = x1 + (int) pWin->drawable.width - (int) x;
|
|
|
|
if (h)
|
|
|
|
y2 = y1 + h;
|
|
|
|
else
|
|
|
|
y2 = y1 + (int) pWin->drawable.height - (int) y;
|
|
|
|
|
|
|
|
extents = &pWin->clipList.extents;
|
|
|
|
|
|
|
|
/* clip the resulting rectangle to the window clipList extents. This
|
|
|
|
* makes sure that the result will fit in a box, given that the
|
|
|
|
* screen is < 32768 on a side.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (x1 < extents->x1)
|
|
|
|
x1 = extents->x1;
|
|
|
|
if (x2 > extents->x2)
|
|
|
|
x2 = extents->x2;
|
|
|
|
if (y1 < extents->y1)
|
|
|
|
y1 = extents->y1;
|
|
|
|
if (y2 > extents->y2)
|
|
|
|
y2 = extents->y2;
|
|
|
|
|
|
|
|
if (x2 <= x1 || y2 <= y1)
|
|
|
|
{
|
|
|
|
x2 = x1 = 0;
|
|
|
|
y2 = y1 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
box.x1 = x1;
|
|
|
|
box.x2 = x2;
|
|
|
|
box.y1 = y1;
|
|
|
|
box.y2 = y2;
|
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionInit(®, &box, 1);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionIntersect(®, ®, &pWin->clipList);
|
2003-11-14 16:54:54 +01:00
|
|
|
if (generateExposures)
|
2010-06-12 15:57:50 +02:00
|
|
|
(*pWin->drawable.pScreen->WindowExposures)(pWin, ®, NULL);
|
2003-11-14 16:54:54 +01:00
|
|
|
else if (pWin->backgroundState != None)
|
2007-09-12 15:58:46 +02:00
|
|
|
miPaintWindow(pWin, ®, PW_BACKGROUND);
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUninit(®);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
miMarkWindow(WindowPtr pWin)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-03-09 04:46:23 +01:00
|
|
|
ValidatePtr val;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
if (pWin->valdata)
|
|
|
|
return;
|
|
|
|
val = (ValidatePtr)xnfalloc(sizeof(ValidateRec));
|
|
|
|
val->before.oldAbsCorner.x = pWin->drawable.x;
|
|
|
|
val->before.oldAbsCorner.y = pWin->drawable.y;
|
|
|
|
val->before.borderVisible = NullRegion;
|
|
|
|
val->before.resized = FALSE;
|
|
|
|
pWin->valdata = val;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2008-05-28 04:57:07 +02:00
|
|
|
miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-03-09 04:46:23 +01:00
|
|
|
BoxPtr box;
|
|
|
|
WindowPtr pChild, pLast;
|
2003-11-14 16:54:54 +01:00
|
|
|
Bool anyMarked = FALSE;
|
2003-11-14 17:49:22 +01:00
|
|
|
MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* single layered systems are easy */
|
|
|
|
if (ppLayerWin) *ppLayerWin = pWin;
|
|
|
|
|
|
|
|
if (pWin == pFirst)
|
|
|
|
{
|
|
|
|
/* Blindly mark pWin and all of its inferiors. This is a slight
|
|
|
|
* overkill if there are mapped windows that outside pWin's border,
|
|
|
|
* but it's better than wasting time on RectIn checks.
|
|
|
|
*/
|
|
|
|
pChild = pWin;
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
if (pChild->viewable)
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
if (RegionBroken(&pChild->winSize))
|
2003-11-14 17:49:22 +01:00
|
|
|
SetWinSize (pChild);
|
2010-05-22 00:05:48 +02:00
|
|
|
if (RegionBroken(&pChild->borderSize))
|
2003-11-14 17:49:22 +01:00
|
|
|
SetBorderSize (pChild);
|
2003-11-14 16:54:54 +01:00
|
|
|
(* MarkWindow)(pChild);
|
|
|
|
if (pChild->firstChild)
|
|
|
|
{
|
|
|
|
pChild = pChild->firstChild;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (!pChild->nextSib && (pChild != pWin))
|
|
|
|
pChild = pChild->parent;
|
|
|
|
if (pChild == pWin)
|
|
|
|
break;
|
|
|
|
pChild = pChild->nextSib;
|
|
|
|
}
|
|
|
|
anyMarked = TRUE;
|
|
|
|
pFirst = pFirst->nextSib;
|
|
|
|
}
|
|
|
|
if ( (pChild = pFirst) )
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
box = RegionExtents(&pWin->borderSize);
|
2003-11-14 16:54:54 +01:00
|
|
|
pLast = pChild->parent->lastChild;
|
|
|
|
while (1)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
if (pChild->viewable)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
if (RegionBroken(&pChild->winSize))
|
2003-11-14 17:49:22 +01:00
|
|
|
SetWinSize (pChild);
|
2010-05-22 00:05:48 +02:00
|
|
|
if (RegionBroken(&pChild->borderSize))
|
2003-11-14 17:49:22 +01:00
|
|
|
SetBorderSize (pChild);
|
2010-05-22 00:05:48 +02:00
|
|
|
if (RegionContainsRect(&pChild->borderSize, box))
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
(* MarkWindow)(pChild);
|
|
|
|
anyMarked = TRUE;
|
|
|
|
if (pChild->firstChild)
|
|
|
|
{
|
|
|
|
pChild = pChild->firstChild;
|
|
|
|
continue;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
while (!pChild->nextSib && (pChild != pLast))
|
|
|
|
pChild = pChild->parent;
|
|
|
|
if (pChild == pLast)
|
|
|
|
break;
|
|
|
|
pChild = pChild->nextSib;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (anyMarked)
|
|
|
|
(* MarkWindow)(pWin->parent);
|
|
|
|
return anyMarked;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****
|
|
|
|
* miHandleValidateExposures(pWin)
|
|
|
|
* starting at pWin, draw background in any windows that have exposure
|
|
|
|
* regions, translate the regions, restore any backing store,
|
|
|
|
* and then send any regions still exposed to the client
|
|
|
|
*****/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
miHandleValidateExposures(WindowPtr pWin)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-03-09 04:46:23 +01:00
|
|
|
WindowPtr pChild;
|
|
|
|
ValidatePtr val;
|
2003-11-14 17:49:22 +01:00
|
|
|
WindowExposuresProcPtr WindowExposures;
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
pChild = pWin;
|
|
|
|
WindowExposures = pChild->drawable.pScreen->WindowExposures;
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
if ( (val = pChild->valdata) )
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
if (RegionNotEmpty(&val->after.borderExposed))
|
2007-09-12 15:58:46 +02:00
|
|
|
miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUninit(&val->after.borderExposed);
|
2003-11-14 16:54:54 +01:00
|
|
|
(*WindowExposures)(pChild, &val->after.exposed, NullRegion);
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUninit(&val->after.exposed);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(val);
|
2009-01-22 08:11:16 +01:00
|
|
|
pChild->valdata = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
if (pChild->firstChild)
|
|
|
|
{
|
|
|
|
pChild = pChild->firstChild;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (!pChild->nextSib && (pChild != pWin))
|
|
|
|
pChild = pChild->parent;
|
|
|
|
if (pChild == pWin)
|
|
|
|
break;
|
|
|
|
pChild = pChild->nextSib;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
WindowPtr pParent;
|
|
|
|
Bool WasViewable = (Bool)(pWin->viewable);
|
|
|
|
short bw;
|
2003-11-14 17:49:22 +01:00
|
|
|
RegionPtr oldRegion = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
DDXPointRec oldpt;
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool anyMarked = FALSE;
|
2007-03-09 04:46:23 +01:00
|
|
|
ScreenPtr pScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
WindowPtr windowToValidate;
|
|
|
|
WindowPtr pLayerWin;
|
|
|
|
|
|
|
|
/* if this is a root window, can't be moved */
|
|
|
|
if (!(pParent = pWin->parent))
|
|
|
|
return ;
|
|
|
|
pScreen = pWin->drawable.pScreen;
|
|
|
|
bw = wBorderWidth (pWin);
|
|
|
|
|
|
|
|
oldpt.x = pWin->drawable.x;
|
|
|
|
oldpt.y = pWin->drawable.y;
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
oldRegion = RegionCreate(NullBox, 1);
|
|
|
|
RegionCopy(oldRegion, &pWin->borderClip);
|
2003-11-14 16:54:54 +01:00
|
|
|
anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin);
|
|
|
|
}
|
|
|
|
pWin->origin.x = x + (int)bw;
|
|
|
|
pWin->origin.y = y + (int)bw;
|
|
|
|
x = pWin->drawable.x = pParent->drawable.x + x + (int)bw;
|
|
|
|
y = pWin->drawable.y = pParent->drawable.y + y + (int)bw;
|
|
|
|
|
|
|
|
SetWinSize (pWin);
|
|
|
|
SetBorderSize (pWin);
|
|
|
|
|
|
|
|
(*pScreen->PositionWindow)(pWin, x, y);
|
|
|
|
|
|
|
|
windowToValidate = MoveWindowInStack(pWin, pNextSib);
|
|
|
|
|
|
|
|
ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0);
|
|
|
|
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
|
|
|
if (pLayerWin == pWin)
|
|
|
|
anyMarked |= (*pScreen->MarkOverlappedWindows)
|
2009-01-22 08:11:16 +01:00
|
|
|
(pWin, windowToValidate, NULL);
|
2003-11-14 16:54:54 +01:00
|
|
|
else
|
|
|
|
anyMarked |= (*pScreen->MarkOverlappedWindows)
|
2009-01-22 08:11:16 +01:00
|
|
|
(pWin, pLayerWin, NULL);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
if (anyMarked)
|
|
|
|
{
|
|
|
|
(*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind);
|
|
|
|
(* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion);
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionDestroy(oldRegion);
|
2003-11-14 16:54:54 +01:00
|
|
|
/* XXX need to retile border if ParentRelative origin */
|
|
|
|
(*pScreen->HandleExposures)(pLayerWin->parent);
|
|
|
|
}
|
|
|
|
if (anyMarked && pScreen->PostValidateTree)
|
|
|
|
(*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, kind);
|
|
|
|
}
|
|
|
|
if (pWin->realized)
|
|
|
|
WindowsRestructured ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* pValid is a region of the screen which has been
|
|
|
|
* successfully copied -- recomputed exposed regions for affected windows
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int
|
2003-11-14 17:49:22 +01:00
|
|
|
miRecomputeExposures (
|
2007-03-09 04:46:23 +01:00
|
|
|
WindowPtr pWin,
|
2003-11-14 17:49:22 +01:00
|
|
|
pointer value) /* must conform to VisitWindowProcPtr */
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
RegionPtr pValid = (RegionPtr)value;
|
|
|
|
|
|
|
|
if (pWin->valdata)
|
|
|
|
{
|
2008-09-18 21:17:05 +02:00
|
|
|
#ifdef COMPOSITE
|
|
|
|
/*
|
|
|
|
* Redirected windows are not affected by parent window
|
|
|
|
* gravity manipulations, so don't recompute their
|
|
|
|
* exposed areas here.
|
|
|
|
*/
|
|
|
|
if (pWin->redirectDraw != RedirectDrawNone)
|
|
|
|
return WT_DONTWALKCHILDREN;
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* compute exposed regions of this window
|
|
|
|
*/
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionSubtract(&pWin->valdata->after.exposed,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->clipList, pValid);
|
|
|
|
/*
|
|
|
|
* compute exposed regions of the border
|
|
|
|
*/
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionSubtract(&pWin->valdata->after.borderExposed,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->borderClip, &pWin->winSize);
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionSubtract(&pWin->valdata->after.borderExposed,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->valdata->after.borderExposed, pValid);
|
|
|
|
return WT_WALKCHILDREN;
|
|
|
|
}
|
|
|
|
return WT_NOMATCH;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
miSlideAndSizeWindow(WindowPtr pWin,
|
|
|
|
int x, int y,
|
|
|
|
unsigned int w, unsigned int h,
|
|
|
|
WindowPtr pSib)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
WindowPtr pParent;
|
|
|
|
Bool WasViewable = (Bool)(pWin->viewable);
|
|
|
|
unsigned short width = pWin->drawable.width,
|
|
|
|
height = pWin->drawable.height;
|
|
|
|
short oldx = pWin->drawable.x,
|
|
|
|
oldy = pWin->drawable.y;
|
|
|
|
int bw = wBorderWidth (pWin);
|
|
|
|
short dw, dh;
|
|
|
|
DDXPointRec oldpt;
|
2003-11-14 17:49:22 +01:00
|
|
|
RegionPtr oldRegion = NULL;
|
|
|
|
Bool anyMarked = FALSE;
|
2007-03-09 04:46:23 +01:00
|
|
|
ScreenPtr pScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
WindowPtr pFirstChange;
|
2007-03-09 04:46:23 +01:00
|
|
|
WindowPtr pChild;
|
2003-11-14 16:54:54 +01:00
|
|
|
RegionPtr gravitate[StaticGravity + 1];
|
2007-03-09 04:46:23 +01:00
|
|
|
unsigned g;
|
2003-11-14 16:54:54 +01:00
|
|
|
int nx, ny; /* destination x,y */
|
|
|
|
int newx, newy; /* new inner window position */
|
2003-11-14 17:49:22 +01:00
|
|
|
RegionPtr pRegion = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
RegionPtr destClip; /* portions of destination already written */
|
2003-11-14 17:49:22 +01:00
|
|
|
RegionPtr oldWinClip = NULL; /* old clip list for window */
|
2003-11-14 16:54:54 +01:00
|
|
|
RegionPtr borderVisible = NullRegion; /* visible area of the border */
|
|
|
|
Bool shrunk = FALSE; /* shrunk in an inner dimension */
|
|
|
|
Bool moved = FALSE; /* window position changed */
|
|
|
|
WindowPtr pLayerWin;
|
|
|
|
|
|
|
|
/* if this is a root window, can't be resized */
|
|
|
|
if (!(pParent = pWin->parent))
|
|
|
|
return ;
|
|
|
|
|
|
|
|
pScreen = pWin->drawable.pScreen;
|
|
|
|
newx = pParent->drawable.x + x + bw;
|
|
|
|
newy = pParent->drawable.y + y + bw;
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
|
|
|
anyMarked = FALSE;
|
|
|
|
/*
|
|
|
|
* save the visible region of the window
|
|
|
|
*/
|
2010-05-22 00:05:48 +02:00
|
|
|
oldRegion = RegionCreate(NullBox, 1);
|
|
|
|
RegionCopy(oldRegion, &pWin->winSize);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* categorize child windows into regions to be moved
|
|
|
|
*/
|
|
|
|
for (g = 0; g <= StaticGravity; g++)
|
|
|
|
gravitate[g] = (RegionPtr) NULL;
|
|
|
|
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
|
|
|
|
{
|
|
|
|
g = pChild->winGravity;
|
|
|
|
if (g != UnmapGravity)
|
|
|
|
{
|
|
|
|
if (!gravitate[g])
|
2010-05-22 00:05:48 +02:00
|
|
|
gravitate[g] = RegionCreate(NullBox, 1);
|
|
|
|
RegionUnion(gravitate[g],
|
2003-11-14 16:54:54 +01:00
|
|
|
gravitate[g], &pChild->borderClip);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
UnmapWindow(pChild, TRUE);
|
|
|
|
anyMarked = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
|
|
|
&pLayerWin);
|
|
|
|
|
|
|
|
oldWinClip = NULL;
|
|
|
|
if (pWin->bitGravity != ForgetGravity)
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
oldWinClip = RegionCreate(NullBox, 1);
|
|
|
|
RegionCopy(oldWinClip, &pWin->clipList);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* if the window is changing size, borderExposed
|
|
|
|
* can't be computed correctly without some help.
|
|
|
|
*/
|
|
|
|
if (pWin->drawable.height > h || pWin->drawable.width > w)
|
|
|
|
shrunk = TRUE;
|
|
|
|
|
|
|
|
if (newx != oldx || newy != oldy)
|
|
|
|
moved = TRUE;
|
|
|
|
|
|
|
|
if ((pWin->drawable.height != h || pWin->drawable.width != w) &&
|
|
|
|
HasBorder (pWin))
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
borderVisible = RegionCreate(NullBox, 1);
|
2003-11-14 16:54:54 +01:00
|
|
|
/* for tiled borders, we punt and draw the whole thing */
|
|
|
|
if (pWin->borderIsPixel || !moved)
|
|
|
|
{
|
|
|
|
if (shrunk || moved)
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionSubtract(borderVisible,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->borderClip,
|
|
|
|
&pWin->winSize);
|
|
|
|
else
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionCopy(borderVisible,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->borderClip);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pWin->origin.x = x + bw;
|
|
|
|
pWin->origin.y = y + bw;
|
|
|
|
pWin->drawable.height = h;
|
|
|
|
pWin->drawable.width = w;
|
|
|
|
|
|
|
|
x = pWin->drawable.x = newx;
|
|
|
|
y = pWin->drawable.y = newy;
|
|
|
|
|
|
|
|
SetWinSize (pWin);
|
|
|
|
SetBorderSize (pWin);
|
|
|
|
|
|
|
|
dw = (int)w - (int)width;
|
|
|
|
dh = (int)h - (int)height;
|
|
|
|
ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh);
|
|
|
|
|
|
|
|
/* let the hardware adjust background and border pixmaps, if any */
|
|
|
|
(*pScreen->PositionWindow)(pWin, x, y);
|
|
|
|
|
|
|
|
pFirstChange = MoveWindowInStack(pWin, pSib);
|
|
|
|
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
pRegion = RegionCreate(NullBox, 1);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
if (pLayerWin == pWin)
|
|
|
|
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange,
|
2009-01-22 08:11:16 +01:00
|
|
|
NULL);
|
2003-11-14 16:54:54 +01:00
|
|
|
else
|
|
|
|
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin,
|
2009-01-22 08:11:16 +01:00
|
|
|
NULL);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
if (pWin->valdata)
|
|
|
|
{
|
|
|
|
pWin->valdata->before.resized = TRUE;
|
|
|
|
pWin->valdata->before.borderVisible = borderVisible;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (anyMarked)
|
|
|
|
(*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, VTOther);
|
|
|
|
/*
|
|
|
|
* the entire window is trashed unless bitGravity
|
|
|
|
* recovers portions of it
|
|
|
|
*/
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionCopy(&pWin->valdata->after.exposed, &pWin->clipList);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny);
|
|
|
|
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
|
|
|
/* avoid the border */
|
|
|
|
if (HasBorder (pWin))
|
|
|
|
{
|
|
|
|
int offx, offy, dx, dy;
|
|
|
|
|
|
|
|
/* kruft to avoid double translates for each gravity */
|
|
|
|
offx = 0;
|
|
|
|
offy = 0;
|
|
|
|
for (g = 0; g <= StaticGravity; g++)
|
|
|
|
{
|
|
|
|
if (!gravitate[g])
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* align winSize to gravitate[g].
|
|
|
|
* winSize is in new coordinates,
|
|
|
|
* gravitate[g] is still in old coordinates */
|
|
|
|
GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny);
|
|
|
|
|
|
|
|
dx = (oldx - nx) - offx;
|
|
|
|
dy = (oldy - ny) - offy;
|
|
|
|
if (dx || dy)
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionTranslate(&pWin->winSize, dx, dy);
|
2003-11-14 16:54:54 +01:00
|
|
|
offx += dx;
|
|
|
|
offy += dy;
|
|
|
|
}
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionIntersect(gravitate[g], gravitate[g],
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->winSize);
|
|
|
|
}
|
|
|
|
/* get winSize back where it belongs */
|
|
|
|
if (offx || offy)
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionTranslate(&pWin->winSize, -offx, -offy);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* add screen bits to the appropriate bucket
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (oldWinClip)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* clip to new clipList
|
|
|
|
*/
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionCopy(pRegion, oldWinClip);
|
|
|
|
RegionTranslate(pRegion, nx - oldx, ny - oldy);
|
|
|
|
RegionIntersect(oldWinClip, pRegion, &pWin->clipList);
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* don't step on any gravity bits which will be copied after this
|
|
|
|
* region. Note -- this assumes that the regions will be copied
|
|
|
|
* in gravity order.
|
|
|
|
*/
|
|
|
|
for (g = pWin->bitGravity + 1; g <= StaticGravity; g++)
|
|
|
|
{
|
|
|
|
if (gravitate[g])
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionSubtract(oldWinClip, oldWinClip,
|
2003-11-14 16:54:54 +01:00
|
|
|
gravitate[g]);
|
|
|
|
}
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionTranslate(oldWinClip, oldx - nx, oldy - ny);
|
2003-11-14 16:54:54 +01:00
|
|
|
g = pWin->bitGravity;
|
|
|
|
if (!gravitate[g])
|
|
|
|
gravitate[g] = oldWinClip;
|
|
|
|
else
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUnion(gravitate[g], gravitate[g], oldWinClip);
|
|
|
|
RegionDestroy(oldWinClip);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* move the bits on the screen
|
|
|
|
*/
|
|
|
|
|
|
|
|
destClip = NULL;
|
|
|
|
|
|
|
|
for (g = 0; g <= StaticGravity; g++)
|
|
|
|
{
|
|
|
|
if (!gravitate[g])
|
|
|
|
continue;
|
|
|
|
|
|
|
|
GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny);
|
|
|
|
|
|
|
|
oldpt.x = oldx + (x - nx);
|
|
|
|
oldpt.y = oldy + (y - ny);
|
|
|
|
|
|
|
|
/* Note that gravitate[g] is *translated* by CopyWindow */
|
|
|
|
|
|
|
|
/* only copy the remaining useful bits */
|
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionIntersect(gravitate[g], gravitate[g], oldRegion);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* clip to not overwrite already copied areas */
|
|
|
|
|
|
|
|
if (destClip) {
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionTranslate(destClip, oldpt.x - x, oldpt.y - y);
|
|
|
|
RegionSubtract(gravitate[g], gravitate[g], destClip);
|
|
|
|
RegionTranslate(destClip, x - oldpt.x, y - oldpt.y);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* and move those bits */
|
|
|
|
|
2005-01-14 23:07:59 +01:00
|
|
|
if (oldpt.x != x || oldpt.y != y
|
|
|
|
#ifdef COMPOSITE
|
|
|
|
|| pWin->redirectDraw
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
2003-11-14 16:54:54 +01:00
|
|
|
(*pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, gravitate[g]);
|
2005-01-14 23:07:59 +01:00
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* remove any overwritten bits from the remaining useful bits */
|
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionSubtract(oldRegion, oldRegion, gravitate[g]);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* recompute exposed regions of child windows
|
|
|
|
*/
|
|
|
|
|
|
|
|
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
|
|
|
|
{
|
|
|
|
if (pChild->winGravity != g)
|
|
|
|
continue;
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionIntersect(pRegion,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pChild->borderClip, gravitate[g]);
|
|
|
|
TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* remove the successfully copied regions of the
|
|
|
|
* window from its exposed region
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (g == pWin->bitGravity)
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionSubtract(&pWin->valdata->after.exposed,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->valdata->after.exposed, gravitate[g]);
|
|
|
|
if (!destClip)
|
|
|
|
destClip = gravitate[g];
|
|
|
|
else
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUnion(destClip, destClip, gravitate[g]);
|
|
|
|
RegionDestroy(gravitate[g]);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionDestroy(oldRegion);
|
|
|
|
RegionDestroy(pRegion);
|
2003-11-14 16:54:54 +01:00
|
|
|
if (destClip)
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionDestroy(destClip);
|
2003-11-14 16:54:54 +01:00
|
|
|
if (anyMarked)
|
|
|
|
(*pScreen->HandleExposures)(pLayerWin->parent);
|
|
|
|
if (anyMarked && pScreen->PostValidateTree)
|
|
|
|
(*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange,
|
|
|
|
VTOther);
|
|
|
|
}
|
|
|
|
if (pWin->realized)
|
|
|
|
WindowsRestructured ();
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
WindowPtr
|
2008-05-28 04:57:07 +02:00
|
|
|
miGetLayerWindow(WindowPtr pWin)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
return pWin->firstChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******
|
|
|
|
*
|
|
|
|
* miSetShape
|
|
|
|
* The border/window shape has changed. Recompute winSize/borderSize
|
|
|
|
* and send appropriate exposure events
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2010-05-27 18:11:50 +02:00
|
|
|
miSetShape(WindowPtr pWin, int kind)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2010-05-27 18:11:50 +02:00
|
|
|
Bool WasViewable = (Bool)(pWin->viewable);
|
|
|
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
|
|
Bool anyMarked = FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
WindowPtr pLayerWin;
|
|
|
|
|
2010-05-27 18:11:50 +02:00
|
|
|
if (kind != ShapeInput) {
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
|
|
|
anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
|
|
|
&pLayerWin);
|
|
|
|
if (pWin->valdata)
|
|
|
|
{
|
|
|
|
if (HasBorder (pWin))
|
|
|
|
{
|
|
|
|
RegionPtr borderVisible;
|
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
borderVisible = RegionCreate(NullBox, 1);
|
|
|
|
RegionSubtract(borderVisible,
|
2010-05-27 18:11:50 +02:00
|
|
|
&pWin->borderClip, &pWin->winSize);
|
|
|
|
pWin->valdata->before.borderVisible = borderVisible;
|
|
|
|
}
|
|
|
|
pWin->valdata->before.resized = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SetWinSize (pWin);
|
|
|
|
SetBorderSize (pWin);
|
|
|
|
|
|
|
|
ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
|
|
|
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (anyMarked)
|
|
|
|
(*pScreen->ValidateTree)(pLayerWin->parent, NullWindow,
|
|
|
|
VTOther);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
|
|
|
if (anyMarked)
|
|
|
|
(*pScreen->HandleExposures)(pLayerWin->parent);
|
|
|
|
if (anyMarked && pScreen->PostValidateTree)
|
|
|
|
(*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow,
|
|
|
|
VTOther);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
if (pWin->realized)
|
2010-05-27 18:11:50 +02:00
|
|
|
WindowsRestructured ();
|
2003-11-14 16:54:54 +01:00
|
|
|
CheckCursorConfinement(pWin);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Keeps the same inside(!) origin */
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
miChangeBorderWidth(WindowPtr pWin, unsigned int width)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int oldwidth;
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool anyMarked = FALSE;
|
2007-03-09 04:46:23 +01:00
|
|
|
ScreenPtr pScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
Bool WasViewable = (Bool)(pWin->viewable);
|
|
|
|
Bool HadBorder;
|
|
|
|
WindowPtr pLayerWin;
|
|
|
|
|
|
|
|
oldwidth = wBorderWidth (pWin);
|
|
|
|
if (oldwidth == width)
|
|
|
|
return;
|
|
|
|
HadBorder = HasBorder(pWin);
|
|
|
|
pScreen = pWin->drawable.pScreen;
|
|
|
|
if (WasViewable && width < oldwidth)
|
|
|
|
anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin);
|
|
|
|
|
|
|
|
pWin->borderWidth = width;
|
|
|
|
SetBorderSize (pWin);
|
|
|
|
|
|
|
|
if (WasViewable)
|
|
|
|
{
|
|
|
|
if (width > oldwidth)
|
|
|
|
{
|
|
|
|
anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
|
|
|
&pLayerWin);
|
|
|
|
/*
|
|
|
|
* save the old border visible region to correctly compute
|
|
|
|
* borderExposed.
|
|
|
|
*/
|
|
|
|
if (pWin->valdata && HadBorder)
|
|
|
|
{
|
|
|
|
RegionPtr borderVisible;
|
2010-05-22 00:05:48 +02:00
|
|
|
borderVisible = RegionCreate(NULL, 1);
|
|
|
|
RegionSubtract(borderVisible,
|
2003-11-14 16:54:54 +01:00
|
|
|
&pWin->borderClip, &pWin->winSize);
|
|
|
|
pWin->valdata->before.borderVisible = borderVisible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (anyMarked)
|
|
|
|
{
|
|
|
|
(*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther);
|
|
|
|
(*pScreen->HandleExposures)(pLayerWin->parent);
|
|
|
|
}
|
|
|
|
if (anyMarked && pScreen->PostValidateTree)
|
|
|
|
(*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin,
|
|
|
|
VTOther);
|
|
|
|
}
|
|
|
|
if (pWin->realized)
|
|
|
|
WindowsRestructured ();
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
miMarkUnrealizedWindow(WindowPtr pChild, WindowPtr pWin, Bool fromConfigure)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
if ((pChild != pWin) || fromConfigure)
|
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionEmpty(&pChild->clipList);
|
2003-11-14 16:54:54 +01:00
|
|
|
if (pChild->drawable.pScreen->ClipNotify)
|
|
|
|
(* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0);
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionEmpty(&pChild->borderClip);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:49:22 +01:00
|
|
|
miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth)
|
|
|
|
{
|
|
|
|
WindowPtr pChild;
|
|
|
|
|
|
|
|
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
|
|
|
|
{
|
|
|
|
if (pChild->drawable.depth == depth)
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUnion(pReg, pReg, &pChild->borderClip);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if (pChild->firstChild)
|
|
|
|
miSegregateChildren(pChild, pReg, depth);
|
|
|
|
}
|
|
|
|
}
|