[wiki] [sites] added fixed attachaside patch for dwm 6.4 || staticfanfare

From: <git_AT_suckless.org>
Date: Mon, 04 Sep 2023 15:46:35 +0200

commit fb8caa45dd3f9a6c1a6451123d2ab1b81a0c4b17
Author: staticfanfare <staticfanfare_AT_canary.city>
Date: Mon Sep 4 09:45:54 2023 -0400

    added fixed attachaside patch for dwm 6.4

diff --git a/dwm.suckless.org/patches/attachaside/dwm-attachaside-6.4.diff b/dwm.suckless.org/patches/attachaside/dwm-attachaside-6.4.diff
new file mode 100644
index 00000000..17be6b57
--- /dev/null
+++ b/dwm.suckless.org/patches/attachaside/dwm-attachaside-6.4.diff
_AT_@ -0,0 +1,92 @@
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..8b04e0b 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -49,7 +49,8 @@
+ #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
+ #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
+ * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
+-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
++#define ISVISIBLEONTAG(C, T) ((C->tags & T))
++#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags])
+ #define LENGTH(X) (sizeof X / sizeof X[0])
+ #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
+ #define WIDTH(X) ((X)->w + 2 * (X)->bw)
+_AT_@ -147,6 +148,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 attachaside(Client *c);
+ static void attachstack(Client *c);
+ static void buttonpress(XEvent *e);
+ static void checkotherwm(void);
+_AT_@ -184,6 +186,7 @@ static void maprequest(XEvent *e);
+ static void monocle(Monitor *m);
+ static void motionnotify(XEvent *e);
+ static void movemouse(const Arg *arg);
++static Client *nexttagged(Client *c);
+ static Client *nexttiled(Client *c);
+ static void pop(Client *c);
+ static void propertynotify(XEvent *e);
+_AT_@ -408,6 +411,17 @@ attach(Client *c)
+ c->mon->clients = c;
+ }
+
++void
++attachaside(Client *c) {
++ Client *at = nexttagged(c);
++ if(!at) {
++ attach(c);
++ return;
++ }
++ c->next = at->next;
++ at->next = c;
++}
++
+ void
+ attachstack(Client *c)
+ {
+_AT_@ -1074,7 +1088,7 @@ manage(Window w, XWindowAttributes *wa)
+ c->isfloating = c->oldstate = trans != None || c->isfixed;
+ if (c->isfloating)
+ XRaiseWindow(dpy, c->win);
+- attach(c);
++ attachaside(c);
+ attachstack(c);
+ XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
+ (unsigned char *) &(c->win), 1);
+_AT_@ -1202,6 +1216,16 @@ movemouse(const Arg *arg)
+ }
+ }
+
++Client *
++nexttagged(Client *c) {
++ Client *walked = c->mon->clients;
++ for(;
++ walked && (walked->isfloating || !ISVISIBLEONTAG(walked, c->tags));
++ walked = walked->next
++ );
++ return walked;
++}
++
+ Client *
+ nexttiled(Client *c)
+ {
+_AT_@ -1427,7 +1451,7 @@ sendmon(Client *c, Monitor *m)
+ detachstack(c);
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+- attach(c);
++ attachaside(c);
+ attachstack(c);
+ focus(NULL);
+ arrange(NULL);
+_AT_@ -1915,7 +1939,7 @@ updategeom(void)
+ m->clients = c->next;
+ detachstack(c);
+ c->mon = mons;
+- attach(c);
++ attachaside(c);
+ attachstack(c);
+ }
+ if (m == selmon)
diff --git a/dwm.suckless.org/patches/attachaside/index.md b/dwm.suckless.org/patches/attachaside/index.md
index 099da76d..935981f6 100644
--- a/dwm.suckless.org/patches/attachaside/index.md
+++ b/dwm.suckless.org/patches/attachaside/index.md
_AT_@ -43,6 +43,7 @@ always becoming the new master. It's basically an
 
 Download
 --------
+* [dwm-attachaside-6.4.diff](dwm-attachaside-6.4.diff)
 * [dwm-attachaside-6.3.diff](dwm-attachaside-6.3.diff)
 * [dwm-attachaside-6.1.diff](dwm-attachaside-6.1.diff)
 * [dwm-attachaside-20160718-56a31dc.diff](dwm-attachaside-20160718-56a31dc.diff)
Received on Mon Sep 04 2023 - 15:46:35 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 04 2023 - 15:49:09 CEST