diff --git a/src/mango.c b/src/mango.c index f388dd0..9bca953 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5021,7 +5021,7 @@ void toggleoverview(const Arg *arg) { visible_client_number++; } if (visible_client_number > 0) { - target = ~0; + target = ~0 & TAGMASK; } else { selmon->isoverview ^= 1; return; @@ -5356,23 +5356,32 @@ void view_in_mon(const Arg *arg, bool want_animation, Monitor *m, bool changefocus) { unsigned int i, tmptag; - if (!m || (arg->ui != ~0 && m->isoverview)) { + if (!m || (arg->ui != (~0 & TAGMASK) && m->isoverview)) { return; } - if (arg->ui == 0) + if (arg->ui == 0) { return; + } + + if (arg->ui == UINT32_MAX) { + m->pertag->prevtag = m->tagset[m->seltags]; + m->seltags ^= 1; /* toggle sel tagset */ + m->pertag->curtag = m->tagset[m->seltags]; + goto toggleseltags; + } if ((m->tagset[m->seltags] & arg->ui & TAGMASK) != 0) { want_animation = false; } m->seltags ^= 1; /* toggle sel tagset */ + if (arg->ui & TAGMASK) { m->tagset[m->seltags] = arg->ui & TAGMASK; tmptag = m->pertag->curtag; - if (arg->ui == ~0) + if (arg->ui == (~0 & TAGMASK)) m->pertag->curtag = 0; else { for (i = 0; !(arg->ui & 1 << i) && i < LENGTH(tags) && arg->ui != 0;