[wiki] [sites] added the attachasideandbelow patch || toniz4

From: <git_AT_suckless.org>
Date: Mon, 06 Jul 2020 17:29:47 +0200

commit 1a25d9ced59ab4c52111c54201b3334008d6f846
Author: toniz4 <cassioavila000_AT_gmail.com>
Date: Mon Jul 6 12:30:09 2020 -0300

    added the attachasideandbelow patch

diff --git a/dwm.suckless.org/patches/attachasideandbelow/dwm-attachasideandbelow-20200702-f04cac6.diff b/dwm.suckless.org/patches/attachasideandbelow/dwm-attachasideandbelow-20200702-f04cac6.diff
new file mode 100644
index 00000000..1b9219de
--- /dev/null
+++ b/dwm.suckless.org/patches/attachasideandbelow/dwm-attachasideandbelow-20200702-f04cac6.diff
_AT_@ -0,0 +1,100 @@
+diff -up b/dwm.c a/dwm.c
+--- b/dwm.c 2020-07-05 16:05:02.555947738 -0300
++++ a/dwm.c 2020-07-05 16:06:19.592609932 -0300
+_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
+ static void arrange(Monitor *m);
+ static void arrangemon(Monitor *m);
+ static void attach(Client *c);
++static void attachBelow(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 *);
+ static void propertynotify(XEvent *e);
+_AT_@ -406,6 +409,27 @@ attach(Client *c)
+ c->next = c->mon->clients;
+ c->mon->clients = c;
+ }
++void
++attachBelow(Client *c)
++{
++ //If there is nothing on the monitor or the selected client is floating, attach as normal
++ if(c->mon->sel == NULL || c->mon->sel->isfloating) {
++ Client *at = nexttagged(c);
++ if(!at) {
++ attach(c);
++ return;
++ }
++ c->next = at->next;
++ at->next = c;
++ return;
++ }
++
++ //Set the new client's next property to the same as the currently selected clients next
++ c->next = c->mon->sel->next;
++ //Set the currently selected clients next property to the new client
++ c->mon->sel->next = c;
++
++}
+
+ void
+ attachstack(Client *c)
+_AT_@ -1063,7 +1087,7 @@ manage(Window w, XWindowAttributes *wa)
+ c->isfloating = c->oldstate = trans != None || c->isfixed;
+ if (c->isfloating)
+ XRaiseWindow(dpy, c->win);
+- attach(c);
++ attachBelow(c);
+ attachstack(c);
+ XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
+ (unsigned char *) &(c->win), 1);
+_AT_@ -1193,6 +1217,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_@ -1418,7 +1452,7 @@ sendmon(Client *c, Monitor *m)
+ detachstack(c);
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+- attach(c);
++ attachBelow(c);
+ attachstack(c);
+ focus(NULL);
+ arrange(NULL);
+_AT_@ -1901,6 +1935,7 @@ updategeom(void)
+ detachstack(c);
+ c->mon = mons;
+ attach(c);
++ attachBelow(c);
+ attachstack(c);
+ }
+ if (m == selmon)
diff --git a/dwm.suckless.org/patches/attachasideandbelow/index.md b/dwm.suckless.org/patches/attachasideandbelow/index.md
new file mode 100644
index 00000000..39c745ac
--- /dev/null
+++ b/dwm.suckless.org/patches/attachasideandbelow/index.md
_AT_@ -0,0 +1,21 @@
+attachasideandbelow
+===================
+
+Description
+-----------
+Combination between attachaside and attachbelow. Clients will not be pushed down in the
+stack, only resized, and the master can't be pushed to the slave stack by spawning another
+client.
+
+Download
+--------
+* [dwm-attachasideandbelow-20200702-f04cac6.diff](dwm-attachasideandbelow-20200702-f04cac6.diff)
+
+
+Authors
+-------
+* Cássio Ávila - <cassioavila_AT_yandex.com>
+* Jerome Andrieux - <jerome_AT_gcu.info> (attachaside patch)
+* Chris Down - <chris_AT_chrisdown.name> (attachaside patch 6.1 port and fixes)
+* Laslo Hunhold - <dev_AT_frign.de> (attachaside patch git port)
+* Jonathan Hodgson - <git_AT_jonathanh.co.uk> (attachbelow patch)
Received on Mon Jul 06 2020 - 17:29:47 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 06 2020 - 17:36:45 CEST