[hackers] [wmii] More of the previous. Add stack support. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Mon, 20 Oct 2008 01:18:36 +0000 (UTC)

changeset: 2398:33ae11099c04
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sun Oct 19 21:18:35 2008 -0400
files: cmd/wmii/column.c cmd/wmii/fns.h cmd/wmii/message.c
description:
More of the previous. Add stack support.

diff -r f996653c3859 -r 33ae11099c04 cmd/wmii/column.c
--- a/cmd/wmii/column.c Sun Oct 19 20:50:13 2008 -0400
+++ b/cmd/wmii/column.c Sun Oct 19 21:18:35 2008 -0400
@@ -181,7 +181,7 @@
 }
 
 Frame*
-stack_find(Area *a, Frame *f, int dir) {
+stack_find(Area *a, Frame *f, int dir, bool stack) {
         Frame *fp;
 
         switch (dir) {
@@ -189,21 +189,21 @@
                 die("not reached");
         case North:
                 if(f)
- for(f=f->aprev; f && f->collapsed; f=f->aprev)
+ for(f=f->aprev; f && f->collapsed && stack; f=f->aprev)
                                 ;
                 else {
                         f = nil;
                         for(fp=a->frame; fp; fp=fp->anext)
- if(!fp->collapsed)
+ if(!fp->collapsed || !stack)
                                         f = fp;
                 }
                 break;
         case South:
                 if(f)
- for(f=f->anext; f && f->collapsed; f=f->anext)
+ for(f=f->anext; f && f->collapsed && stack; f=f->anext)
                                 ;
                 else
- for(f=a->frame; f && f->collapsed; f=f->anext)
+ for(f=a->frame; f && f->collapsed && stack; f=f->anext)
                                 ;
                 break;
         }
@@ -212,7 +212,7 @@
 
 /* TODO: Move elsewhere. */
 bool
-find(Area **ap, Frame **fp, int dir, bool wrap) {
+find(Area **ap, Frame **fp, int dir, bool wrap, bool stack) {
         Rectangle r;
         Frame *f;
         Area *a;
@@ -222,13 +222,13 @@
         r = f ? f->r : a->r;
 
         if(dir == North || dir == South) {
- *fp = stack_find(a, f, dir);
+ *fp = stack_find(a, f, dir, stack);
                 if(*fp)
                         return true;
                 *ap = area_find(a->view, r, dir, wrap);
                 if(!*ap)
                         return false;
- *fp = stack_find(*ap, *fp, dir);
+ *fp = stack_find(*ap, *fp, dir, stack);
                 return *fp;
         }
         if(dir != East && dir != West)
diff -r f996653c3859 -r 33ae11099c04 cmd/wmii/fns.h
--- a/cmd/wmii/fns.h Sun Oct 19 20:50:13 2008 -0400
+++ b/cmd/wmii/fns.h Sun Oct 19 21:18:35 2008 -0400
@@ -109,9 +109,9 @@
 void div_draw(Divide*);
 void div_set(Divide*, int x);
 void div_update_all(void);
-bool find(Area**, Frame**, int, bool);
+bool find(Area**, Frame**, int, bool, bool);
 int stack_count(Frame*, int*);
-Frame* stack_find(Area*, Frame*, int);
+Frame* stack_find(Area*, Frame*, int, bool);
 
 /* event.c */
 void check_x_event(IxpConn*);
diff -r f996653c3859 -r 33ae11099c04 cmd/wmii/message.c
--- a/cmd/wmii/message.c Sun Oct 19 20:50:13 2008 -0400
+++ b/cmd/wmii/message.c Sun Oct 19 21:18:35 2008 -0400
@@ -917,7 +917,7 @@
                         return Ebadvalue;
         }
         else {
- if(!find(&a, &f, DIR(sym), true))
+ if(!find(&a, &f, DIR(sym), true, stack))
                         return Ebadvalue;
         }
 
Received on Mon Oct 20 2008 - 01:18:36 UTC

This archive was generated by hypermail 2.2.0 : Mon Oct 20 2008 - 01:24:05 UTC