diff options
author | Matthias Hopf <mhopf@suse.de> | 2008-12-11 16:48:40 +0100 |
---|---|---|
committer | Matthias Hopf <mhopf@suse.de> | 2008-12-12 11:01:53 +0100 |
commit | ab56607a0855e88de2ad2d7eb43e1d806db0c47b (patch) | |
tree | dcf6c66abc9fd55bf11d25aac954c3e5a19cefae | |
parent | 657d963a663a189d3c8068a39528b2d73af5fe70 (diff) |
randr: Update initial screen size if panning information is present
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 362229c2f..08799c22b 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, |