~kris/suckless

dwm

ref: ecba1fc15a4e33ba4b00e04f8f047170019d7f2f dwm/patch/swapfocus.c -rw-r--r-- 630 bytes
ecba1fc1 — Kris Yotam enable FLEXTILE_DELUXE_LAYOUT for RRR reading mode (3 vertical panes) 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
void
swapfocus(const Arg *arg)
{
   if (!selmon->sel)
       return;
   if (selmon->pertag->prevclient[selmon->pertag->curtag] != NULL
           && ISVISIBLE(selmon->pertag->prevclient[selmon->pertag->curtag])) {
       focus(selmon->pertag->prevclient[selmon->pertag->curtag]);
       restack(selmon->pertag->prevclient[selmon->pertag->curtag]->mon);
   }
   else {
       Client *c = NULL;
       for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
       if (!c)
           for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
       if (c) {
           focus(c);
           restack(selmon);
       }
   }
}