summaryrefslogtreecommitdiff
path: root/sd/dwm-6.2/dwm-attachabove-6.2-20200421.diff
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2021-06-19 10:42:34 -0500
committerstkhan <personal@slickd.xyz>2021-06-19 10:42:34 -0500
commite2dbb81b9144fd8be2eb89617db38fd361079fed (patch)
tree77cdbe3673b967c594327c878379aaae9c56daaf /sd/dwm-6.2/dwm-attachabove-6.2-20200421.diff
parente8df46e3babbb943a729935786a0d55dbe0e2028 (diff)
1.0.0b2
Former-commit-id: 7e8e8ad1998285a5b38c4bedd38acd0bbe37de4d
Diffstat (limited to 'sd/dwm-6.2/dwm-attachabove-6.2-20200421.diff')
-rw-r--r--sd/dwm-6.2/dwm-attachabove-6.2-20200421.diff60
1 files changed, 60 insertions, 0 deletions
diff --git a/sd/dwm-6.2/dwm-attachabove-6.2-20200421.diff b/sd/dwm-6.2/dwm-attachabove-6.2-20200421.diff
new file mode 100644
index 0000000..198f293
--- /dev/null
+++ b/sd/dwm-6.2/dwm-attachabove-6.2-20200421.diff
@@ -0,0 +1,60 @@
+diff --git a/local/src/dwm/dwm.c b/local/src/dwm/dwm.c
+index 83e44e0..94392b4 100644
+--- a/local/src/dwm/dwm.c
++++ b/local/src/dwm/dwm.c
+@@ -164,6 +164,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);
+@@ -431,6 +432,20 @@ attach(Client *c)
+ c->mon->clients = 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)
+ {
+@@ -1272,7 +1287,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);
+@@ -1633,7 +1648,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);
+@@ -2122,7 +2137,7 @@ updategeom(void)
+ m->clients = c->next;
+ detachstack(c);
+ c->mon = mons;
+- attach(c);
++ attachabove(c);
+ attachstack(c);
+ }
+ if (m == selmon)