dwm

Kris's build of dwm
git clone git clone https://git.krisyotam.com/krisyotam/dwm.git
Log | Files | Refs | README | LICENSE

swapfocus.c (630B)


      1 void
      2 swapfocus(const Arg *arg)
      3 {
      4    if (!selmon->sel)
      5        return;
      6    if (selmon->pertag->prevclient[selmon->pertag->curtag] != NULL
      7            && ISVISIBLE(selmon->pertag->prevclient[selmon->pertag->curtag])) {
      8        focus(selmon->pertag->prevclient[selmon->pertag->curtag]);
      9        restack(selmon->pertag->prevclient[selmon->pertag->curtag]->mon);
     10    }
     11    else {
     12        Client *c = NULL;
     13        for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
     14        if (!c)
     15            for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
     16        if (c) {
     17            focus(c);
     18            restack(selmon);
     19        }
     20    }
     21 }
     22