Return to repo list

suckless-gf-dwm

Gentoo-friendly patches for Suckless's dwm.
Return to HMagellan.com

commit abb476392fe5de4199cb6132d05ec94056c9237c
parent b9fc16b2beca5a139fb1aed60aa4f34d3911418b
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Thu, 13 Aug 2020 21:46:55 -0500

Added attachabove

Diffstat:
MREADME | 2+-
Aattachabove/USAGE | 23+++++++++++++++++++++++
Aattachabove/attachabove.patch | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/README b/README @@ -42,7 +42,7 @@ patches! (1). https://dwm.suckless.org/patches/ - CURRENT PROGRESS: 11/172 patches supported + CURRENT PROGRESS: 12/172 patches supported 1/172 patches unsupported USUPPORTED PATCHES: diff --git a/attachabove/USAGE b/attachabove/USAGE @@ -0,0 +1,23 @@ +attachabove - Spawn new windows above the selected window in the stack, rather than make it master +Source: https://dwm.suckless.org/patches/attachabove/dwm-attachabove-6.2-20200421.diff +Original Authors: Mate Nagy - mnagy@port70.net + Jan Christoph Ebersbach - jceb@e-jc.de (6.0, 6.1 ports) + Laslo Hunhold - dev@frign.de (git port) + +Description from source: + """ + Make new clients attach above the selected client, instead of always becoming the new master. This + behaviour is known from Xmonad. + """ + +== YOU MUST == +(1). Place the patch file in /etc/portage/patches/x11-wm/dwm/ and run 'emerge dwm' + +== YOU PROBABLY SHOULD == +No further action is required. + +== PATCH MODIFICATIONS == +(1). Changed the unusual diff file paths to simply 'a/dwm.c' and 'b/dwm.c'. + +== INCOMPATIBILITIES == +No known specific incompatibilities. diff --git a/attachabove/attachabove.patch b/attachabove/attachabove.patch @@ -0,0 +1,60 @@ +diff --git a/dwm.c b/dwm.c +index 83e44e0..94392b4 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -164,6 +164,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); +@@ -431,6 +432,20 @@ attach(Client *c) + 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 + attachstack(Client *c) + { +@@ -1272,7 +1287,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); +@@ -1633,7 +1648,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); +@@ -2122,7 +2137,7 @@ updategeom(void) + m->clients = c->next; + detachstack(c); + c->mon = mons; +- attach(c); ++ attachabove(c); + attachstack(c); + } + if (m == selmon)