summaryrefslogtreecommitdiff
authorAdam Jackson <ajax@redhat.com>2008-12-08 22:28:55 (GMT)
committer Adam Jackson <ajax@redhat.com>2008-12-16 14:55:14 (GMT)
commit2ef02833d614c42693e019a444560e84f501b5dc (patch) (side-by-side diff)
tree06cd3a98c9f2fca1c0be1514fcfa15c5568ff598
parent0bdfdaa7df8105c7ffc3248a4fdd5f64da67103c (diff)
downloadxserver-2ef02833d614c42693e019a444560e84f501b5dc.zip
xserver-2ef02833d614c42693e019a444560e84f501b5dc.tar.gz
randr: Mangle compat Xinerama reply based on primary output
(cherry picked from commit d7b316e82bc7051f8829b4f4a640f50ae91c2db9)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--randr/rrxinerama.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 544666f..ad40a1e 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -260,6 +260,30 @@ ProcRRXineramaIsActive(ClientPtr client)
return client->noClientException;
}
+static void
+RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
+{
+ xXineramaScreenInfo scratch;
+
+ if (RRXineramaCrtcActive (crtc))
+ {
+ int width, height;
+ RRCrtcGetScanoutSize (crtc, &width, &height);
+ scratch.x_org = crtc->x;
+ scratch.y_org = crtc->y;
+ scratch.width = width;
+ scratch.height = height;
+ if(client->swapped) {
+ register int n;
+ swaps(&scratch.x_org, n);
+ swaps(&scratch.y_org, n);
+ swaps(&scratch.width, n);
+ swaps(&scratch.height, n);
+ }
+ WriteToClient(client, sz_XineramaScreenInfo, &scratch);
+ }
+}
+
int
ProcRRXineramaQueryScreens(ClientPtr client)
{
@@ -291,26 +315,16 @@ ProcRRXineramaQueryScreens(ClientPtr client)
rrScrPriv(pScreen);
xXineramaScreenInfo scratch;
int i;
+ int has_primary = (pScrPriv->primaryOutput != NULL);
+
+ if (has_primary) {
+ RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
+ }
for(i = 0; i < pScrPriv->numCrtcs; i++) {
RRCrtcPtr crtc = pScrPriv->crtcs[i];
- if (RRXineramaCrtcActive (crtc))
- {
- int width, height;
- RRCrtcGetScanoutSize (crtc, &width, &height);
- scratch.x_org = crtc->x;
- scratch.y_org = crtc->y;
- scratch.width = width;
- scratch.height = height;
- if(client->swapped) {
- register int n;
- swaps(&scratch.x_org, n);
- swaps(&scratch.y_org, n);
- swaps(&scratch.width, n);
- swaps(&scratch.height, n);
- }
- WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch);
- }
+ if (!has_primary || (crtc != pScrPriv->primaryOutput->crtc))
+ RRXineramaWriteCrtc(client, crtc);
}
}