Hi,

1-resizehints-comment.patch fixes a comment in config.def.h.

2-MFACT-redux.patch restores #define MFACT yet again ;), and allows
setmfact(0) for resetting the factor.

Regards,
Peter
diff -r 978d14197052 config.def.h
--- a/config.def.h      Thu Jul 03 17:05:33 2008 +0100
+++ b/config.def.h      Sun Jul 06 19:13:10 2008 +0200
@@ -28,7 +28,7 @@
 
 /* layout(s) */
 static float mfact      = 0.55;
-static Bool resizehints = True; /* False means respect size hints in tiled 
resizals */
+static Bool resizehints = True; /* False means don't respect size hints in 
tiled resizals */
 
 static Layout layouts[] = {
        /* symbol     arrange function */
diff -r b3c4d168221a config.def.h
--- a/config.def.h      Sun Jul 06 20:27:17 2008 +0200
+++ b/config.def.h      Sun Jul 06 20:29:18 2008 +0200
@@ -27,7 +27,7 @@
 };
 
 /* layout(s) */
-static float mfact      = 0.55;
+#define MFACT 0.55
 static Bool resizehints = True; /* False means don't respect size hints in 
tiled resizals */
 
 static Layout layouts[] = {
diff -r b3c4d168221a dwm.c
--- a/dwm.c     Sun Jul 06 20:27:17 2008 +0200
+++ b/dwm.c     Sun Jul 06 20:29:18 2008 +0200
@@ -208,6 +208,7 @@
 static char stext[256];
 static int screen, sx, sy, sw, sh;
 static int by, bh, blw, wx, wy, ww, wh;
+static float mfact;
 static uint seltags = 0, sellt = 0;
 static int (*xerrorxlib)(Display *, XErrorEvent *);
 static uint numlockmask = 0;
@@ -1304,12 +1305,16 @@
 setmfact(const Arg *arg) {
        float f;
 
-       if(!arg || !lt[sellt]->arrange)
+       if (!lt[sellt]->arrange)
                return;
-       f = arg->f < 1.0 ? arg->f + mfact : arg->f - 1.0;
-       if(f < 0.1 || f > 0.9)
-               return;
-       mfact = f;
+       if(arg->f) {
+               f = arg->f < 1.0 ? arg->f + mfact : arg->f - 1.0;
+               if(f < 0.1 || f > 0.9)
+                       return;
+               mfact = f;
+       }
+       else
+               mfact = MFACT;
        arrange();
 }
 
@@ -1330,6 +1335,7 @@
        bh = dc.h = dc.font.height + 2;
        lt[0] = &layouts[0];
        lt[1] = &layouts[1 % LENGTH(layouts)];
+       mfact = MFACT;
        updategeom();
 
        /* init atoms */

Reply via email to