summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2014-11-17 15:28:58 -0500
committerKeith Packard <keithp@keithp.com>2014-11-30 11:37:23 -0800
commit802932d112a3f6a09420be9e4a13fa78ac43840b (patch)
tree2af8b045630e5a5023e4e6ef00d91bb04d28941d /render
parentc2994001680a7dcf9c167886d49b7326c97cd5d1 (diff)
render: fix ChangePicture when Xinerama is active (v2) (#49170)
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. v2: This one actually builds. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49170 Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'render')
-rw-r--r--render/picture.c45
1 files changed, 39 insertions, 6 deletions
diff --git a/render/picture.c b/render/picture.c
index 711cbc7bb..6ff31ba02 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -41,6 +41,9 @@
#include "servermd.h"
#include "picturestr.h"
#include "xace.h"
+#ifdef PANORAMIX
+#include "panoramiXsrv.h"
+#endif
DevPrivateKeyRec PictureScreenPrivateKeyRec;
DevPrivateKeyRec PictureWindowPrivateKeyRec;
@@ -1007,6 +1010,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].id;
+ }
+#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].id;
+ }
+#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 +1088,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 +1146,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;