dwm-attachbottom-6.8.diff (1449B)
1 --- dwm-6.8/dwm.c 2026-01-30 02:19:28.660280483 -0800 2 +++ dwm-6.8-attachbottom/dwm.c 2026-05-29 15:33:49.595818574 -0700 3 @@ -146,6 +146,7 @@ static int applysizehints(Client *c, int 4 static void arrange(Monitor *m); 5 static void arrangemon(Monitor *m); 6 static void attach(Client *c); 7 +static void attachbottom(Client *c); 8 static void attachstack(Client *c); 9 static void buttonpress(XEvent *e); 10 static void checkotherwm(void); 11 @@ -408,6 +409,15 @@ attach(Client *c) 12 } 13 14 void 15 +attachbottom(Client *c) 16 +{ 17 + Client **tc; 18 + c->next = NULL; 19 + for (tc = &c->mon->clients; *tc; tc = &(*tc)->next); 20 + *tc = c; 21 +} 22 + 23 +void 24 attachstack(Client *c) 25 { 26 c->snext = c->mon->stack; 27 @@ -1074,7 +1084,7 @@ manage(Window w, XWindowAttributes *wa) 28 c->isfloating = c->oldstate = trans != None || c->isfixed; 29 if (c->isfloating) 30 XRaiseWindow(dpy, c->win); 31 - attach(c); 32 + attachbottom(c); 33 attachstack(c); 34 XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 35 (unsigned char *) &(c->win), 1); 36 @@ -1427,7 +1437,7 @@ sendmon(Client *c, Monitor *m) 37 detachstack(c); 38 c->mon = m; 39 c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 40 - attach(c); 41 + attachbottom(c); 42 attachstack(c); 43 focus(NULL); 44 arrange(NULL); 45 @@ -1915,7 +1925,7 @@ updategeom(void) 46 m->clients = c->next; 47 detachstack(c); 48 c->mon = mons; 49 - attach(c); 50 + attachbottom(c); 51 attachstack(c); 52 } 53 if (m == selmon)