diff options
| author | Alexander Leonhardt <equinox.salexander@gmail.com> | |
|---|---|---|
| 2026-10-18 12:53:18 +0200 | ||
| committer | Alexander Leonhardt <equinox.salexander@gmail.com> | |
| 2026-10-18 12:53:18 +0200 | ||
| commit | 7574031f980f6b133c1b986b69d81976437caad8 (patch) | |
| tree | a57a81cf83667c3f7d30e6ba5e5a90a0b23ad768 | |
| parent | 1989b7cbd41a742cdeddaeb1d8793c1123d916fd (diff) | |
| download | dwl-merged.tar.gz dwl-merged.tar.bz2 dwl-merged.zip | |
Allowed cycling in monocle mode with established movement commandsmerged
@@ -1894,6 +1894,33 @@ focusmon(const Arg *arg) } + +void +focusstack(const Arg *arg) +{ + /* Focus the next or previous client (in tiling order) on selmon */ + Client *c, *sel = focustop(selmon); + if (!sel || (sel->isfullscreen && !client_has_children(sel))) + return; + if (arg->i > 0) { + wl_list_for_each(c, &sel->link, link) { + if (&c->link == &clients) + continue; /* wrap past the sentinel node */ + if (VISIBLEON(c, selmon)) + 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)) + break; /* found it */ + } + } + /* If only one client is visible on selmon, then c == sel */ + focusclient(c, 1); +} + void focusdir(const Arg *arg) { /* Focus the left, right, up, down client relative to the current focused client on selmon */ @@ -1934,6 +1961,14 @@ void focusdir(const Arg *arg) if (newsel != NULL){ focusclient(newsel, 1); } + else if(arg->ui == 2) { + Arg a = {.i=-1}; + focusstack(&a); + } + else if (arg->ui == 3) { + Arg a = {.i=1}; + focusstack(&a); + } } |