summaryrefslogtreecommitdiff
authorAaron Plattner <aplattner@nvidia.com>2007-04-03 22:47:01 (GMT)
committer Aaron Plattner <aplattner@nvidia.com>2007-04-03 23:09:04 (GMT)
commitc10df5b967d4da4e11786520317e2917de5541fa (patch)
tree1218bb662ad342ed331656e1a5ea6c6de2127985
parente1dea151db6405e12d991feacba9446320739ee8 (diff)
downloadxserver-c10df5b967d4da4e11786520317e2917de5541fa.zip
xserver-c10df5b967d4da4e11786520317e2917de5541fa.tar.gz
xserver-c10df5b967d4da4e11786520317e2917de5541fa.tar.bz2
Swap RRScreenChangeNotifyEvent dimensions when the screen has one crtc and it's rotated.
RandR 1.1 clients expect the size fields in this event to be the unrotated dimensions of the screen. This behavior is "weird", but that's the way the old code worked so we need to be bug-compatible with it.
-rw-r--r--randr/rrscreen.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index ad74ac3..f83fce3 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -116,11 +116,19 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
se.sequenceNumber = client->sequence;
se.sizeID = RR10CurrentSizeID (pScreen);
-
- se.widthInPixels = pScreen->width;
- se.heightInPixels = pScreen->height;
- se.widthInMillimeters = pScreen->mmWidth;
- se.heightInMillimeters = pScreen->mmHeight;
+
+ if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) {
+ se.widthInPixels = pScreen->height;
+ se.heightInPixels = pScreen->width;
+ se.widthInMillimeters = pScreen->mmHeight;
+ se.heightInMillimeters = pScreen->mmWidth;
+ } else {
+ se.widthInPixels = pScreen->width;
+ se.heightInPixels = pScreen->height;
+ se.widthInMillimeters = pScreen->mmWidth;
+ se.heightInMillimeters = pScreen->mmHeight;
+ }
+
WriteEventsToClient (client, 1, (xEvent *) &se);
}