randr: Consider panned crtc's when calculating xinerama screen sizes.
- This will allow window managers and applications to actually use the panned area.
This commit is contained in:
parent
f2d1de6c2a
commit
332d65ec7a
|
@ -267,12 +267,26 @@ RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
|
||||||
|
|
||||||
if (RRXineramaCrtcActive (crtc))
|
if (RRXineramaCrtcActive (crtc))
|
||||||
{
|
{
|
||||||
int width, height;
|
ScreenPtr pScreen = crtc->pScreen;
|
||||||
RRCrtcGetScanoutSize (crtc, &width, &height);
|
rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
|
||||||
scratch.x_org = crtc->x;
|
BoxRec panned_area;
|
||||||
scratch.y_org = crtc->y;
|
|
||||||
scratch.width = width;
|
/* Check to see if crtc is panned and return the full area when applicable. */
|
||||||
scratch.height = height;
|
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) {
|
if(client->swapped) {
|
||||||
register int n;
|
register int n;
|
||||||
swaps(&scratch.x_org, n);
|
swaps(&scratch.x_org, n);
|
||||||
|
@ -313,7 +327,6 @@ ProcRRXineramaQueryScreens(ClientPtr client)
|
||||||
|
|
||||||
if(rep.number) {
|
if(rep.number) {
|
||||||
rrScrPriv(pScreen);
|
rrScrPriv(pScreen);
|
||||||
xXineramaScreenInfo scratch;
|
|
||||||
int i;
|
int i;
|
||||||
int has_primary = (pScrPriv->primaryOutput != NULL);
|
int has_primary = (pScrPriv->primaryOutput != NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue