applied Jukka Salmi's setmwfact patch
This commit is contained in:
parent
04dec4c943
commit
a923298d35
|
@ -48,8 +48,8 @@ Key keys[] = { \
|
||||||
{ MODKEY, XK_b, togglebar, NULL }, \
|
{ MODKEY, XK_b, togglebar, NULL }, \
|
||||||
{ MODKEY, XK_j, focusnext, NULL }, \
|
{ MODKEY, XK_j, focusnext, NULL }, \
|
||||||
{ MODKEY, XK_k, focusprev, NULL }, \
|
{ MODKEY, XK_k, focusprev, NULL }, \
|
||||||
{ MODKEY, XK_h, addtomwfact, "-0.05" }, \
|
{ MODKEY, XK_h, setmwfact, "-0.05" }, \
|
||||||
{ MODKEY, XK_l, addtomwfact, "0.05" }, \
|
{ MODKEY, XK_l, setmwfact, "+0.05" }, \
|
||||||
{ MODKEY, XK_m, togglemax, NULL }, \
|
{ MODKEY, XK_m, togglemax, NULL }, \
|
||||||
{ MODKEY, XK_Return, zoom, NULL }, \
|
{ MODKEY, XK_Return, zoom, NULL }, \
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
|
||||||
|
|
|
@ -46,8 +46,8 @@ Key keys[] = { \
|
||||||
{ MODKEY, XK_b, togglebar, NULL }, \
|
{ MODKEY, XK_b, togglebar, NULL }, \
|
||||||
{ MODKEY, XK_j, focusnext, NULL }, \
|
{ MODKEY, XK_j, focusnext, NULL }, \
|
||||||
{ MODKEY, XK_k, focusprev, NULL }, \
|
{ MODKEY, XK_k, focusprev, NULL }, \
|
||||||
{ MODKEY, XK_h, addtomwfact, "-0.05" }, \
|
{ MODKEY, XK_h, setmwfact, "-0.05" }, \
|
||||||
{ MODKEY, XK_l, addtomwfact, "0.05" }, \
|
{ MODKEY, XK_l, setmwfact, "+0.05" }, \
|
||||||
{ MODKEY, XK_m, togglemax, NULL }, \
|
{ MODKEY, XK_m, togglemax, NULL }, \
|
||||||
{ MODKEY, XK_Return, zoom, NULL }, \
|
{ MODKEY, XK_Return, zoom, NULL }, \
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
|
||||||
|
|
16
tile.c
16
tile.c
|
@ -9,18 +9,24 @@ static double mwfact = MWFACT;
|
||||||
/* extern */
|
/* extern */
|
||||||
|
|
||||||
void
|
void
|
||||||
addtomwfact(const char *arg) {
|
setmwfact(const char *arg) {
|
||||||
double delta;
|
double delta, newfact;
|
||||||
|
|
||||||
if(!isarrange(tile))
|
if(!isarrange(tile))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* arg handling, manipulate mwfact */
|
/* arg handling, manipulate mwfact */
|
||||||
if(arg == NULL)
|
if(arg == NULL)
|
||||||
mwfact = MWFACT;
|
mwfact = MWFACT;
|
||||||
else if(1 == sscanf(arg, "%lf", &delta)) {
|
else if(1 == sscanf(arg, "%lf", &delta)) {
|
||||||
if(delta + mwfact > 0.1 && delta + mwfact < 0.9)
|
if(arg[0] != '+' && arg[0] != '-')
|
||||||
mwfact += delta;
|
newfact = delta;
|
||||||
|
else
|
||||||
|
newfact = mwfact + delta;
|
||||||
|
if(newfact < 0.1)
|
||||||
|
newfact = 0.1;
|
||||||
|
else if(newfact > 0.9)
|
||||||
|
newfact = 0.9;
|
||||||
|
mwfact = newfact;
|
||||||
}
|
}
|
||||||
arrange();
|
arrange();
|
||||||
}
|
}
|
||||||
|
|
2
tile.h
2
tile.h
|
@ -1,6 +1,6 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
/* tile.c */
|
/* 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 tile(void); /* arranges all windows tiled */
|
||||||
void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */
|
void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */
|
||||||
|
|
Loading…
Reference in a new issue