mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-27 03:36:31 +00:00
restrict focusnext to the same monitor
This commit is contained in:
parent
a634b3f2e4
commit
59b09576b9
1 changed files with 9 additions and 6 deletions
13
dwl.c
13
dwl.c
|
@ -411,15 +411,18 @@ focus(Client *c, struct wlr_surface *surface)
|
||||||
void
|
void
|
||||||
focusnext(const Arg *arg)
|
focusnext(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
/* Focus the client on the selected monitor which comes first in tiling
|
||||||
|
* order after the currently selected client */
|
||||||
Client *sel = selclient();
|
Client *sel = selclient();
|
||||||
if (!sel)
|
if (!sel)
|
||||||
return;
|
return;
|
||||||
/* Find the selected client (top of fstack) and focus the client
|
Client *c;
|
||||||
* following it in tiling order */
|
wl_list_for_each(c, &sel->link, link) {
|
||||||
Client *c = wl_container_of(sel->link.next, c, link);
|
|
||||||
/* Skip the sentinel node if we wrap around the end of the list */
|
|
||||||
if (&c->link == &clients)
|
if (&c->link == &clients)
|
||||||
c = wl_container_of(c->link.next, c, link);
|
continue; /* wrap past the sentinel node */
|
||||||
|
if (VISIBLEON(c, selmon))
|
||||||
|
break; /* found it */
|
||||||
|
}
|
||||||
focus(c, c->xdg_surface->surface);
|
focus(c, c->xdg_surface->surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue