[wiki] [sites] dwm: update attachabove patches || FRIGN

From: <git_AT_suckless.org>
Date: Wed, 13 Jul 2016 09:12:00 +0200

commit 231c335c99d8b7d75fcbafd96b036abd74971e5d
Author: FRIGN <dev_AT_frign.de>
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
_AT_@ -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 - <mnagy_AT_port70.net>
- * Rewritten by Jan Christoph Ebersbach - <jceb_AT_e-jc.de>
+ * Jan Christoph Ebersbach - <jceb_AT_e-jc.de> - (6.0, 6.1 ports)
+ * Laslo Hunhold - <dev_AT_frign.de> - (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
_AT_@ -0,0 +1,60 @@
+diff --git a/dwm.c b/dwm.c
+index b2bc9bd..5a380e6 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -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);
+_AT_@ -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;
+_AT_@ -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);
+_AT_@ -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);
+_AT_@ -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
_AT_@ -1,12 +1,8 @@
-Author: Jan Christoph Ebersbach <jceb_AT_e-jc.de>
-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
-_AT_@ -160,6 +160,7 @@
+diff --git a/dwm.c b/dwm.c
+index 1d78655..a9e0ea4 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -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);
_AT_@ -14,7 +10,7 @@ diff -r ec4baab78314 dwm.c
  static void attachstack(Client *c);
  static void buttonpress(XEvent *e);
  static void checkotherwm(void);
-_AT_@ -418,6 +419,19 @@
+_AT_@ -418,6 +419,19 @@ attach(Client *c) {
  }
  
  void
_AT_@ -34,7 +30,7 @@ diff -r ec4baab78314 dwm.c
  attachstack(Client *c) {
          c->snext = c->mon->stack;
          c->mon->stack = c;
-_AT_@ -1155,7 +1169,7 @@
+_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);
_AT_@ -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);
-_AT_@ -1480,7 +1494,7 @@
+_AT_@ -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 */
_AT_@ -52,7 +48,7 @@ diff -r ec4baab78314 dwm.c
          attachstack(c);
          focus(NULL);
          arrange(NULL);
-_AT_@ -1900,7 +1914,7 @@
+_AT_@ -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
_AT_@ -1,11 +1,8 @@
-Author: Jan Christoph Ebersbach <jceb_AT_e-jc.de>
-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
-_AT_@ -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
+_AT_@ -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
_AT_@ -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
-_AT_@ -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);
-_AT_@ -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
-_AT_@ -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);
Received on Wed Jul 13 2016 - 09:12:00 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 13 2016 - 09:12:22 CEST