[hackers] [wmii] Destroy empty areas on non-primary Xinerama screens when emptying them via the mouse. Fixes issue #84. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Fri, 2 Oct 2009 06:52:06 +0000 (UTC)

changeset: 2510:05dcc069deb5
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Oct 02 02:30:28 2009 -0400
files: cmd/wmii/layout.c cmd/wmii/xext.c
description:
Destroy empty areas on non-primary Xinerama screens when emptying them via the mouse. Fixes issue #84.

diff -r 4f25c2d56107 -r 05dcc069deb5 cmd/wmii/layout.c
--- a/cmd/wmii/layout.c Fri Oct 02 02:14:24 2009 -0400
+++ b/cmd/wmii/layout.c Fri Oct 02 02:30:28 2009 -0400
@@ -455,8 +455,7 @@
                         }
 
 
- /* 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 -r 4f25c2d56107 -r 05dcc069deb5 cmd/wmii/xext.c
--- a/cmd/wmii/xext.c Fri Oct 02 02:14:24 2009 -0400
+++ b/cmd/wmii/xext.c Fri Oct 02 02:30:28 2009 -0400
@@ -47,15 +47,27 @@
 }
 
 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 @@
 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();
 }
 
Received on Fri Oct 02 2009 - 06:52:06 UTC

This archive was generated by hypermail 2.2.0 : Fri Oct 02 2009 - 07:00:12 UTC