summaryrefslogtreecommitdiff
path: root/randr/rrcrtc.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-01-30 15:43:04 -0800
committerKeith Packard <keithp@keithp.com>2009-01-30 15:43:04 -0800
commit6e49fdd2c839b6244c23ce95c3ae76a1a265b986 (patch)
tree1f5b64c2570e22926221a2de4cd89d2178b34be2 /randr/rrcrtc.c
parentea309e47457156b60aadbf113f04e5b6851029c8 (diff)
Make RandR CRTC info report panning area instead of just crtc area
This makes the RandR info consistent with the Xinerama info. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'randr/rrcrtc.c')
-rw-r--r--randr/rrcrtc.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index d8aa37b9c..216083432 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -655,6 +655,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
RROutput *possible;
int i, j, k, n;
int width, height;
+ BoxRec panned_area;
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
@@ -675,11 +676,23 @@ ProcRRGetCrtcInfo (ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.timestamp = pScrPriv->lastSetTime.milliseconds;
- rep.x = crtc->x;
- rep.y = crtc->y;
- RRCrtcGetScanoutSize (crtc, &width, &height);
- rep.width = width;
- rep.height = height;
+ if (pScrPriv->rrGetPanning &&
+ pScrPriv->rrGetPanning (pScreen, crtc, &panned_area, NULL, NULL) &&
+ (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1))
+ {
+ rep.x = panned_area.x1;
+ rep.y = panned_area.y1;
+ rep.width = panned_area.x2 - panned_area.x1;
+ rep.height = panned_area.y2 - panned_area.y1;
+ }
+ else
+ {
+ RRCrtcGetScanoutSize (crtc, &width, &height);
+ rep.x = crtc->x;
+ rep.y = crtc->y;
+ rep.width = width;
+ rep.height = height;
+ }
rep.mode = mode ? mode->mode.id : 0;
rep.rotation = crtc->rotation;
rep.rotations = crtc->rotations;