Fix composite overlay window bug 6411

This commit is contained in:
Deron Johnson 2006-03-29 17:51:54 +00:00
parent ff6f88348c
commit e31e8ace10
5 changed files with 66 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2006-3-29 Deron Johnson <deron.johnson@sun.com>
* xorg/composite/compinit.c
* xorg/composite/compwindow.c
* xorg/dix/window.c
* xorg/include/window.h
Fix composite overlay window bug 6411.
2006-03-28 Adam Jackson <ajax@freedesktop.org> 2006-03-28 Adam Jackson <ajax@freedesktop.org>
* afb/afbbitblt.c: * afb/afbbitblt.c:

View File

@ -88,6 +88,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
xfree (cs); xfree (cs);
pScreen->devPrivates[CompScreenPrivateIndex].ptr = 0; pScreen->devPrivates[CompScreenPrivateIndex].ptr = 0;
ret = (*pScreen->CloseScreen) (index, pScreen); ret = (*pScreen->CloseScreen) (index, pScreen);
return ret; return ret;
} }
@ -419,5 +420,7 @@ compScreenInit (ScreenPtr pScreen)
pScreen->devPrivates[CompScreenPrivateIndex].ptr = (pointer) cs; pScreen->devPrivates[CompScreenPrivateIndex].ptr = (pointer) cs;
RegisterRealChildHeadProc(CompositeRealChildHead);
return TRUE; return TRUE;
} }

View File

@ -144,11 +144,19 @@ Bool
compCheckRedirect (WindowPtr pWin) compCheckRedirect (WindowPtr pWin)
{ {
CompWindowPtr cw = GetCompWindow (pWin); CompWindowPtr cw = GetCompWindow (pWin);
CompScreenPtr cs = GetCompScreen(pWin->drawable.pScreen);
Bool should; Bool should;
should = pWin->realized && (pWin->drawable.class != InputOnly) && should = pWin->realized && (pWin->drawable.class != InputOnly) &&
(cw != NULL); (cw != NULL);
/* Never redirect the overlay window */
if (cs->pOverlayWin != NULL) {
if (pWin == cs->pOverlayWin) {
should = FALSE;
}
}
if (should != pWin->redirectDraw) if (should != pWin->redirectDraw)
{ {
if (should) if (should)

View File

@ -2,6 +2,28 @@
/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */
/* /*
Copyright (c) 2004, Sun Microsystems, Inc.
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
SUN MICROSYSTEMS 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 Sun Microsystems shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Sun Microsystems.
Copyright 1987, 1998 The Open Group Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its Permission to use, copy, modify, distribute, and sell this software and its
@ -512,6 +534,7 @@ ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn,
register int x, register int y, register int x, register int y,
register int w, register int h) register int w, register int h)
{ {
ScreenPtr pScreen = pWin->drawable.pScreen;
BoxRec box; BoxRec box;
box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); box = *(REGION_EXTENTS(pScreen, &pWin->winSize));
@ -534,9 +557,22 @@ ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn,
REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize); REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize);
} }
static RealChildHeadProc realChildHeadProc = NULL;
void
RegisterRealChildHeadProc (RealChildHeadProc proc)
{
realChildHeadProc = proc;
}
WindowPtr WindowPtr
RealChildHead(register WindowPtr pWin) RealChildHead(register WindowPtr pWin)
{ {
if (realChildHeadProc) {
return realChildHeadProc (pWin);
}
if (!pWin->parent && if (!pWin->parent &&
(screenIsSaved == SCREEN_SAVER_ON) && (screenIsSaved == SCREEN_SAVER_ON) &&
(HasSaverWindow (pWin->drawable.pScreen->myNum))) (HasSaverWindow (pWin->drawable.pScreen->myNum)))
@ -1610,6 +1646,8 @@ CreateUnclippedWinSize (register WindowPtr pWin)
pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1);
#ifdef SHAPE #ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) { if (wBoundingShape (pWin) || wClipShape (pWin)) {
ScreenPtr pScreen = pWin->drawable.pScreen;
REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x,
- pWin->drawable.y); - pWin->drawable.y);
if (wBoundingShape (pWin)) if (wBoundingShape (pWin))
@ -1644,6 +1682,8 @@ SetWinSize (register WindowPtr pWin)
(int)pWin->drawable.height); (int)pWin->drawable.height);
#ifdef SHAPE #ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) { if (wBoundingShape (pWin) || wClipShape (pWin)) {
ScreenPtr pScreen = pWin->drawable.pScreen;
REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x,
- pWin->drawable.y); - pWin->drawable.y);
if (wBoundingShape (pWin)) if (wBoundingShape (pWin))
@ -1684,6 +1724,8 @@ SetBorderSize (register WindowPtr pWin)
(int)(pWin->drawable.height + (bw<<1))); (int)(pWin->drawable.height + (bw<<1)));
#ifdef SHAPE #ifdef SHAPE
if (wBoundingShape (pWin)) { if (wBoundingShape (pWin)) {
ScreenPtr pScreen = pWin->drawable.pScreen;
REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x,
- pWin->drawable.y); - pWin->drawable.y);
REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize, REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize,
@ -1893,6 +1935,7 @@ MakeBoundingRegion (
BoxPtr pBox) BoxPtr pBox)
{ {
RegionPtr pRgn; RegionPtr pRgn;
ScreenPtr pScreen = pWin->drawable.pScreen;
pRgn = REGION_CREATE(pScreen, pBox, 1); pRgn = REGION_CREATE(pScreen, pBox, 1);
if (wBoundingShape (pWin)) { if (wBoundingShape (pWin)) {

View File

@ -102,6 +102,10 @@ extern void ClippedRegionFromBox(
int /*w*/, int /*w*/,
int /*h*/); int /*h*/);
typedef WindowPtr (* RealChildHeadProc) (WindowPtr pWin);
void RegisterRealChildHeadProc (RealChildHeadProc proc);
extern WindowPtr RealChildHead( extern WindowPtr RealChildHead(
WindowPtr /*pWin*/); WindowPtr /*pWin*/);