opt: optimize code struct

This commit is contained in:
DreamMaoMao 2025-09-28 18:34:11 +08:00
parent 53b8fa4597
commit 78990f66ff
3 changed files with 20 additions and 17 deletions

View file

@ -335,3 +335,19 @@ focustop(Monitor *m) {
}
return NULL;
}
Client *get_next_stack_client(Client *c, bool reverse) {
Client *next = NULL;
if (reverse) {
wl_list_for_each_reverse(next, &c->link, link) {
if (VISIBLEON(next, c->mon) && next != c)
return next;
}
} else {
wl_list_for_each(next, &c->link, link) {
if (VISIBLEON(next, c->mon) && next != c)
return next;
}
}
return NULL;
}