[hackers] [wmii] Fixed column resizals when dragging the left edge of a client.

From: sqweek <sqweek_AT_gmail.com>
Date: Sat Sep 29 10:53:11 2007

changeset: 2204:f57dae77b7a9
user: sqweek <sqweek_AT_gmail.com>
date: Sat Sep 22 21:14:59 2007 +0800
summary: Fixed column resizals when dragging the left edge of a client.

diff -r 91e345aedc9b -r f57dae77b7a9 cmd/wmii/column.c
--- a/cmd/wmii/column.c Sat Sep 22 21:13:26 2007 +0800
+++ b/cmd/wmii/column.c Sat Sep 22 21:14:59 2007 +0800
@@ -425,15 +425,17 @@ resize_colframe(Frame *f, Rectangle *r)
         Area *a, *al, *ar;
         View *v;
         uint minw;
- int dx, dw, maxx;
+ int dx, dw;
 
         a = f->area;
         v = a->view;
- maxx = r->max.x;
 
         minw = Dx(screen->r) / NCOL;
 
- al = a->prev;
+ if(a->prev && !a->prev->floating)
+ al = a->prev;
+ else
+ al = nil;
         ar = a->next;
 
         if(al)
@@ -441,28 +443,26 @@ resize_colframe(Frame *f, Rectangle *r)
         else
                 r->min.x = max(r->min.x, 0);
 
- if(ar) {
- if(maxx >= ar->r.max.x - minw)
- maxx = ar->r.max.x - minw;
- }
- else
- if(maxx > screen->r.max.x)
- maxx = screen->r.max.x;
+ if(ar)
+ r->max.x = min(r->max.x, ar->r.max.x - minw);
+ else
+ r->max.x = min(r->max.x, screen->r.max.x);
 
         dx = a->r.min.x - r->min.x;
- dw = maxx - a->r.max.x;
+ dw = r->max.x - a->r.max.x;
         if(al) {
                 al->r.max.x -= dx;
                 arrange_column(al, False);
         }
         if(ar) {
- ar->r.max.x -= dw;
+ ar->r.min.x += dw;
                 arrange_column(ar, False);
         }
 
         resize_colframeh(f, r);
 
- a->r.max.x = maxx;
+ a->r.min.x = r->min.x;
+ a->r.max.x = r->max.x;
         arrange_view(a->view);
 
         focus_view(screen, v);
Received on Sat Sep 29 2007 - 10:53:11 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:20 UTC