Is cyclelayout keybind with no arguments not supposed to work? #358
-
|
Earlier it used to cycle through the layouts but after updating to the latest version the bind doesn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Looking at the original cyclelayouts patch we have that the argument passed to the { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
{ MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },but the function itself just checked for i > 0: cyclelayout(const Arg *arg) {
Layout *l;
for(l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++);
if(arg->i > 0) {
if(l->symbol && (l + 1)->symbol)
setlayout(&((Arg) { .v = (l + 1) }));
else
setlayout(&((Arg) { .v = layouts }));
} else {
if(l != layouts && (l - 1)->symbol)
setlayout(&((Arg) { .v = (l - 1) }));
else
setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] }));
}
}So passing no argument (defaults to 0) does not make much sense in this context, but has the effect that it would do a reverse cycle of layouts. The patch also added a @@ -41,6 +41,7 @@ static const Layout layouts[] = {
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { NULL, NULL },
};This Does that answer your question? |
Beta Was this translation helpful? Give feedback.
Looking at the original cyclelayouts patch we have that the argument passed to the
cyclelayoutfunction is supposed to indicate direction.{ MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } }, { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },but the function itself just checked for i > 0: