On Fri, 9 Nov 2001, Mark Vojkovich wrote:
> OK. It looks like this there might be a bug in the mioverlay
> code. I'll look into fixing this for 4.2.0.
>
OK, I've fixed this in CVS. Attached is the patch to
xc/programs/Xserver/mi/mioverlay.c.
Mark.
*** mioverlay.c.old Sat Nov 10 20:42:50 2001
--- mioverlay.c Sat Nov 10 20:51:11 2001
***************
*** 75,80 ****
--- 75,82 ----
static void miOverlayWindowExposures(WindowPtr, RegionPtr, RegionPtr);
static void miOverlayResizeWindow(WindowPtr, int, int, unsigned int,
unsigned int, WindowPtr);
+ static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool);
+
#ifdef SHAPE
static void miOverlaySetShape(WindowPtr);
#endif
***************
*** 151,156 ****
--- 153,159 ----
pScreen->WindowExposures = miOverlayWindowExposures;
pScreen->ResizeWindow = miOverlayResizeWindow;
pScreen->MarkWindow = miOverlayMarkWindow;
+ pScreen->ClearToBackground = miOverlayClearToBackground;
#ifdef SHAPE
pScreen->SetShape = miOverlaySetShape;
#endif
***************
*** 1744,1749 ****
--- 1747,1812 ----
REGION_BREAK(pScreen, &pTree->clipList);
}
+
+ static void
+ miOverlayClearToBackground(
+ WindowPtr pWin,
+ int x, int y,
+ int w, int h,
+ Bool generateExposures
+ )
+ {
+ miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
+ BoxRec box;
+ RegionRec reg;
+ RegionPtr pBSReg = NullRegion;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ RegionPtr clipList;
+ BoxPtr extents;
+ int x1, y1, x2, y2;
+
+ 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;
+
+ clipList = (pTree) ? &pTree->clipList : &pWin->clipList;
+
+ extents = REGION_EXTENTS(pScreen, clipList);
+
+ 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 = y2 = y1 = 0;
+
+ box.x1 = x1; box.x2 = x2;
+ box.y1 = y1; box.y2 = y2;
+
+ REGION_INIT(pScreen, ®, &box, 1);
+ if (pWin->backStorage) {
+ pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h,
+ generateExposures);
+ }
+
+ REGION_INTERSECT(pScreen, ®, ®, clipList);
+ if (generateExposures)
+ (*pScreen->WindowExposures)(pWin, ®, pBSReg);
+ else if (pWin->backgroundState != None)
+ (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND);
+ REGION_UNINIT(pScreen, ®);
+ if (pBSReg)
+ REGION_DESTROY(pScreen, pBSReg);
+ }
+
/****************************************************************/