[PATCH] xfixes: fix xinerama implementation of XFixesSetPictureClipRegion.

Dave Airlie airlied at gmail.com
Mon Apr 4 22:00:16 PDT 2011


From: Dave Airlie <airlied at redhat.com>

The xinerama version of this wasn't translating the coordinates correctly.

Running xcompmgr against a xinerama Xephyr setup, would never draw anything
on the second screen, and damage was occuring wrongly against the second screen.

anyone care to wonder if SetWindowShapeRegion needs work?

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 xfixes/region.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xfixes/region.c b/xfixes/region.c
index 81ead4d..e5d3664 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -900,7 +900,7 @@ PanoramiXFixesSetPictureClipRegion (ClientPtr client)
     REQUEST(xXFixesSetPictureClipRegionReq);
     int		    result = Success, j;
     PanoramiXRes    *pict;
-
+    INT16 orig_x, orig_y;
     REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
 
     if ((result = dixLookupResourceByType((void **)&pict, stuff->picture,
@@ -909,9 +909,16 @@ PanoramiXFixesSetPictureClipRegion (ClientPtr client)
 	client->errorValue = stuff->picture;
 	return result;
     }
+    orig_x = stuff->xOrigin;
+    orig_y = stuff->yOrigin;
 
     FOR_NSCREENS_BACKWARD(j) {
         stuff->picture = pict->info[j].id;
+        if (pict->u.pict.root)
+        {
+            stuff->xOrigin = orig_x - screenInfo.screens[j]->x;
+            stuff->yOrigin = orig_y - screenInfo.screens[j]->y;
+        }
 	result = (*PanoramiXSaveXFixesVector[X_XFixesSetPictureClipRegion]) (client);
         if(result != Success) break;
     }
-- 
1.7.1



More information about the xorg-devel mailing list