aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/composite/compwindow.c
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-12-15 12:55:17 +0100
committerMihai Moldovan <ionic@ionic.de>2017-12-15 12:55:17 +0100
commit1dad092caf01d733990648e6df64cbf964df5143 (patch)
tree39de0e643e76754a3e23ca9dd0350b8ba4f76250 /nx-X11/programs/Xserver/composite/compwindow.c
parent6d70b9e3c47f27a166f4aacb522c5c1e49092dd9 (diff)
parent2b9025f797ee322e21077e100c2ee27c2e7fa0e0 (diff)
downloadnx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.gz
nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.bz2
nx-libs-1dad092caf01d733990648e6df64cbf964df5143.zip
Merge branch '3.6.x'
Diffstat (limited to 'nx-X11/programs/Xserver/composite/compwindow.c')
-rw-r--r--nx-X11/programs/Xserver/composite/compwindow.c366
1 files changed, 260 insertions, 106 deletions
diff --git a/nx-X11/programs/Xserver/composite/compwindow.c b/nx-X11/programs/Xserver/composite/compwindow.c
index 2093095f0..e9bb39827 100644
--- a/nx-X11/programs/Xserver/composite/compwindow.c
+++ b/nx-X11/programs/Xserver/composite/compwindow.c
@@ -28,9 +28,13 @@
#include "compint.h"
+#ifdef PANORAMIX
+#include "panoramiXsrv.h"
+#endif
+
#ifdef COMPOSITE_DEBUG
static int
-compCheckWindow (WindowPtr pWin, pointer data)
+compCheckWindow (WindowPtr pWin, void * data)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
PixmapPtr pWinPixmap = (*pScreen->GetWindowPixmap) (pWin);
@@ -39,10 +43,10 @@ compCheckWindow (WindowPtr pWin, pointer data)
if (!pWin->parent)
{
- assert (!pWin->redirectDraw);
+ assert (pWin->redirectDraw == RedriectDrawNone);
assert (pWinPixmap == pScreenPixmap);
}
- else if (pWin->redirectDraw)
+ else if (pWin->redirectDraw != RedirectDrawNone)
{
assert (pWinPixmap != pParentPixmap);
assert (pWinPixmap != pScreenPixmap);
@@ -71,29 +75,41 @@ typedef struct _compPixmapVisit {
} CompPixmapVisitRec, *CompPixmapVisitPtr;
static Bool
-compRepaintBorder (ClientPtr pClient, pointer closure)
+compRepaintBorder (ClientPtr pClient, void * closure)
{
- WindowPtr pWindow = LookupWindow ((XID) closure, pClient);
+ WindowPtr pWindow;
+#ifndef NXAGENT_SERVER
+ int rc =
+ dixLookupWindow(&pWindow, (XID) (intptr_t) closure, pClient,
+ DixWriteAccess);
+#else
+ pWindow = SecurityLookupWindow((XID) (intptr_t) closure, pClient, DixWriteAccess);
+ int rc = pWindow ? Success : BadWindow;
+#endif
- if (pWindow)
+ if (rc == Success)
{
RegionRec exposed;
- REGION_NULL(pScreen, &exposed);
- REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize);
+ RegionNull(&exposed);
+ RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize);
+#ifndef NXAGENT_SERVER
+ pWindow->drawable.pScreen->PaintWindowBorder(pWindow, &exposed, PW_BORDER);
+#else
(*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER);
- REGION_UNINIT(pScreen, &exposed);
+#endif
+ RegionUninit(&exposed);
}
return TRUE;
}
static int
-compSetPixmapVisitWindow (WindowPtr pWindow, pointer data)
+compSetPixmapVisitWindow (WindowPtr pWindow, void * data)
{
CompPixmapVisitPtr pVisit = (CompPixmapVisitPtr) data;
ScreenPtr pScreen = pWindow->drawable.pScreen;
- if (pWindow != pVisit->pWindow && pWindow->redirectDraw)
+ if (pWindow != pVisit->pWindow && pWindow->redirectDraw != RedirectDrawNone)
return WT_DONTWALKCHILDREN;
(*pScreen->SetWindowPixmap) (pWindow, pVisit->pPixmap);
/*
@@ -105,7 +121,7 @@ compSetPixmapVisitWindow (WindowPtr pWindow, pointer data)
SetBorderSize (pWindow);
if (HasBorder (pWindow))
QueueWorkProc (compRepaintBorder, serverClient,
- (pointer) pWindow->drawable.id);
+ (void *) (intptr_t) pWindow->drawable.id);
return WT_WALKCHILDREN;
}
@@ -116,7 +132,7 @@ compSetPixmap (WindowPtr pWindow, PixmapPtr pPixmap)
visitRec.pWindow = pWindow;
visitRec.pPixmap = pPixmap;
- TraverseTree (pWindow, compSetPixmapVisitWindow, (pointer) &visitRec);
+ TraverseTree (pWindow, compSetPixmapVisitWindow, (void *) &visitRec);
compCheckTree (pWindow->drawable.pScreen);
}
@@ -124,21 +140,73 @@ Bool
compCheckRedirect (WindowPtr pWin)
{
CompWindowPtr cw = GetCompWindow (pWin);
+ CompScreenPtr cs = GetCompScreen(pWin->drawable.pScreen);
Bool should;
should = pWin->realized && (pWin->drawable.class != InputOnly) &&
- (cw != NULL);
+ (cw != NULL) && (pWin->parent != NULL);
- if (should != pWin->redirectDraw)
+ /* Never redirect the overlay window */
+ if (cs->pOverlayWin != NULL) {
+ if (pWin == cs->pOverlayWin) {
+ should = FALSE;
+ }
+ }
+
+ if (should != (pWin->redirectDraw != RedirectDrawNone))
{
if (should)
return compAllocPixmap (pWin);
+ else {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
+
+ compSetParentPixmap(pWin);
+ compRestoreWindow(pWin, pPixmap);
+ (*pScreen->DestroyPixmap) (pPixmap);
+ }
+ }
+ else if (should) {
+ if (cw->update == CompositeRedirectAutomatic)
+ pWin->redirectDraw = RedirectDrawAutomatic;
else
- compFreePixmap (pWin);
+ pWin->redirectDraw = RedirectDrawManual;
}
return TRUE;
}
+static int
+updateOverlayWindow(ScreenPtr pScreen)
+{
+ CompScreenPtr cs;
+ WindowPtr pWin; /* overlay window */
+ XID vlist[2];
+ int w = pScreen->width;
+ int h = pScreen->height;
+
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) {
+ w = PanoramiXPixWidth;
+ h = PanoramiXPixHeight;
+ }
+#endif
+
+ cs = GetCompScreen(pScreen);
+ if ((pWin = cs->pOverlayWin) != NULL) {
+ if ((pWin->drawable.width == w) && (pWin->drawable.height == h))
+ return Success;
+
+ /* Let's resize the overlay window. */
+ vlist[0] = w;
+ vlist[1] = h;
+ return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
+ }
+
+ /* Let's be on the safe side and not assume an overlay window is
+ always allocated. */
+ return Success;
+}
+
Bool
compPositionWindow (WindowPtr pWin, int x, int y)
{
@@ -153,10 +221,11 @@ compPositionWindow (WindowPtr pWin, int x, int y)
compCheckRedirect (pWin);
*/
#ifdef COMPOSITE_DEBUG
- if (pWin->redirectDraw != (pWin->viewable && (GetCompWindow(pWin) != NULL)))
+ if ((pWin->redirectDraw != RedirectDrawNone) !=
+ (pWin->viewable && (GetCompWindow(pWin) != NULL)))
abort ();
#endif
- if (pWin->redirectDraw)
+ if (pWin->redirectDraw != RedirectDrawNone)
{
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
int bw = wBorderWidth (pWin);
@@ -176,6 +245,8 @@ compPositionWindow (WindowPtr pWin, int x, int y)
cs->PositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = compPositionWindow;
compCheckTree (pWin->drawable.pScreen);
+ if (updateOverlayWindow(pScreen) != Success)
+ ret = FALSE;
return ret;
}
@@ -213,21 +284,6 @@ compUnrealizeWindow (WindowPtr pWin)
return ret;
}
-void
-compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- CompSubwindowsPtr csw = GetCompSubwindows (pWin);
- CompScreenPtr cs = GetCompScreen (pScreen);
-
- if (csw && csw->update == CompositeRedirectManual)
- return;
- pScreen->PaintWindowBackground = cs->PaintWindowBackground;
- (*pScreen->PaintWindowBackground) (pWin, pRegion, what);
- cs->PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreen->PaintWindowBackground = compPaintWindowBackground;
-}
-
/*
* Called after the borderClip for the window has settled down
* We use this to make sure our extra borderClip has the right origin
@@ -245,7 +301,7 @@ compClipNotify (WindowPtr pWin, int dx, int dy)
if (cw->borderClipX != pWin->drawable.x ||
cw->borderClipY != pWin->drawable.y)
{
- REGION_TRANSLATE (pScreen, &cw->borderClip,
+ RegionTranslate(&cw->borderClip,
pWin->drawable.x - cw->borderClipX,
pWin->drawable.y - cw->borderClipY);
cw->borderClipX = pWin->drawable.x;
@@ -273,13 +329,28 @@ compIsAlternateVisual (ScreenPtr pScreen,
CompScreenPtr cs = GetCompScreen (pScreen);
int i;
- for (i = 0; i < NUM_COMP_ALTERNATE_VISUALS; i++)
+ for (i = 0; i < cs->numAlternateVisuals; i++)
if (cs->alternateVisuals[i] == visual)
return TRUE;
return FALSE;
}
static Bool
+compIsImplicitRedirectException(ScreenPtr pScreen,
+ XID parentVisual, XID winVisual)
+{
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ int i;
+
+ for (i = 0; i < cs->numImplicitRedirectExceptions; i++)
+ if (cs->implicitRedirectExceptions[i].parentVisual == parentVisual &&
+ cs->implicitRedirectExceptions[i].winVisual == winVisual)
+ return TRUE;
+
+ return FALSE;
+}
+
+static Bool
compImplicitRedirect (WindowPtr pWin, WindowPtr pParent)
{
if (pParent)
@@ -287,6 +358,9 @@ compImplicitRedirect (WindowPtr pWin, WindowPtr pParent)
ScreenPtr pScreen = pWin->drawable.pScreen;
XID winVisual = wVisual (pWin);
XID parentVisual = wVisual (pParent);
+
+ if (compIsImplicitRedirectException(pScreen, parentVisual, winVisual))
+ return FALSE;
if (winVisual != parentVisual &&
(compIsAlternateVisual (pScreen, winVisual) ||
@@ -296,6 +370,21 @@ compImplicitRedirect (WindowPtr pWin, WindowPtr pParent)
return FALSE;
}
+static void
+compFreeOldPixmap(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ if (pWin->redirectDraw != RedirectDrawNone) {
+ CompWindowPtr cw = GetCompWindow(pWin);
+
+ if (cw->pOldPixmap) {
+ (*pScreen->DestroyPixmap) (cw->pOldPixmap);
+ cw->pOldPixmap = NullPixmap;
+ }
+ }
+}
+
void
compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
{
@@ -303,8 +392,7 @@ compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
CompScreenPtr cs = GetCompScreen (pScreen);
compCheckTree (pScreen);
- if (pWin->redirectDraw)
- {
+ if (pWin->redirectDraw != RedirectDrawNone) {
WindowPtr pParent;
int draw_x, draw_y;
unsigned int w, h, bw;
@@ -312,7 +400,7 @@ compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
/* if this is a root window, can't be moved */
if (!(pParent = pWin->parent))
return;
-
+
bw = wBorderWidth (pWin);
draw_x = pParent->drawable.x + x + (int)bw;
draw_y = pParent->drawable.y + y + (int)bw;
@@ -327,16 +415,7 @@ compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
cs->MoveWindow = pScreen->MoveWindow;
pScreen->MoveWindow = compMoveWindow;
- if (pWin->redirectDraw)
- {
- CompWindowPtr cw = GetCompWindow (pWin);
- if (cw->pOldPixmap)
- {
- (*pScreen->DestroyPixmap) (cw->pOldPixmap);
- cw->pOldPixmap = NullPixmap;
- }
- }
-
+ compFreeOldPixmap(pWin);
compCheckTree (pScreen);
}
@@ -348,12 +427,12 @@ compResizeWindow (WindowPtr pWin, int x, int y,
CompScreenPtr cs = GetCompScreen (pScreen);
compCheckTree (pScreen);
- if (pWin->redirectDraw)
+ if (pWin->redirectDraw != RedirectDrawNone)
{
WindowPtr pParent;
int draw_x, draw_y;
unsigned int bw;
-
+
/* if this is a root window, can't be moved */
if (!(pParent = pWin->parent))
return;
@@ -364,20 +443,13 @@ compResizeWindow (WindowPtr pWin, int x, int y,
compReallocPixmap (pWin, draw_x, draw_y, w, h, bw);
}
compCheckTree (pScreen);
-
+
pScreen->ResizeWindow = cs->ResizeWindow;
(*pScreen->ResizeWindow) (pWin, x, y, w, h, pSib);
cs->ResizeWindow = pScreen->ResizeWindow;
pScreen->ResizeWindow = compResizeWindow;
- if (pWin->redirectDraw)
- {
- CompWindowPtr cw = GetCompWindow (pWin);
- if (cw->pOldPixmap)
- {
- (*pScreen->DestroyPixmap) (cw->pOldPixmap);
- cw->pOldPixmap = NullPixmap;
- }
- }
+
+ compFreeOldPixmap(pWin);
compCheckTree (pWin->drawable.pScreen);
}
@@ -388,37 +460,30 @@ compChangeBorderWidth (WindowPtr pWin, unsigned int bw)
CompScreenPtr cs = GetCompScreen (pScreen);
compCheckTree (pScreen);
- if (pWin->redirectDraw)
+ if (pWin->redirectDraw != RedirectDrawNone)
{
WindowPtr pParent;
int draw_x, draw_y;
unsigned int w, h;
-
+
/* if this is a root window, can't be moved */
if (!(pParent = pWin->parent))
return;
-
+
draw_x = pWin->drawable.x;
draw_y = pWin->drawable.y;
w = pWin->drawable.width;
h = pWin->drawable.height;
compReallocPixmap (pWin, draw_x, draw_y, w, h, bw);
}
- compCheckTree (pScreen);
+ compCheckTree (pScreen);
pScreen->ChangeBorderWidth = cs->ChangeBorderWidth;
(*pScreen->ChangeBorderWidth) (pWin, bw);
cs->ChangeBorderWidth = pScreen->ChangeBorderWidth;
pScreen->ChangeBorderWidth = compChangeBorderWidth;
- if (pWin->redirectDraw)
- {
- CompWindowPtr cw = GetCompWindow (pWin);
- if (cw->pOldPixmap)
- {
- (*pScreen->DestroyPixmap) (cw->pOldPixmap);
- cw->pOldPixmap = NullPixmap;
- }
- }
+
+ compFreeOldPixmap(pWin);
compCheckTree (pWin->drawable.pScreen);
}
@@ -454,7 +519,7 @@ compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent)
/*
* Reset pixmap pointers as appropriate
*/
- if (pWin->parent && !pWin->redirectDraw)
+ if (pWin->parent && pWin->redirectDraw == RedirectDrawNone)
compSetPixmap (pWin, (*pScreen->GetWindowPixmap) (pWin->parent));
/*
* Call down to next function
@@ -473,7 +538,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
CompScreenPtr cs = GetCompScreen (pScreen);
int dx = 0, dy = 0;
- if (pWin->redirectDraw)
+ if (pWin->redirectDraw != RedirectDrawNone)
{
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
CompWindowPtr cw = GetCompWindow (pWin);
@@ -487,19 +552,18 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
* need to be copied to pNewPixmap.
*/
RegionRec rgnDst;
- PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
GCPtr pGC;
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
+ RegionTranslate(prgnSrc, -dx, -dy);
- REGION_NULL (pWin->drawable.pScreen, &rgnDst);
+ RegionNull(&rgnDst);
- REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst,
+ RegionIntersect(&rgnDst,
&pWin->borderClip, prgnSrc);
- REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst,
+ RegionTranslate(&rgnDst,
-pPixmap->screen_x, -pPixmap->screen_y);
dx = dx + pPixmap->screen_x - cw->oldx;
@@ -507,8 +571,8 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
if (pGC)
{
- BoxPtr pBox = REGION_RECTS (&rgnDst);
- int nBox = REGION_NUM_RECTS (&rgnDst);
+ BoxPtr pBox = RegionRects (&rgnDst);
+ int nBox = RegionNumRects (&rgnDst);
ValidateGC(&pPixmap->drawable, pGC);
while (nBox--)
@@ -524,6 +588,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
}
FreeScratchGC (pGC);
}
+ RegionUninit (&rgnDst);
return;
}
dx = pPixmap->screen_x - cw->oldx;
@@ -536,16 +601,16 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
if (ptOldOrg.x != pWin->drawable.x || ptOldOrg.y != pWin->drawable.y)
{
if (dx || dy)
- REGION_TRANSLATE (pScreen, prgnSrc, dx, dy);
+ RegionTranslate(prgnSrc, dx, dy);
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
if (dx || dy)
- REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy);
+ RegionTranslate(prgnSrc, -dx, -dy);
}
else
{
ptOldOrg.x -= dx;
ptOldOrg.y -= dy;
- REGION_TRANSLATE (prgnSrc, prgnSrc,
+ RegionTranslate(prgnSrc,
pWin->drawable.x - ptOldOrg.x,
pWin->drawable.y - ptOldOrg.y);
DamageDamageRegion (&pWin->drawable, prgnSrc);
@@ -568,8 +633,11 @@ compCreateWindow (WindowPtr pWin)
{
CompSubwindowsPtr csw = GetCompSubwindows (pWin->parent);
CompClientWindowPtr ccw;
+ PixmapPtr parent_pixmap = (*pScreen->GetWindowPixmap)(pWin->parent);
+ PixmapPtr window_pixmap = (*pScreen->GetWindowPixmap)(pWin);
- (*pScreen->SetWindowPixmap) (pWin, (*pScreen->GetWindowPixmap) (pWin->parent));
+ if (window_pixmap != parent_pixmap)
+ (*pScreen->SetWindowPixmap) (pWin, parent_pixmap);
if (csw)
for (ccw = csw->clients; ccw; ccw = ccw->next)
compRedirectWindow (clients[CLIENT_ID(ccw->id)],
@@ -598,8 +666,12 @@ compDestroyWindow (WindowPtr pWin)
while ((csw = GetCompSubwindows (pWin)))
FreeResource (csw->clients->id, RT_NONE);
- if (pWin->redirectDraw)
- compFreePixmap (pWin);
+ if (pWin->redirectDraw != RedirectDrawNone) {
+ PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
+
+ compSetParentPixmap (pWin);
+ (*pScreen->DestroyPixmap) (pPixmap);
+ }
ret = (*pScreen->DestroyWindow) (pWin);
cs->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = compDestroyWindow;
@@ -613,26 +685,26 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion)
CompWindowPtr cw = GetCompWindow (pWin);
RegionRec damage;
- REGION_NULL (pScreen, &damage);
+ RegionNull(&damage);
/*
* Align old border clip with new border clip
*/
- REGION_TRANSLATE (pScreen, &cw->borderClip,
+ RegionTranslate(&cw->borderClip,
pWin->drawable.x - cw->borderClipX,
pWin->drawable.y - cw->borderClipY);
/*
* Compute newly visible portion of window for repaint
*/
- REGION_SUBTRACT (pScreen, &damage, pRegion, &cw->borderClip);
+ RegionSubtract(&damage, pRegion, &cw->borderClip);
/*
* Report that as damaged so it will be redrawn
*/
DamageDamageRegion (&pWin->drawable, &damage);
- REGION_UNINIT (pScreen, &damage);
+ RegionUninit(&damage);
/*
* Save the new border clip region
*/
- REGION_COPY (pScreen, &cw->borderClip, pRegion);
+ RegionCopy(&cw->borderClip, pRegion);
cw->borderClipX = pWin->drawable.x;
cw->borderClipY = pWin->drawable.y;
}
@@ -658,7 +730,7 @@ compGetWindowVisual (WindowPtr pWin)
return 0;
}
-static PictFormatPtr
+PictFormatPtr
compWindowFormat (WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -694,18 +766,18 @@ compWindowUpdateAutomatic (WindowPtr pWin)
/*
* First move the region from window to screen coordinates
*/
- REGION_TRANSLATE (pScreen, pRegion,
+ RegionTranslate(pRegion,
pWin->drawable.x, pWin->drawable.y);
/*
* Clip against the "real" border clip
*/
- REGION_INTERSECT (pScreen, pRegion, pRegion, &cw->borderClip);
+ RegionIntersect(pRegion, pRegion, &cw->borderClip);
/*
* Now translate from screen to dest coordinates
*/
- REGION_TRANSLATE (pScreen, pRegion,
+ RegionTranslate(pRegion,
-pParent->drawable.x, -pParent->drawable.y);
/*
@@ -735,21 +807,103 @@ compWindowUpdateAutomatic (WindowPtr pWin)
DamageEmpty (cw->damage);
}
+static void
+compPaintWindowToParent(WindowPtr pWin)
+{
+ compPaintChildrenToWindow(pWin->drawable.pScreen, pWin);
+
+ if (pWin->redirectDraw != RedirectDrawNone) {
+ CompWindowPtr cw = GetCompWindow(pWin);
+
+ if (cw->damaged) {
+ compWindowUpdateAutomatic(pWin);
+ cw->damaged = FALSE;
+ }
+ }
+}
+
void
-compWindowUpdate (WindowPtr pWin)
+compPaintChildrenToWindow(ScreenPtr pScreen, WindowPtr pWin)
{
WindowPtr pChild;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+
+ if (!cs->damaged)
+ return;
for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
- compWindowUpdate (pChild);
- if (pWin->redirectDraw)
- {
- CompWindowPtr cw = GetCompWindow(pWin);
+ compPaintWindowToParent(pChild);
- if (cw->damaged)
- {
- compWindowUpdateAutomatic (pWin);
- cw->damaged = FALSE;
+ cs->damaged = FALSE;
+}
+
+WindowPtr
+CompositeRealChildHead(WindowPtr pWin)
+{
+ WindowPtr pChild, pChildBefore;
+ CompScreenPtr cs;
+
+ if (!pWin->parent &&
+ (screenIsSaved == SCREEN_SAVER_ON) &&
+ (HasSaverWindow(pWin->drawable.pScreen->myNum))) {
+
+ /* First child is the screen saver; see if next child is the overlay */
+ pChildBefore = pWin->firstChild;
+ pChild = pChildBefore->nextSib;
+
+ }
+ else {
+ pChildBefore = NullWindow;
+ pChild = pWin->firstChild;
+ }
+
+ if (!pChild) {
+ return NullWindow;
+ }
+
+ cs = GetCompScreen(pWin->drawable.pScreen);
+ if (pChild == cs->pOverlayWin) {
+ return pChild;
+ }
+ else {
+ return pChildBefore;
}
+}
+
+/* ConfigNotify not implemented... replace with the old pixmap reallocation algorithm... */
+/*
+int
+compConfigNotify(WindowPtr pWin, int x, int y, int w, int h,
+ int bw, WindowPtr pSib)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ Bool ret = 0;
+ WindowPtr pParent = pWin->parent;
+ int draw_x, draw_y;
+ Bool alloc_ret;
+
+ if (cs->ConfigNotify) {
+ pScreen->ConfigNotify = cs->ConfigNotify;
+ ret = (*pScreen->ConfigNotify) (pWin, x, y, w, h, bw, pSib);
+ cs->ConfigNotify = pScreen->ConfigNotify;
+ pScreen->ConfigNotify = compConfigNotify;
+
+ if (ret)
+ return ret;
}
+
+ if (pWin->redirectDraw == RedirectDrawNone)
+ return Success;
+
+ compCheckTree(pScreen);
+
+ draw_x = pParent->drawable.x + x + bw;
+ draw_y = pParent->drawable.y + y + bw;
+ alloc_ret = compReallocPixmap(pWin, draw_x, draw_y, w, h, bw);
+
+ if (alloc_ret == FALSE)
+ return BadAlloc;
+ return Success;
}
+*/