ChangePicture takes wire XIDs, but didn't do any Xinerama translation, which meant setting a clip pixmap or a separate alpha picture would result in those elements pointing at the instance of the pixmap on screen 0. Which is, you know, bad.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49170 Signed-off-by: Adam Jackson <[email protected]> --- render/picture.c | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/render/picture.c b/render/picture.c index cd9bc74..31799b6 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1007,6 +1007,38 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, return pPicture; } +static int +cpAlphaMap(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode) +{ +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + PanoramiXRes *res; + int err = dixLookupResourceByType((void **)&res, id, XRT_PICTURE, + client, mode); + if (err != Success) + return err; + id = res->info[screen->myNum]; + } +#endif + return dixLookupResourceByType(result, id, PictureType, client, mode); +} + +static int +cpClipMask(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode) +{ +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + PanoramiXRes *res; + int err = dixLookupResourceByType((void **)&res, id, XRT_PIXMAP, + client, mode); + if (err != Success) + return err; + id = res->info[screen->myNum]; + } +#endif + return dixLookupResourceByType(result, id, RT_PIXMAP, client, mode); +} + #define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val) #define NEXT_PTR(_type) ((_type) ulist++->ptr) @@ -1053,9 +1085,8 @@ ChangePicture(PicturePtr pPicture, if (pid == None) pAlpha = 0; else { - error = dixLookupResourceByType((void **) &pAlpha, pid, - PictureType, client, - DixReadAccess); + error = cpAlphaMap((void **) &pAlpha, pid, pScreen, + client, DixReadAccess); if (error != Success) { client->errorValue = pid; break; @@ -1112,9 +1143,8 @@ ChangePicture(PicturePtr pPicture, } else { clipType = CT_PIXMAP; - error = dixLookupResourceByType((void **) &pPixmap, pid, - RT_PIXMAP, client, - DixReadAccess); + error = cpClipMask((void **) &pPixmap, pid, pScreen, + client, DixReadAccess); if (error != Success) { client->errorValue = pid; break; -- 1.9.3 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
