randr: fix xinerama output for output slaves
This fixes the xinerama geometry when output slaves are enabled. Tested with xdpyinfo -ext XINERAMA before after slave added. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
94b514d5e4
commit
454d0e3a1b
|
@ -157,6 +157,7 @@ static int
|
||||||
RRXineramaScreenCount(ScreenPtr pScreen)
|
RRXineramaScreenCount(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
|
ScreenPtr slave;
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
if (rrGetScrPriv(pScreen)) {
|
if (rrGetScrPriv(pScreen)) {
|
||||||
|
@ -165,6 +166,15 @@ RRXineramaScreenCount(ScreenPtr pScreen)
|
||||||
if (RRXineramaCrtcActive(pScrPriv->crtcs[i]))
|
if (RRXineramaCrtcActive(pScrPriv->crtcs[i]))
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
|
||||||
|
rrScrPrivPtr pSlavePriv;
|
||||||
|
pSlavePriv = rrGetScrPriv(slave);
|
||||||
|
for (i = 0; i < pSlavePriv->numCrtcs; i++)
|
||||||
|
if (RRXineramaCrtcActive(pSlavePriv->crtcs[i]))
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,6 +318,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
|
||||||
xXineramaQueryScreensReply rep;
|
xXineramaQueryScreensReply rep;
|
||||||
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
|
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||||
|
|
||||||
|
@ -330,8 +341,8 @@ ProcRRXineramaQueryScreens(ClientPtr client)
|
||||||
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
|
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
|
||||||
|
|
||||||
if (n) {
|
if (n) {
|
||||||
|
ScreenPtr slave;
|
||||||
rrScrPriv(pScreen);
|
rrScrPriv(pScreen);
|
||||||
int i;
|
|
||||||
int has_primary = 0;
|
int has_primary = 0;
|
||||||
|
|
||||||
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
|
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
|
||||||
|
@ -347,6 +358,13 @@ ProcRRXineramaQueryScreens(ClientPtr client)
|
||||||
}
|
}
|
||||||
RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
|
RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
|
||||||
|
rrScrPrivPtr pSlavePriv;
|
||||||
|
pSlavePriv = rrGetScrPriv(slave);
|
||||||
|
for (i = 0; i < pSlavePriv->numCrtcs; i++)
|
||||||
|
RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
Loading…
Reference in New Issue