[hackers] [dwm] applied Jukka Salmi's setmwfact patch

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Fri Aug 17 21:13:00 2007

changeset: 959:0aeefb841608
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Fri Aug 17 21:10:50 2007 +0200
summary: applied Jukka Salmi's setmwfact patch

diff -r 8b502be8b8e0 -r 0aeefb841608 config.arg.h
--- a/config.arg.h Thu Aug 16 18:41:22 2007 +0200
+++ b/config.arg.h Fri Aug 17 21:10:50 2007 +0200
@@ -48,8 +48,8 @@ Key keys[] = { \
         { MODKEY, XK_b, togglebar, NULL }, \
         { MODKEY, XK_j, focusnext, NULL }, \
         { MODKEY, XK_k, focusprev, NULL }, \
- { MODKEY, XK_h, addtomwfact, "-0.05" }, \
- { MODKEY, XK_l, addtomwfact, "0.05" }, \
+ { MODKEY, XK_h, setmwfact, "-0.05" }, \
+ { MODKEY, XK_l, setmwfact, "+0.05" }, \
         { MODKEY, XK_m, togglemax, NULL }, \
         { MODKEY, XK_Return, zoom, NULL }, \
         { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
diff -r 8b502be8b8e0 -r 0aeefb841608 config.default.h
--- a/config.default.h Thu Aug 16 18:41:22 2007 +0200
+++ b/config.default.h Fri Aug 17 21:10:50 2007 +0200
@@ -46,8 +46,8 @@ Key keys[] = { \
         { MODKEY, XK_b, togglebar, NULL }, \
         { MODKEY, XK_j, focusnext, NULL }, \
         { MODKEY, XK_k, focusprev, NULL }, \
- { MODKEY, XK_h, addtomwfact, "-0.05" }, \
- { MODKEY, XK_l, addtomwfact, "0.05" }, \
+ { MODKEY, XK_h, setmwfact, "-0.05" }, \
+ { MODKEY, XK_l, setmwfact, "+0.05" }, \
         { MODKEY, XK_m, togglemax, NULL }, \
         { MODKEY, XK_Return, zoom, NULL }, \
         { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
diff -r 8b502be8b8e0 -r 0aeefb841608 tile.c
--- a/tile.c Thu Aug 16 18:41:22 2007 +0200
+++ b/tile.c Fri Aug 17 21:10:50 2007 +0200
@@ -9,18 +9,24 @@ static double mwfact = MWFACT;
 /* extern */
 
 void
-addtomwfact(const char *arg) {
- double delta;
+setmwfact(const char *arg) {
+ double delta, newfact;
 
         if(!isarrange(tile))
                 return;
-
         /* arg handling, manipulate mwfact */
         if(arg == NULL)
                 mwfact = MWFACT;
         else if(1 == sscanf(arg, "%lf", &delta)) {
- if(delta + mwfact > 0.1 && delta + mwfact < 0.9)
- mwfact += delta;
+ if(arg[0] != '+' && arg[0] != '-')
+ newfact = delta;
+ else
+ newfact = mwfact + delta;
+ if(newfact < 0.1)
+ newfact = 0.1;
+ else if(newfact > 0.9)
+ newfact = 0.9;
+ mwfact = newfact;
         }
         arrange();
 }
diff -r 8b502be8b8e0 -r 0aeefb841608 tile.h
--- a/tile.h Thu Aug 16 18:41:22 2007 +0200
+++ b/tile.h Fri Aug 17 21:10:50 2007 +0200
@@ -1,6 +1,6 @@
 /* See LICENSE file for copyright and license details. */
 
 /* tile.c */
-void addtomwfact(const char *arg); /* adds arg value [0.1 .. 0.9] to master width factor */
+void setmwfact(const char *arg); /* sets master width factor */
 void tile(void); /* arranges all windows tiled */
 void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */
Received on Fri Aug 17 2007 - 21:13:00 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:56 UTC