From a42516d3a5aa532ed7c19fa128afd63d159676f8 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Fri, 30 Sep 2005 04:25:14 +0000 Subject: Bug #2965 Patch #2994 Swap the screen dimensions when handling XRRScreenChangeNotify events for 90- and 270-degree rotations. This fixes KDE's panel placement for rotated screens. --- src/Xrandr.c | 15 +++++++++++---- 1 file 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: -- cgit v1.2.3