mirror of
https://github.com/bakkeby/dwm-flexipatch
synced 2024-11-15 00:15:07 +00:00
23 lines
630 B
C
23 lines
630 B
C
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);
|
|
}
|
|
}
|
|
}
|
|
|