aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xfixes/region.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xfixes/region.c')
-rw-r--r--xorg-server/xfixes/region.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c
index 0e9ca443f..14a02ba1d 100644
--- a/xorg-server/xfixes/region.c
+++ b/xorg-server/xfixes/region.c
@@ -857,6 +857,7 @@ PanoramiXFixesSetWindowShapeRegion(ClientPtr client)
{
int result = Success, j;
PanoramiXRes *win;
+ RegionPtr reg = NULL;
REQUEST(xXFixesSetWindowShapeRegionReq);
@@ -869,10 +870,22 @@ PanoramiXFixesSetWindowShapeRegion(ClientPtr client)
return result;
}
+ if (win->u.win.root)
+ VERIFY_REGION_OR_NONE(reg, stuff->region, client, DixReadAccess);
+
FOR_NSCREENS_FORWARD(j) {
+ ScreenPtr screen = screenInfo.screens[j];
stuff->dest = win->info[j].id;
+
+ if (reg)
+ RegionTranslate(reg, -screen->x, -screen->y);
+
result =
(*PanoramiXSaveXFixesVector[X_XFixesSetWindowShapeRegion]) (client);
+
+ if (reg)
+ RegionTranslate(reg, screen->x, screen->y);
+
if (result != Success)
break;
}
@@ -886,6 +899,7 @@ PanoramiXFixesSetPictureClipRegion(ClientPtr client)
REQUEST(xXFixesSetPictureClipRegionReq);
int result = Success, j;
PanoramiXRes *pict;
+ RegionPtr reg = NULL;
REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
@@ -896,10 +910,22 @@ PanoramiXFixesSetPictureClipRegion(ClientPtr client)
return result;
}
+ if (pict->u.pict.root)
+ VERIFY_REGION_OR_NONE(reg, stuff->region, client, DixReadAccess);
+
FOR_NSCREENS_BACKWARD(j) {
+ ScreenPtr screen = screenInfo.screens[j];
stuff->picture = pict->info[j].id;
+
+ if (reg)
+ RegionTranslate(reg, -screen->x, -screen->y);
+
result =
(*PanoramiXSaveXFixesVector[X_XFixesSetPictureClipRegion]) (client);
+
+ if (reg)
+ RegionTranslate(reg, screen->x, screen->y);
+
if (result != Success)
break;
}