commit 7b6172551003a61b1382502606ffd11b845442a8
parent e66f742e75957e2015d6ff008e1d59e4382af078
Author: Kris Maglione <jg@suckless.org>
Date: Fri, 2 Oct 2009 02:30:28 -0400
Destroy empty areas on non-primary Xinerama screens when emptying them via the mouse. Fixes issue #84.
Diffstat:
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/cmd/wmii/layout.c b/cmd/wmii/layout.c
@@ -455,8 +455,7 @@ thcol(Frame *f) {
}
- /* XXX: Multihead. */
- if(!a->frame && !a->floating && f->view->firstarea->next)
+ if(!a->frame && !a->floating && a->view->areas[a->screen]->next)
area_destroy(a);
frame_focus(f);
diff --git a/cmd/wmii/xext.c b/cmd/wmii/xext.c
@@ -47,15 +47,27 @@ xext_event(XEvent *e) {
}
static void
+randr_applyrotation(int rotation, int width, int height) {
+ if(rotation+90 % 180)
+ scr.rect = Rect(0, 0, width, height);
+ else
+ scr.rect = Rect(0, 0, height, width);
+}
+
+static void
randr_init(void) {
int errorbase, major, minor;
+ Rotation rotation;
have_RandR = XRRQueryExtension(display, &randr_eventbase, &errorbase);
if(have_RandR)
if(XRRQueryVersion(display, &major, &minor) && major < 1)
have_RandR = false;
- if(have_RandR)
+ if(have_RandR) {
XRRSelectInput(display, scr.root.xid, RRScreenChangeNotifyMask);
+ XRRRotations(display, scr.screen, &rotation);
+ randr_applyrotation(rotation, Dx(scr.rect), Dy(scr.rect));
+ }
}
static bool
@@ -68,10 +80,7 @@ static void
randr_screenchange(XRRScreenChangeNotifyEvent *ev) {
XRRUpdateConfiguration((XEvent*)ev);
- if(ev->rotation+90 % 180)
- scr.rect = Rect(0, 0, ev->width, ev->height);
- else
- scr.rect = Rect(0, 0, ev->height, ev->width);
+ randr_applyrotation(ev->rotation, ev->width, ev->height);
init_screens();
}