rootless: Use screen_x and screen_y instead of pixmap pointer hacks

This updates rootless to treat pixmaps consistently with COMPOSITE,
using the screen_x and screen_y values rather than doing hacky math.

This will allow for proper bounds checking on a given PixmapRec.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia
2023-01-01 10:57:46 -08:00
parent 820b1dc461
commit 16e7cdba48
14 changed files with 28 additions and 32 deletions

View File

@@ -125,7 +125,7 @@ exaGetDrawablePixmap(DrawablePtr pDrawable)
void
exaGetDrawableDeltas(DrawablePtr pDrawable, PixmapPtr pPixmap, int *xp, int *yp)
{
#ifdef COMPOSITE
#if defined(COMPOSITE) || defined(ROOTLESS)
if (pDrawable->type == DRAWABLE_WINDOW) {
*xp = -pPixmap->screen_x;
*yp = -pPixmap->screen_y;

View File

@@ -963,7 +963,7 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
RegionInit(&rgnDst, NullBox, 0);
RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
#ifdef COMPOSITE
#if defined(COMPOSITE) || defined(ROOTLESS)
if (pPixmap->screen_x || pPixmap->screen_y)
RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y);
#endif