diff options
-rw-r--r-- | randr/randrstr.h | 3 | ||||
-rw-r--r-- | randr/rrcrtc.c | 26 | ||||
-rw-r--r-- | randr/rrpointer.c | 26 | ||||
-rw-r--r-- | randr/rrxinerama.c | 6 |
4 files changed, 33 insertions, 28 deletions
diff --git a/randr/randrstr.h b/randr/randrstr.h index 99022c313..505821269 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -549,6 +549,9 @@ Bool RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations); +void +RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height); + /* * Destroy a Crtc at shutdown */ diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index cfd4da9f7..098fbe300 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -397,6 +397,32 @@ RRCrtcGammaNotify (RRCrtcPtr crtc) return TRUE; /* not much going on here */ } +/** + * Returns the width/height that the crtc scans out from the framebuffer + */ +void +RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height) +{ + if (crtc->mode == NULL) { + *width = 0; + *height = 0; + return; + } + + switch (crtc->rotation & 0xf) { + case RR_Rotate_0: + case RR_Rotate_180: + *width = crtc->mode->mode.width; + *height = crtc->mode->mode.height; + break; + case RR_Rotate_90: + case RR_Rotate_270: + *width = crtc->mode->mode.height; + *height = crtc->mode->mode.width; + break; + } +} + /* * Set the size of the gamma table at server startup time */ diff --git a/randr/rrpointer.c b/randr/rrpointer.c index 2a5ae7d2f..802dcb2c4 100644 --- a/randr/rrpointer.c +++ b/randr/rrpointer.c @@ -22,32 +22,6 @@ #include "randrstr.h" -/** - * Returns the width/height that the crtc scans out from the framebuffer - */ -static void -RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height) -{ - if (crtc->mode == NULL) { - *width = 0; - *height = 0; - return; - } - - switch (crtc->rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_180: - *width = crtc->mode->mode.width; - *height = crtc->mode->mode.height; - break; - case RR_Rotate_90: - case RR_Rotate_270: - *width = crtc->mode->mode.height; - *height = crtc->mode->mode.width; - break; - } -} - /* * When the pointer moves, check to see if the specified position is outside * any of theavailable CRTCs and move it to a 'sensible' place if so, where diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 8b951455c..1db27f14c 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -290,10 +290,12 @@ ProcRRXineramaQueryScreens(ClientPtr client) 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 = crtc->mode->mode.width; - scratch.height = crtc->mode->mode.height; + scratch.width = width; + scratch.height = height; if(client->swapped) { register int n; swaps(&scratch.x_org, n); |