diff options
author | Keith Packard <keithp@keithp.com> | 2009-01-30 20:17:10 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-01-30 20:21:28 -0800 |
commit | 4de5705545792d77c9990bbec3e263a517757a2a (patch) | |
tree | e89fd28dad7edf1a1151836ed56495ecf354537e /randr/rrxinerama.c | |
parent | f716e3f3445d443cbc6507d27f806e9ad387120a (diff) |
RandR crtcs not fetched correctly when primary output is set.
Primary outputs may not have a CRTC.
Loops fetching CRTCs respecting primary output were broken.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'randr/rrxinerama.c')
-rw-r--r-- | randr/rrxinerama.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 0a14b7960..36135c6c1 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -324,16 +324,21 @@ ProcRRXineramaQueryScreens(ClientPtr client) if(rep.number) { rrScrPriv(pScreen); int i; - int has_primary = (pScrPriv->primaryOutput != NULL); + int has_primary = 0; - if (has_primary) { + if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) { + has_primary = 1; RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc); } for(i = 0; i < pScrPriv->numCrtcs; i++) { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - if (!has_primary || (crtc != pScrPriv->primaryOutput->crtc)) - RRXineramaWriteCrtc(client, crtc); + if (has_primary && + pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i]) + { + has_primary = 0; + continue; + } + RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]); } } |