summaryrefslogtreecommitdiff
path: root/dwm-6.2/dwm.c
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2021-05-19 17:18:07 -0500
committerstkhan <personal@slickd.xyz>2021-05-19 17:18:07 -0500
commit60f1e650a996c95ab937627096300503cfd90292 (patch)
treeb547509fe650947fa2627dcec46ab4a202d0e221 /dwm-6.2/dwm.c
parent412fa23b2db9d2a74097a3c3cb8ba885dbc3e1a0 (diff)
Made installation script quiet, and added purple theme
Diffstat (limited to 'dwm-6.2/dwm.c')
-rw-r--r--dwm-6.2/dwm.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/dwm-6.2/dwm.c b/dwm-6.2/dwm.c
index 520b818..f788759 100644
--- a/dwm-6.2/dwm.c
+++ b/dwm-6.2/dwm.c
@@ -152,6 +152,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 attachabove(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@@ -428,6 +429,20 @@ attach(Client *c)
}
void
+attachabove(Client *c)
+{
+ if (c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) {
+ attach(c);
+ return;
+ }
+
+ Client *at;
+ for (at = c->mon->clients; at->next != c->mon->sel; at = at->next);
+ c->next = at->next;
+ at->next = c;
+}
+
+void
attachstack(Client *c)
{
c->snext = c->mon->stack;
@@ -1087,7 +1102,7 @@ manage(Window w, XWindowAttributes *wa)
c->isfloating = c->oldstate = trans != None || c->isfixed;
if (c->isfloating)
XRaiseWindow(dpy, c->win);
- attach(c);
+ attachabove(c);
attachstack(c);
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@@ -1519,7 +1534,7 @@ sendmon(Client *c, Monitor *m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
+ attachabove(c);
attachstack(c);
focus(NULL);
arrange(NULL);
@@ -2110,7 +2125,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
- attach(c);
+ attachabove(c);
attachstack(c);
}
if (m == selmon)