Apply attachbottom

This commit is contained in:
Franck STAUFFER 2020-09-04 09:57:20 +02:00
parent 100fed48d9
commit 52a87a26ad
Signed by: franck.stauffer
GPG Key ID: AAF5A94045CEC261

21
dwm.c
View File

@ -199,6 +199,8 @@ arrangemon(Monitor* m);
static void
attach(Client* c);
static void
attachbottom(Client* c);
static void
attachstack(Client* c);
static void
buttonpress(XEvent* e);
@ -551,6 +553,19 @@ attach(Client* c)
c->mon->clients = c;
}
void
attachbottom(Client* c)
{
c->next = NULL;
Client* below = c->mon->clients;
if (below) {
for(; below->next; below = below->next);
below->next = c;
}
else
c->mon->clients = c;
}
void
attachstack(Client* c)
{
@ -1281,7 +1296,7 @@ manage(Window w, XWindowAttributes* wa)
c->isfloating = c->oldstate = trans != None || c->isfixed;
if (c->isfloating)
XRaiseWindow(dpy, c->win);
attach(c);
attachbottom(c);
attachstack(c);
XChangeProperty(dpy,
root,
@ -1679,7 +1694,7 @@ sendmon(Client* c, Monitor* m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
attach(c);
attachbottom(c);
attachstack(c);
focus(NULL);
arrange(NULL);
@ -2242,7 +2257,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
attach(c);
attachbottom(c);
attachstack(c);
}
if (m == selmon)