xserver: Branch 'server-1.6-branch' - 2 commits
Keith Packard
keithp at kemper.freedesktop.org
Fri Jan 30 16:05:36 PST 2009
randr/rrcrtc.c | 23 ++++++++++++++++++-----
randr/rrxinerama.c | 27 ++++++++++++++++++++-------
2 files changed, 38 insertions(+), 12 deletions(-)
New commits:
commit 648807adb059b6cfc413d41e3a37670ce850aee6
Author: Keith Packard <keithp at keithp.com>
Date: Fri Jan 30 15:43:04 2009 -0800
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 at keithp.com>
(cherry picked from commit 6e49fdd2c839b6244c23ce95c3ae76a1a265b986)
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 99f7d1e..81ccf41 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -632,6 +632,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);
@@ -652,11 +653,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;
commit 9b2958b3a2fb4b65d67916ba7e98dfd21ad434f3
Author: Maarten Maathuis <madman2003 at gmail.com>
Date: Fri Dec 19 18:59:27 2008 +0100
randr: Consider panned crtc's when calculating xinerama screen sizes.
- This will allow window managers and applications to actually use the panned area.
(cherry picked from commit 332d65ec7a6e94d75efe95d53742f137835274de)
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index ad40a1e..5af6fb0 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -267,12 +267,26 @@ RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
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;
+ ScreenPtr pScreen = crtc->pScreen;
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
+ BoxRec panned_area;
+
+ /* Check to see if crtc is panned and return the full area when applicable. */
+ if (pScrPriv && pScrPriv->rrGetPanning &&
+ pScrPriv->rrGetPanning (pScreen, crtc, &panned_area, NULL, NULL) &&
+ (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) {
+ scratch.x_org = panned_area.x1;
+ scratch.y_org = panned_area.y1;
+ scratch.width = panned_area.x2 - panned_area.x1;
+ scratch.height = panned_area.y2 - panned_area.y1;
+ } else {
+ 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);
@@ -313,7 +327,6 @@ ProcRRXineramaQueryScreens(ClientPtr client)
if(rep.number) {
rrScrPriv(pScreen);
- xXineramaScreenInfo scratch;
int i;
int has_primary = (pScrPriv->primaryOutput != NULL);
More information about the xorg-commit
mailing list