summaryrefslogtreecommitdiff
authorMaarten Maathuis <madman2003@gmail.com>2008-12-19 17:59:27 (GMT)
committer Maarten Maathuis <madman2003@gmail.com>2008-12-19 17:59:27 (GMT)
commit332d65ec7a6e94d75efe95d53742f137835274de (patch) (side-by-side diff)
tree73a2e641635a38133d78c7a5002b9b9130053951
parentf2d1de6c2a3e6e50db6d9714c293eb26324fbd3d (diff)
downloadxserver-332d65ec7a6e94d75efe95d53742f137835274de.zip
xserver-332d65ec7a6e94d75efe95d53742f137835274de.tar.gz
randr: Consider panned crtc's when calculating xinerama screen sizes.
- This will allow window managers and applications to actually use the panned area.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--randr/rrxinerama.c27
1 files changed, 20 insertions, 7 deletions
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);