Add attachtop patch

This commit is contained in:
Sravan Balaji
2024-09-15 23:53:14 -04:00
parent 7adf14be70
commit 1b106aea12
4 changed files with 67 additions and 1 deletions

17
dwl.c
View File

@@ -1801,7 +1801,22 @@ mapnotify(struct wl_listener *listener, void *data)
c->geom.height += 2 * c->bw;
/* Insert this client into client lists. */
wl_list_insert(&clients, &c->link);
#if ATTACHTOP_PATCH
i = 0;
wl_list_for_each(w, &clients, link) {
if (!VISIBLEON(w, selmon) || c->isfloating)
continue;
p = w;
if (++i >= selmon->nmaster)
break;
}
if (i > 0)
wl_list_insert(&p->link, &c->link);
else
wl_list_insert(&clients, &c->link);
#else
wl_list_insert(&clients, &c->link);
#endif // ATTACHTOP_PATCH
wl_list_insert(&fstack, &c->flink);
/* Set initial monitor, tags, floating status, and focus: