Apply attachbottom patch (dwm-attachbottom-20201227-61bb8b2.diff)

This commit is contained in:
Alex Kotov 2021-11-12 14:33:43 +05:00
parent 583a91998d
commit e0286b09c7
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 13 additions and 3 deletions

16
dwm.c
View File

@ -169,6 +169,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac
static void arrange(Monitor *m);
static void arrangemon(Monitor *m);
static void attach(Client *c);
static void attachbottom(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@ -450,6 +451,15 @@ attach(Client *c)
c->mon->clients = c;
}
void
attachbottom(Client *c)
{
Client **tc;
c->next = NULL;
for (tc = &c->mon->clients; *tc; tc = &(*tc)->next);
*tc = c;
}
void
attachstack(Client *c)
{
@ -1208,7 +1218,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, atoms->netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@ -1667,7 +1677,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);
@ -2180,7 +2190,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
attach(c);
attachbottom(c);
attachstack(c);
}
if (m == selmon)