It's not clear to me that there's any notification to this list
when somebody sends a patch to Tuomo using darcs send.  (It's
also possible I should have somehow cc'd the list using darcs,
but my knowledge of darcs is limited to what I learned to do
"darcs send")

Consequently I'll post my patch here, too, for review and to see
if anybody else is interested in this feature...

This patch makes the padding between floating frames
configurable.  Right now ion3 assumes 1 pixel of padding.
I wanted it to be zero, but this patch simply moves the choice to
the user.  I can imagine that some people might like a wider gap.

diff -ur ion3-20080411/ioncore/conf.c ion3-20080411.agriffis/ioncore/conf.c
--- ion3-20080411/ioncore/conf.c        2008-04-18 11:22:02.000000000 -0400
+++ ion3-20080411.agriffis/ioncore/conf.c       2008-04-18 09:44:17.000000000 
-0400
@@ -76,6 +76,9 @@
  *                          One of \codestr{udlr} (up-down, then left-right), 
  *                          \codestr{lrud} (left-right, then up-down), or 
  *                          \codestr{random}. \\
+ *  \var{float_placement_padding} & (integer) Pixels between frames when 
+ *                          \var{float_placement_method} is \codestr{udlr} or
+ *                          \codestr{lrud}. \\
  *  \var{mousefocus} & (string) Mouse focus mode: 
  *                     \codestr{disabled} or \codestr{sloppy}. \\
  *  \var{unsqueeze} & (boolean) Auto-unsqueeze transients/menus/queries/etc. \\
diff -ur ion3-20080411/ioncore/float-placement.c 
ion3-20080411.agriffis/ioncore/float-placement.c
--- ion3-20080411/ioncore/float-placement.c     2008-04-11 11:03:31.000000000 
-0400
+++ ion3-20080411.agriffis/ioncore/float-placement.c    2008-04-17 
18:25:06.000000000 -0400
@@ -14,6 +14,7 @@
 
 
 WFloatPlacement ioncore_placement_method=PLACEMENT_LRUD;
+int ioncore_placement_padding=1;
 
 
 static void random_placement(WRectangle box, WRectangle *g)
@@ -131,7 +132,7 @@
             p=is_occupied(ws, level, &r);
             while(p!=NULL && r.y+r.h<maxy){
                 ggeom(p, &r2);
-                r.y=r2.y+r2.h+1;
+                r.y=r2.y+r2.h+ioncore_placement_padding;
                 p=is_occupied(ws, level, &r);
             }
             if(r.y+r.h<maxy && r.x+r.w<maxx){
@@ -148,7 +149,7 @@
             p=is_occupied(ws, level, &r);
             while(p!=NULL && r.x+r.w<maxx){
                 ggeom(p, &r2);
-                r.x=r2.x+r2.w+1;
+                r.x=r2.x+r2.w+ioncore_placement_padding;
                 p=is_occupied(ws, level, &r);
             }
             if(r.y+r.h<maxy && r.x+r.w<maxx){
diff -ur ion3-20080411/ioncore/float-placement.h 
ion3-20080411.agriffis/ioncore/float-placement.h
--- ion3-20080411/ioncore/float-placement.h     2008-04-11 11:03:30.000000000 
-0400
+++ ion3-20080411.agriffis/ioncore/float-placement.h    2008-04-17 
18:25:23.000000000 -0400
@@ -18,6 +18,7 @@
 } WFloatPlacement;
 
 extern WFloatPlacement ioncore_placement_method;
+extern int ioncore_placement_padding;
 
 extern void group_calc_placement(WGroup *ws, uint level, 
                                  WRectangle *geom);
diff -ur ion3-20080411/ioncore/group-ws.c 
ion3-20080411.agriffis/ioncore/group-ws.c
--- ion3-20080411/ioncore/group-ws.c    2008-04-11 11:03:31.000000000 -0400
+++ ion3-20080411.agriffis/ioncore/group-ws.c   2008-04-18 11:39:10.000000000 
-0400
@@ -34,7 +34,7 @@
 void ioncore_groupws_set(ExtlTab tab)
 {
     char *method=NULL;
-    ExtlTab t;
+    int fpp;
     
     if(extl_table_gets_s(tab, "float_placement_method", &method)){
         if(strcmp(method, "udlr")==0)
@@ -47,6 +47,8 @@
             warn(TR("Unknown placement method \"%s\"."), method);
         free(method);
     }
+    if(extl_table_gets_i(tab, "float_placement_padding", &fpp))
+        ioncore_placement_padding=maxof(0, fpp);
 }
 
 

Reply via email to