commit 231c335c99d8b7d75fcbafd96b036abd74971e5d
Author: FRIGN <[email protected]>
Date:   Wed Jul 13 09:11:42 2016 +0200

    dwm: update attachabove patches

diff --git a/dwm.suckless.org/patches/attachabove.md 
b/dwm.suckless.org/patches/attachabove.md
index fa2dae0..c99d6a9 100644
--- a/dwm.suckless.org/patches/attachabove.md
+++ b/dwm.suckless.org/patches/attachabove.md
@@ -8,15 +8,13 @@ always becoming the new master) - basically how Xmonad does 
it.
 
 Download
 --------
-Patches against different versions of dwm are available at
-[dwm-clean-patches](https://github.com/jceb/dwm-clean-patches).
 
- * [dwm-attachabove-6.1.diff](dwm-attachabove-6.1.diff) (1829b) (20151122)
- * [dwm-git-20120406-attachabove.diff](dwm-git-20120406-attachabove.diff) 
(1709b)
- * [dwm-attachabove-6.0.diff](dwm-attachabove-6.0.diff) (1707b) (20120406)
- * [dwm-5.6.1-attachabove.diff](historical/dwm-5.6.1-attachabove.diff) (1.1K) 
(20090817)
+ * [dwm-attachabove-6.0.diff](dwm-attachabove-6.0.diff)
+ * [dwm-attachabove-6.1.diff](dwm-attachabove-6.1.diff)
+ * 
[dwm-attachabove-20160713-56a31dc.diff](dwm-attachabove-20160713-56a31dc.diff)
 
 Author
 ------
  * Mate Nagy - <[email protected]>
- * Rewritten by Jan Christoph Ebersbach - <[email protected]>
+ * Jan Christoph Ebersbach - <[email protected]> - (6.0, 6.1 ports)
+ * Laslo Hunhold - <[email protected]> - (git port)
diff --git a/dwm.suckless.org/patches/dwm-attachabove-20160713-56a31dc.diff 
b/dwm.suckless.org/patches/dwm-attachabove-20160713-56a31dc.diff
new file mode 100644
index 0000000..6bf69d1
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-attachabove-20160713-56a31dc.diff
@@ -0,0 +1,60 @@
+diff --git a/dwm.c b/dwm.c
+index b2bc9bd..5a380e6 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -148,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 attachabove(Client *c);
+ static void attachstack(Client *c);
+ static void buttonpress(XEvent *e);
+ static void checkotherwm(void);
+@@ -408,6 +409,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;
+@@ -1079,7 +1094,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);
+@@ -1437,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);
++      attachabove(c);
+       attachstack(c);
+       focus(NULL);
+       arrange(NULL);
+@@ -1890,7 +1905,7 @@ updategeom(void)
+                                       m->clients = c->next;
+                                       detachstack(c);
+                                       c->mon = mons;
+-                                      attach(c);
++                                      attachabove(c);
+                                       attachstack(c);
+                               }
+                               if (m == selmon)
diff --git a/dwm.suckless.org/patches/dwm-attachabove-6.0.diff 
b/dwm.suckless.org/patches/dwm-attachabove-6.0.diff
index 7ee956d..be5dea5 100644
--- a/dwm.suckless.org/patches/dwm-attachabove-6.0.diff
+++ b/dwm.suckless.org/patches/dwm-attachabove-6.0.diff
@@ -1,12 +1,8 @@
-Author: Jan Christoph Ebersbach <[email protected]>
-URL: http://dwm.suckless.org/patches/attachabove
-attachabove makes new clients attach above the selected client (instead of
-always becoming the new master) – basically how Xmonad does it.
-
-diff -r ec4baab78314 dwm.c
---- a/dwm.c    Mon Dec 19 15:38:30 2011 +0100
-+++ b/dwm.c    Fri Apr 06 08:23:34 2012 +0200
-@@ -160,6 +160,7 @@
+diff --git a/dwm.c b/dwm.c
+index 1d78655..a9e0ea4 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -160,6 +160,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);
@@ -14,7 +10,7 @@ diff -r ec4baab78314 dwm.c
  static void attachstack(Client *c);
  static void buttonpress(XEvent *e);
  static void checkotherwm(void);
-@@ -418,6 +419,19 @@
+@@ -418,6 +419,19 @@ attach(Client *c) {
  }
  
  void
@@ -34,7 +30,7 @@ diff -r ec4baab78314 dwm.c
  attachstack(Client *c) {
        c->snext = c->mon->stack;
        c->mon->stack = c;
-@@ -1155,7 +1169,7 @@
+@@ -1155,7 +1169,7 @@ manage(Window w, XWindowAttributes *wa) {
                c->isfloating = c->oldstate = trans != None || c->isfixed;
        if(c->isfloating)
                XRaiseWindow(dpy, c->win);
@@ -43,7 +39,7 @@ diff -r ec4baab78314 dwm.c
        attachstack(c);
        XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* 
some windows require this */
        setclientstate(c, NormalState);
-@@ -1480,7 +1494,7 @@
+@@ -1480,7 +1494,7 @@ sendmon(Client *c, Monitor *m) {
        detachstack(c);
        c->mon = m;
        c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
@@ -52,7 +48,7 @@ diff -r ec4baab78314 dwm.c
        attachstack(c);
        focus(NULL);
        arrange(NULL);
-@@ -1900,7 +1914,7 @@
+@@ -1900,7 +1914,7 @@ updategeom(void) {
                                        m->clients = c->next;
                                        detachstack(c);
                                        c->mon = mons;
diff --git a/dwm.suckless.org/patches/dwm-attachabove-6.1.diff 
b/dwm.suckless.org/patches/dwm-attachabove-6.1.diff
index e941939..8c28b3e 100644
--- a/dwm.suckless.org/patches/dwm-attachabove-6.1.diff
+++ b/dwm.suckless.org/patches/dwm-attachabove-6.1.diff
@@ -1,11 +1,8 @@
-Author: Jan Christoph Ebersbach <[email protected]>
-URL: http://dwm.suckless.org/patches/attachabove
-attachabove makes new clients attach above the selected client (instead of
-always becoming the new master) - basically how Xmonad does it.
-
---- dwm/dwm.c.orig     2015-11-22 10:48:28.288368772 -0700
-+++ dwm/dwm.c  2015-11-22 10:51:45.308360761 -0700
-@@ -147,6 +147,7 @@ static int applysizehints(Client *c, int
+diff --git a/dwm.c b/dwm.c
+index 0362114..413ec1f 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -147,6 +147,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);
diff --git a/dwm.suckless.org/patches/historical/dwm-5.6.1-attachabove.diff 
b/dwm.suckless.org/patches/historical/dwm-5.6.1-attachabove.diff
deleted file mode 100644
index d9e99a4..0000000
--- a/dwm.suckless.org/patches/historical/dwm-5.6.1-attachabove.diff
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -r e47a47bd3ed4 dwm.c
---- a/dwm.c    Tue Jul 21 10:57:54 2009 +0100
-+++ b/dwm.c    Mon Aug 17 15:03:36 2009 +0200
-@@ -153,6 +153,7 @@
- static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool 
interact);
- static void arrange(void);
- static void attach(Client *c);
-+static void attachabove(Client *c);
- static void attachstack(Client *c);
- static void buttonpress(XEvent *e);
- static void checkotherwm(void);
-@@ -394,6 +395,19 @@
- attach(Client *c) {
-       c->next = c->mon->clients;
-       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
-@@ -1098,7 +1112,7 @@
-               c->isfloating = trans != None || c->isfixed;
-       if(c->isfloating)
-               XRaiseWindow(dpy, c->win);
--      attach(c);
-+      attachabove(c);
-       attachstack(c);
-       XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* 
some windows require this */
-       XMapWindow(dpy, c->win);


Reply via email to