[wiki] [sites] attachaside tagfix patch: Use correct extension (.diff, not .patch) || Chris Down
commit df58c95fdc84e3a07eafb4379221053885b3eb51
Author: Chris Down <chris_AT_chrisdown.name>
Date: Wed Jul 29 23:53:23 2015 -0700
attachaside tagfix patch: Use correct extension (.diff, not .patch)
diff --git a/dwm.suckless.org/patches/attachaside.md b/dwm.suckless.org/patches/attachaside.md
index 52e51ad..caf1bf8 100644
--- a/dwm.suckless.org/patches/attachaside.md
+++ b/dwm.suckless.org/patches/attachaside.md
_AT_@ -50,7 +50,7 @@ The original version of attachaside does does not attach to the stack when
windows are spawned on a tag that is not currently focused. This version is
improved to also attach to the stack on unfocused tags.
-* [dwm-6.0-attachaside-tagfix.patch](dwm-6.0-attachaside-tagfix.patch) (2.9K) (20150729)
+* [dwm-6.1-attachaside-tagfix.diff](dwm-6.1-attachaside-tagfix.diff) (2.9K) (20150729)
### Original
diff --git a/dwm.suckless.org/patches/dwm-6.0-attachaside-tagfix.patch b/dwm.suckless.org/patches/dwm-6.0-attachaside-tagfix.patch
deleted file mode 100644
index 2a48757..0000000
--- a/dwm.suckless.org/patches/dwm-6.0-attachaside-tagfix.patch
+++ /dev/null
_AT_@ -1,92 +0,0 @@
-diff --git a/dwm.c b/dwm.c
-index 1d78655..452be92 100644
---- a/dwm.c
-+++ b/dwm.c
-_AT_@ -45,7 +45,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 MAX(A, B) ((A) > (B) ? (A) : (B))
- #define MIN(A, B) ((A) < (B) ? (A) : (B))
-_AT_@ -160,6 +161,7 @@ static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool inter
- 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_@ -202,6 +204,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_@ -418,6 +421,17 @@ attach(Client *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) {
- c->snext = c->mon->stack;
- c->mon->stack = c;
-_AT_@ -1155,7 +1169,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);
- XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
- setclientstate(c, NormalState);
-_AT_@ -1274,6 +1288,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) {
- for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
- return c;
-_AT_@ -1480,7 +1504,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_@ -1900,7 +1924,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/dwm-6.1-attachaside-tagfix.diff b/dwm.suckless.org/patches/dwm-6.1-attachaside-tagfix.diff
new file mode 100644
index 0000000..e7e105f
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-attachaside-tagfix.diff
_AT_@ -0,0 +1,92 @@
+diff --git dwm.c dwm.c
+index 169adcb..cd299e0 100644
+--- dwm.c
++++ 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 Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool inter
+ 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 *);
+ static void propertynotify(XEvent *e);
+_AT_@ -401,6 +404,17 @@ attach(Client *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) {
+ c->snext = c->mon->stack;
+ c->mon->stack = c;
+_AT_@ -1050,7 +1064,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_@ -1179,6 +1193,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) {
+ for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
+ return c;
+_AT_@ -1391,7 +1415,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_@ -1827,7 +1851,7 @@ updategeom(void) {
+ m->clients = c->next;
+ detachstack(c);
+ c->mon = mons;
+- attach(c);
++ attachaside(c);
+ attachstack(c);
+ }
+ if(m == selmon)
Received on Thu Jul 30 2015 - 08:54:29 CEST
This archive was generated by hypermail 2.3.0
: Thu Jul 30 2015 - 09:00:12 CEST