diff options
-rw-r--r-- | randr/rrscreen.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 7a8f2ebc7..9b1024e11 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -326,3 +326,3 @@ rrGetScreenResources(ClientPtr client, Bool query) unsigned long extraLen; - int i, n, rc; + int i, n, rc, has_primary; RRCrtc *crtcs; @@ -403,2 +403,10 @@ rrGetScreenResources(ClientPtr client, Bool query) names = (CARD8 *) (modeinfos + num_modes); + + has_primary = (pScrPriv->primaryOutput != NULL); + if (pScrPriv->primaryOutput) + { + crtcs[0] = pScrPriv->primaryOutput->id; + if (client->swapped) + swapl (&crtcs[0], n); + } @@ -406,5 +414,8 @@ rrGetScreenResources(ClientPtr client, Bool query) { - crtcs[i] = pScrPriv->crtcs[i]->id; + if (pScrPriv->primaryOutput && + pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i]) + continue; + crtcs[i + has_primary] = pScrPriv->crtcs[i]->id; if (client->swapped) - swapl (&crtcs[i], n); + swapl (&crtcs[i + has_primary], n); } |