composite: Fix COW creation for Xinerama (v2)
Say you have two 800x600 screens left/right of each other. A window that's 200x200 at +700+0 in protocol coordinate space will appear to be at -100+0 in the coordinate space of the right hand screen. Put another way: windows are in the coordinate space of their root window pixmap. We weren't doing this translation for the COW, so when rendering came in to it you'd see the top-left chunk of the COW on all screens. Cool effect and all, but wrong. v2: Only translate when Xinerama is active [keithp] Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
8dbe456aba
commit
1dd839a425
|
@ -133,16 +133,19 @@ compCreateOverlayWindow(ScreenPtr pScreen)
|
||||||
int result;
|
int result;
|
||||||
int w = pScreen->width;
|
int w = pScreen->width;
|
||||||
int h = pScreen->height;
|
int h = pScreen->height;
|
||||||
|
int x = 0, y = 0;
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
|
x = -pScreen->x;
|
||||||
|
y = -pScreen->y;
|
||||||
w = PanoramiXPixWidth;
|
w = PanoramiXPixWidth;
|
||||||
h = PanoramiXPixHeight;
|
h = PanoramiXPixHeight;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pWin = cs->pOverlayWin =
|
pWin = cs->pOverlayWin =
|
||||||
CreateWindow(cs->overlayWid, pRoot, 0, 0, w, h, 0,
|
CreateWindow(cs->overlayWid, pRoot, x, y, w, h, 0,
|
||||||
InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
|
InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
|
||||||
pRoot->drawable.depth,
|
pRoot->drawable.depth,
|
||||||
serverClient, pScreen->rootVisual, &result);
|
serverClient, pScreen->rootVisual, &result);
|
||||||
|
|
Loading…
Reference in New Issue