summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2005-09-30 04:25:14 +0000
committerAaron Plattner <aplattner@nvidia.com>2005-09-30 04:25:14 +0000
commita42516d3a5aa532ed7c19fa128afd63d159676f8 (patch)
treec22e1988bb9214893611c507afefb97cc37a53bc
parentf9c9043f2a6787cdb6ab130f66fd39b29e7f2506 (diff)
Bug #2965 <https://bugs.freedesktop.org/show_bug.cgi?id=2965> Patch #2994
<https://bugs.freedesktop.org/attachment.cgi?id=2994> Swap the screen dimensions when handling XRRScreenChangeNotify events for 90- and 270-degree rotations. This fixes KDE's panel placement for rotated screens.
-rw-r--r--src/Xrandr.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Xrandr.c b/src/Xrandr.c
index 2776462..32537b4 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -714,10 +714,17 @@ int XRRUpdateConfiguration(XEvent *event)
scevent = (XRRScreenChangeNotifyEvent *) event;
snum = XRRRootToScreen(dpy,
((XRRScreenChangeNotifyEvent *) event)->root);
- dpy->screens[snum].width = scevent->width;
- dpy->screens[snum].height = scevent->height;
- dpy->screens[snum].mwidth = scevent->mwidth;
- dpy->screens[snum].mheight = scevent->mheight;
+ if (scevent->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
+ dpy->screens[snum].width = scevent->height;
+ dpy->screens[snum].height = scevent->width;
+ dpy->screens[snum].mwidth = scevent->mheight;
+ dpy->screens[snum].mheight = scevent->mwidth;
+ } else {
+ dpy->screens[snum].width = scevent->width;
+ dpy->screens[snum].height = scevent->height;
+ dpy->screens[snum].mwidth = scevent->mwidth;
+ dpy->screens[snum].mheight = scevent->mheight;
+ }
XRenderSetSubpixelOrder (dpy, snum, scevent->subpixel_order);
break;
default: