From f8e52f1b6d7c59d007de99a1c9c69c053d4f3cbe Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Thu, 11 Dec 2008 16:48:40 +0100 Subject: [PATCH] randr: Update initial screen size if panning information is present --- hw/xfree86/modes/xf86RandR12.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 663d1a768..d668ab78e 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -561,10 +561,16 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) int crtc_width = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation); int crtc_height = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation); - if (crtc->enabled && crtc_width > width) - width = crtc_width; - if (crtc->enabled && crtc_height > height) - height = crtc_height; + if (crtc->enabled) { + if (crtc_width > width) + width = crtc_width; + if (crtc_height > height) + height = crtc_height; + if (crtc->panningTotalArea.x2 > width) + width = crtc->panningTotalArea.x2; + if (crtc->panningTotalArea.y2 > height) + height = crtc->panningTotalArea.y2; + } } if (width && height) @@ -615,6 +621,13 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting screen physical size to %d x %d\n", mmWidth, mmHeight); + /* + * This is the initial setting of the screen size. + * We have to pre-set it here, otherwise panning would be adapted + * to the new screen size. + */ + pScreen->width = width; + pScreen->height = height; xf86RandR12ScreenSetSize (pScreen, width, height,