summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-08-14 21:57:58 +0000
committerKeith Packard <keithp@keithp.com>2004-08-14 21:57:58 +0000
commite483fe3ec384da556c31292001a86ec95c2ddc46 (patch)
treead11a2c2b8a3a902fc3e5ad06d853c7f90c48e8c
parente6216b48f5feee72f107348cb21bad724536ec62 (diff)
downloadxserver-e483fe3ec384da556c31292001a86ec95c2ddc46.tar.gz
Fix offsets again. Really, it works this time. Promise.
-rw-r--r--miext/cw/cw.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 5046164d9..5867c3ec1 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -679,7 +679,7 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
BoxPtr pExtents;
int x_off, y_off;
int dx, dy;
- DrawablePtr pBackingDrawable;
+ PixmapPtr pBackingPixmap;
RegionPtr pClip;
int src_x, src_y, dst_x, dst_y, w, h;
@@ -688,34 +688,35 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
pExtents = REGION_EXTENTS(pScreen, prgnSrc);
- src_x = pExtents->x1;
- src_y = pExtents->y1;
+ pBackingPixmap = (PixmapPtr) cwGetBackingDrawable((DrawablePtr)pWin,
+ &x_off, &y_off);
+
+ src_x = pExtents->x1 - pBackingPixmap->screen_x;
+ src_y = pExtents->y1 - pBackingPixmap->screen_y;
w = pExtents->x2 - pExtents->x1;
h = pExtents->y2 - pExtents->y1;
dst_x = src_x - dx;
dst_y = src_y - dy;
- pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off,
- &y_off);
-
/* Translate region (as required by API) */
REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- pGC = GetScratchGC(pBackingDrawable->depth, pScreen);
+ pGC = GetScratchGC(pBackingPixmap->drawable.depth, pScreen);
/*
* Copy region to GC as clip, aligning as dest clip
*/
pClip = REGION_CREATE (pScreen, NULL, 0);
REGION_INTERSECT(pScreen, pClip, &pWin->borderClip, prgnSrc);
REGION_TRANSLATE(pScreen, pClip,
- -pWin->drawable.x + x_off,
- -pWin->drawable.y + y_off);
+ -pBackingPixmap->screen_x,
+ -pBackingPixmap->screen_y);
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
- ValidateGC(pBackingDrawable, pGC);
+ ValidateGC(&pBackingPixmap->drawable, pGC);
- (*pGC->ops->CopyArea) (pBackingDrawable, pBackingDrawable, pGC,
+ (*pGC->ops->CopyArea) (&pBackingPixmap->drawable,
+ &pBackingPixmap->drawable, pGC,
src_x, src_y, w, h, dst_x, dst_y);
(*pGC->funcs->DestroyClip) (pGC);