diff options
author | Keith Packard <keithp@neko.keithp.com> | 2007-04-09 14:29:46 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-04-10 12:36:50 -0700 |
commit | f77a8ea849d171a8ca00b2b7334866ace1ffbf73 (patch) | |
tree | acdb45610bd4860b69fec0272f85e8bea3008c28 /randr | |
parent | bcf17df69a232e5e84609abacdca36274316e170 (diff) |
Rotate screen size as needed from RandR 1.1 change requests.
Screen size must reflect rotated mode size when setting rotated mode using
RandR 1.1 SetScreenConfig request.
(cherry picked from commit efcec7dbd3c2736c7b421d29c4d37e231aa681d2)
Diffstat (limited to 'randr')
-rw-r--r-- | randr/rrscreen.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c index f83fce320..d92a0ffee 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -741,6 +741,7 @@ ProcRRSetScreenConfig (ClientPtr client) RRModePtr mode; RR10DataPtr pData = NULL; RRScreenSizePtr pSize; + int width, height; UpdateCurrentTime (); @@ -883,8 +884,14 @@ ProcRRSetScreenConfig (ClientPtr client) * If the screen size is changing, adjust all of the other outputs * to fit the new size, mirroring as much as possible */ - if (mode->mode.width != pScreen->width || - mode->mode.height != pScreen->height) + width = mode->mode.width; + height = mode->mode.height; + if (rotation & (RR_Rotate_90|RR_Rotate_270)) + { + width = mode->mode.height; + height = mode->mode.width; + } + if (width != pScreen->width || height != pScreen->height) { int c; @@ -898,7 +905,7 @@ ProcRRSetScreenConfig (ClientPtr client) goto sendReply; } } - if (!RRScreenSizeSet (pScreen, mode->mode.width, mode->mode.height, + if (!RRScreenSizeSet (pScreen, width, height, pScreen->mmWidth, pScreen->mmHeight)) { rep.status = RRSetConfigFailed; |