[hackers] [wmii] Fix some fullscreen-restoration bugs || Kris Maglione

From: <hg_AT_suckless.org>
Date: Sun, 19 Oct 2008 16:32:48 +0000 (UTC)

changeset: 2395:e7626a2b5aa0
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sun Oct 19 12:32:46 2008 -0400
files: cmd/wmii/area.c cmd/wmii/column.c
description:
Fix some fullscreen-restoration bugs

diff -r 8e98a3ac33b1 -r e7626a2b5aa0 cmd/wmii/area.c
--- a/cmd/wmii/area.c Sat Oct 18 22:29:21 2008 -0400
+++ b/cmd/wmii/area.c Sun Oct 19 12:32:46 2008 -0400
@@ -176,7 +176,6 @@
 void
 area_moveto(Area *to, Frame *f) {
         Area *from;
- bool fromfloating;
 
         assert(to->view == f->view);
 
@@ -184,13 +183,12 @@
                 return;
 
         from = f->area;
- fromfloating = from->floating;
 
         area_detach(f);
 
         /* Temporary kludge. */
         if(!to->floating
- && to->floating != fromfloating
+ && to->floating != from->floating
         && !eqrect(f->colr, ZR))
                 column_attachrect(to, f, f->colr);
         else
diff -r 8e98a3ac33b1 -r e7626a2b5aa0 cmd/wmii/column.c
--- a/cmd/wmii/column.c Sat Oct 18 22:29:21 2008 -0400
+++ b/cmd/wmii/column.c Sun Oct 19 12:32:46 2008 -0400
@@ -200,6 +200,8 @@
 
         a = f->area;
         stack_info(f, &first, &dy, nil);
+ if(first && first == f)
+ first = f->anext;
         column_remove(f);
         if(a->frame) {
                 if(first)
@@ -220,8 +222,6 @@
         for(fp=a->frame; fp; pos=fp, fp=fp->anext) {
                 if(r.max.y < fp->r.min.y)
                         continue;
- if(r.min.x > fp->r.max.y)
- continue;
                 before = fp->r.min.y - r.min.y;
                 after = r.max.y - fp->r.max.y;
                 if(abs(before) <= abs(after))
@@ -234,11 +234,7 @@
                 a->r.max.y += Dy(r);
         }
         column_insert(a, f, pos);
- for(fp=f->anext; fp; fp=fp->anext) {
- fp->r.min.y += Dy(r);
- fp->r.max.y += Dy(r);
- }
- column_resizeframe(f, r);
+ column_scale(a);
 }
 
 void
@@ -306,10 +302,7 @@
         if(nuncol == 0) {
                 nuncol++;
                 ncol--;
- if(a->sel)
- a->sel->collapsed = false;
- else
- a->frame->collapsed = false;
+ (a->sel ? a->sel : a->frame)->collapsed = false;
         }
 
         /* FIXME: Kludge. */
@@ -421,29 +414,24 @@
                        h.aspect.max.y / h.aspect.max.x;
         maxh = max(maxh, h.max.y);
 
- if(Dy(f->r) > maxh)
+ if(Dy(f->r) >= maxh)
                 return 0;
         return h.inc.y - (Dy(f->r) - h.base.y) % h.inc.y;
 }
 
 static int
 comp_frame(const void *a, const void *b) {
- Frame *fa, *fb;
         int ia, ib;
 
- fa = *(Frame**)a;
- fb = *(Frame**)b;
- ia = foo(fa);
- ib = foo(fb);
- return ia < ib ? -1 :
- ia > ib ? 1 :
- /* Favor the selected client. */
- /* No... don't. Windows shouldn't jump when the mouse
- * enters them.
- fa == fa->area->sel ? -1 :
- fb == fa->area->sel ? 1 :
- */
- 0;
+ ia = foo(*(Frame**)a);
+ ib = foo(*(Frame**)b);
+ /*
+ * I'd like to favor the selected client, but
+ * it causes windows to jump as focus changes.
+ */
+ return ia < ib ? -1 :
+ ia > ib ? 1 :
+ 0;
 }
 
 static void
@@ -515,7 +503,7 @@
                         dy += Dy(f->colr);
         }
         for(f=a->frame; f; f=f->anext) {
- f->dy = Dy(f->r);
+ f->dy = Dy(f->colr);
                 f->colr.min.x = a->r.min.x;
                 f->colr.max.x = a->r.max.x;
                 if(!f->collapsed)
@@ -633,10 +621,8 @@
 
         minw = Dx(v->r[a->screen]) / NCOL;
 
+ al = a->prev;
         ar = a->next;
- al = a->prev;
- if(al == v->floating)
- al = nil;
 
         if(al)
                 r.min.x = max(r.min.x, al->r.min.x + minw);
Received on Sun Oct 19 2008 - 16:32:48 UTC

This archive was generated by hypermail 2.2.0 : Sun Oct 19 2008 - 16:36:04 UTC