[PATCH 12/13] fixes: Fix PanoramiXSetWindowShapeRegion for root windows (v2)

Adam Jackson ajax at redhat.com
Fri Dec 6 15:21:29 PST 2013


Root windows in Xinerama are in the coordinate space of their root window
pixmap, not in protocol space.

v2: Only translate for root windows, sice the window shape is
drawable-relative.

Reviewed-by: Keith Packard <keithp at keithp.com>
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 xfixes/region.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/xfixes/region.c b/xfixes/region.c
index f2ae851..14a02ba 100644
--- a/xfixes/region.c
+++ b/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;
     }
-- 
1.8.4.2



More information about the xorg-devel mailing list