mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
opt: optimzie code struct
This commit is contained in:
parent
b273ea5811
commit
53b8fa4597
1 changed files with 14 additions and 4 deletions
|
|
@ -176,27 +176,37 @@ void // 17
|
|||
focusstack(const Arg *arg) {
|
||||
/* Focus the next or previous client (in tiling order) on selmon */
|
||||
Client *c, *sel = focustop(selmon);
|
||||
Client *tc = NULL;
|
||||
|
||||
if (!sel || sel->isfullscreen)
|
||||
return;
|
||||
if (arg->i > 0) {
|
||||
wl_list_for_each(c, &sel->link, link) {
|
||||
if (&c->link == &clients || c->isunglobal)
|
||||
continue; /* wrap past the sentinel node */
|
||||
if (VISIBLEON(c, selmon))
|
||||
if (VISIBLEON(c, selmon)) {
|
||||
tc = c;
|
||||
break; /* found it */
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wl_list_for_each_reverse(c, &sel->link, link) {
|
||||
if (&c->link == &clients)
|
||||
continue; /* wrap past the sentinel node */
|
||||
if (VISIBLEON(c, selmon) || c->isunglobal)
|
||||
if (VISIBLEON(c, selmon) || c->isunglobal) {
|
||||
tc = c;
|
||||
break; /* found it */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* If only one client is visible on selmon, then c == sel */
|
||||
focusclient(c, 1);
|
||||
|
||||
if (!tc)
|
||||
return;
|
||||
|
||||
focusclient(tc, 1);
|
||||
if (warpcursor)
|
||||
warp_cursor(c);
|
||||
warp_cursor(tc);
|
||||
}
|
||||
|
||||
void incnmaster(const Arg *arg) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue