summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-26 12:56:51 +1000
committerKeith Packard <keithp@keithp.com>2012-08-06 15:42:39 -0700
commit454d0e3a1bb14d7f2579ccb5e513cec5686160e7 (patch)
tree1ff4e1cb800ee3fbfbb43b21bb2b0c8971a9c517
parent94b514d5e4b376d05e106eb3853da511256e8545 (diff)
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>
-rw-r--r--randr/rrxinerama.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 87d6a73e8..76d728c70 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -157,6 +157,7 @@ static int
RRXineramaScreenCount(ScreenPtr pScreen)
{
int i, n;
+ ScreenPtr slave;
n = 0;
if (rrGetScrPriv(pScreen)) {
@@ -165,6 +166,15 @@ RRXineramaScreenCount(ScreenPtr pScreen)
if (RRXineramaCrtcActive(pScrPriv->crtcs[i]))
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;
}
@@ -308,6 +318,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
xXineramaQueryScreensReply rep;
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
int n = 0;
+ int i;
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
@@ -330,8 +341,8 @@ ProcRRXineramaQueryScreens(ClientPtr client)
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
if (n) {
+ ScreenPtr slave;
rrScrPriv(pScreen);
- int i;
int has_primary = 0;
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
@@ -347,6 +358,13 @@ ProcRRXineramaQueryScreens(ClientPtr client)
}
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;