summaryrefslogtreecommitdiff
path: root/randr/rrxinerama.c
diff options
context:
space:
mode:
Diffstat (limited to 'randr/rrxinerama.c')
-rw-r--r--randr/rrxinerama.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 26894a663..b336bd7cd 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -344,15 +344,17 @@ ProcRRXineramaQueryScreens(ClientPtr client)
ScreenPtr slave;
rrScrPriv(pScreen);
int has_primary = 0;
+ RRCrtcPtr primary_crtc = NULL;
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
has_primary = 1;
+ primary_crtc = pScrPriv->primaryOutput->crtc;
RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
}
for (i = 0; i < pScrPriv->numCrtcs; i++) {
if (has_primary &&
- pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i]) {
+ primary_crtc == pScrPriv->crtcs[i]) {
has_primary = 0;
continue;
}
@@ -362,8 +364,14 @@ ProcRRXineramaQueryScreens(ClientPtr client)
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
rrScrPrivPtr pSlavePriv;
pSlavePriv = rrGetScrPriv(slave);
- for (i = 0; i < pSlavePriv->numCrtcs; i++)
+ for (i = 0; i < pSlavePriv->numCrtcs; i++) {
+ if (has_primary &&
+ primary_crtc == pSlavePriv->crtcs[i]) {
+ has_primary = 0;
+ continue;
+ }
RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
+ }
}
}