add option to set layout for all tags
@@ -167,7 +167,7 @@ void saveallfloating(Monitor *m) {
int i;
Client *c;
for (i = 1; i < 20; ++i) {
- if (m->pertag->ltidxs[i][selmon->pertag->sellts[i]]->arrange != NULL)
+ if (m->pertag->ltidxs[i][m->pertag->sellts[i]]->arrange != NULL)
continue;
for(c = m->clients; c; c = c->next) {
if (c->tags & (1 << (i - 1)) && c->snapstatus == 0)
@@ -180,10 +180,10 @@ void restoreallfloating(Monitor *m) {
int i;
Client *c;
for (i = 1; i < 20; ++i) {
- if (m->pertag->ltidxs[i][selmon->pertag->sellts[i]]->arrange != NULL)
+ if (m->pertag->ltidxs[i][m->pertag->sellts[i]]->arrange != NULL)
continue;
for(c = m->clients; c; c = c->next) {
- if (c->tags & (1 << (i - 1)))
+ if (c->tags & (1 << (i - 1)) && c->snapstatus == 0)
restorefloating(c);
}
}
@@ -3704,10 +3704,22 @@ setfullscreen(Client *c, int fullscreen)
void
setlayout(const Arg *arg)
{
+ if (tagprefix) {
+ int i;
+ for (i = 0; i < 20; ++i) {
+ if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
+ selmon->pertag->sellts[i] ^= 1;
+ if (arg && arg->v)
+ selmon->pertag->ltidxs[i][selmon->pertag->sellts[i]] = (Layout *)arg->v;
+ }
+ tagprefix = 0;
+ setlayout(arg);
+ } else {
if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
if (arg && arg->v)
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
+ }
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
if (selmon->sel)
arrange(selmon);
