summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-10-07 05:05:35 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-10-07 05:05:35 +0530
commit07fa9cdccba09769b0a798c626b59af38b3c571a (patch)
treefe0745afe5ccb2d093ca91ba6d1c4292d04e92c2 /dwm.c
parent88d4c573c63a7d9928549ca37d6774945c52b757 (diff)
Applied attachbottom patch
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index 7408202..2a2bee5 100644
--- a/dwm.c
+++ b/dwm.c
@@ -174,6 +174,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);
@@ -453,6 +454,15 @@ attach(Client *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)
{
c->snext = c->mon->stack;
@@ -1201,7 +1211,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, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@@ -1557,7 +1567,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);
@@ -2078,7 +2088,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
- attach(c);
+ attachbottom(c);
attachstack(c);
}
if (m == selmon)