[hackers] [wmii] Allow changing screen boundaries with Mod+Mouse3. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Thu, 15 Sep 2011 19:22:25 +0200 (CEST)

changeset: 2793:185f257df4ce
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Thu Sep 15 13:22:17 2011 -0400
files: cmd/wmii/column.c cmd/wmii/frame.c cmd/wmii/mouse.c
description:
Allow changing screen boundaries with Mod+Mouse3.

diff -r d6ba303d560b -r 185f257df4ce cmd/wmii/column.c
--- a/cmd/wmii/column.c Thu Sep 15 12:38:16 2011 -0400
+++ b/cmd/wmii/column.c Thu Sep 15 13:22:17 2011 -0400
@@ -577,10 +577,14 @@
         if(al) {
                 al->r.max.x = a->r.min.x;
                 column_arrange(al, false);
+ }else {
+ v->pad[a->screen].min.x = r.min.x - v->r[a->screen].min.x;
         }
         if(ar) {
                 ar->r.min.x = a->r.max.x;
                 column_arrange(ar, false);
+ }else {
+ v->pad[a->screen].max.x = r.max.x - v->r[a->screen].max.x;
         }
 
         column_resizeframe_h(f, r);
diff -r d6ba303d560b -r 185f257df4ce cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Thu Sep 15 12:38:16 2011 -0400
+++ b/cmd/wmii/frame.c Thu Sep 15 13:22:17 2011 -0400
@@ -643,13 +643,16 @@
         for(sp=screens; (s = *sp); sp++) {
                 if(!screen->showing)
                         continue;
+
                 isect = rect_intersection(r, insetrect(s->r, inset));
                 if(Dx(isect) >= 0 && Dy(isect) >= 0)
                         return r;
+
                 if(Dx(isect) <= 0 && Dy(isect) <= 0)
                         n = max(Dx(isect), Dy(isect));
                 else
                         n = min(Dx(isect), Dy(isect));
+
                 if(!sbest || n > best) {
                         sbest = s;
                         best = n;
diff -r d6ba303d560b -r 185f257df4ce cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Thu Sep 15 12:38:16 2011 -0400
+++ b/cmd/wmii/mouse.c Thu Sep 15 13:22:17 2011 -0400
@@ -251,22 +251,26 @@
         min.x = column_minwidth();
         min.y = /*frame_delta_h() +*/ labelh(def.font);
         /* Set the limits of where this box may be dragged. */
-#define frob(pred, f, aprev, rmin, rmax, plus, minus, xy) BLOCK( \
+#define frob(pred, f, aprev, rmin, rmax, plus, minus, xy, use_screen) BLOCK( \
                 if(pred) { \
                         r.rmin.xy = f->aprev->r.rmin.xy plus min.xy; \
                         r.rmax.xy = f->r.rmax.xy minus min.xy; \
+ }else if(use_screen) { \
+ r.rmin.xy = v->r[f->screen].rmin.xy plus 1; \
+ r.rmax.xy = a->r.rmax.xy minus min.xy; \
                 }else { \
                         r.rmin.xy = a->r.rmin.xy; \
                         r.rmax.xy = r.rmin.xy plus 1; \
                 })
- if(align&North)
- frob(f->aprev, f, aprev, min, max, +, -, y);
+
+ if(align & North)
+ frob(f->aprev, f, aprev, min, max, +, -, y, false);
         else
- frob(f->anext, f, anext, max, min, -, +, y);
- if(align&West)
- frob(a->prev, a, prev, min, max, +, -, x);
+ frob(f->anext, f, anext, max, min, -, +, y, false);
+ if(align & West)
+ frob(a->prev, a, prev, min, max, +, -, x, true);
         else
- frob(a->next, a, next, max, min, -, +, x);
+ frob(a->next, a, next, max, min, -, +, x, true);
 #undef frob
 
         cwin = constraintwin(r);
@@ -415,6 +419,7 @@
 
         SET(hrx);
         SET(hry);
+
         if(align != Center) {
                 hr = subpt(frect.max, frect.min);
                 hr = divpt(hr, Pt(2, 2));
Received on Thu Sep 15 2011 - 19:22:25 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 15 2011 - 19:24:05 CEST