Commits

Anonymous committed 9a2b79e

fix broken zoomswap patch; add support for zoomswap to pertag

Comments (0)

Files changed (10)

configh_focusmaster.patch

 # HG changeset patch
-# Parent 742f035e22a102562bcd99ef4f26a1ce3e5d4f5d
+# Parent ca845c5c0a7bff71030b46813f83fe10e96533c0
 
-diff -r 742f035e22a1 config.def.h
---- a/config.def.h	Tue Aug 07 07:28:34 2012 +0200
-+++ b/config.def.h	Tue Aug 07 07:29:01 2012 +0200
-@@ -62,6 +62,7 @@
- #include "tagall.c"
+diff -r ca845c5c0a7b config.def.h
+--- a/config.def.h	Thu Apr 04 21:05:38 2013 +0200
++++ b/config.def.h	Thu Apr 04 21:05:52 2013 +0200
+@@ -63,6 +63,7 @@
  #include "maximize.c"
+ #include "zoomswap.c"
  #include "push.c"
 +#include "focusmaster.c"
  static Key keys[] = {
  	/* modifier                     key        function        argument */
  	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
-@@ -126,6 +127,7 @@
+@@ -128,6 +129,7 @@
  	{ MODKEY|ShiftMask,             XK_d,      moveresize,     {.v = "0x 0y 10w 0h" } },
  	{ MODKEY|ShiftMask,             XK_s,      moveresize,     {.v = "0x 0y 0w 10h" } },
  	{ MODKEY|ShiftMask,             XK_w,      moveresize,     {.v = "0x 0y 0w -10h" } },

configh_push.patch

 # HG changeset patch
-# Parent c36dfea0221ff270ca8d866fec3ce56e7485825e
+# Parent d672d038fcf77c556958402234561c03a39b4369
 
-diff -r c36dfea0221f config.def.h
---- a/config.def.h	Sat Feb 11 21:05:12 2012 +0100
-+++ b/config.def.h	Sat Feb 11 21:05:48 2012 +0100
-@@ -54,6 +54,7 @@
- #include "moveresize.c"
+diff -r d672d038fcf7 config.def.h
+--- a/config.def.h	Thu Apr 04 21:01:58 2013 +0200
++++ b/config.def.h	Thu Apr 04 21:02:36 2013 +0200
+@@ -62,6 +62,7 @@
  #include "tagall.c"
  #include "maximize.c"
+ #include "zoomswap.c"
 +#include "push.c"
  static Key keys[] = {
  	/* modifier                     key        function        argument */
  	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
-@@ -61,6 +62,8 @@
+@@ -69,6 +70,8 @@
  	{ MODKEY,                       XK_b,      togglebar,      {0} },
  	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
  	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },

configh_shifttags.patch

 # HG changeset patch
-# Parent b9d5a63d611e59cca547f1f43f20b08dbaf4a07e
+# Parent 8b11d67b9b0edbdf269320bf5d086031fb9209c4
 
-diff -r b9d5a63d611e config.def.h
---- a/config.def.h	Tue Aug 07 07:29:02 2012 +0200
-+++ b/config.def.h	Tue Aug 07 07:29:28 2012 +0200
-@@ -63,6 +63,7 @@
- #include "maximize.c"
+diff -r 8b11d67b9b0e config.def.h
+--- a/config.def.h	Thu Apr 04 21:05:54 2013 +0200
++++ b/config.def.h	Thu Apr 04 21:05:56 2013 +0200
+@@ -64,6 +64,7 @@
+ #include "zoomswap.c"
  #include "push.c"
  #include "focusmaster.c"
 +#include "shifttags.c"
  static Key keys[] = {
  	/* modifier                     key        function        argument */
  	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
-@@ -128,6 +129,8 @@
+@@ -130,6 +131,8 @@
  	{ MODKEY|ShiftMask,             XK_s,      moveresize,     {.v = "0x 0y 0w 10h" } },
  	{ MODKEY|ShiftMask,             XK_w,      moveresize,     {.v = "0x 0y 0w -10h" } },
  	{ MODKEY|ControlMask,           XK_Return, focusmaster,    {0} },

configh_zoomswap.patch

+# HG changeset patch
+# Parent 6d2da43e7b8a81af13086a26b63b9b008288d5ef
+
+diff -r 6d2da43e7b8a config.def.h
+--- a/config.def.h	Wed Apr 03 22:06:12 2013 +0200
++++ b/config.def.h	Wed Apr 03 22:06:37 2013 +0200
+@@ -61,6 +61,7 @@
+ #include "moveresize.c"
+ #include "tagall.c"
+ #include "maximize.c"
++#include "zoomswap.c"
+ static Key keys[] = {
+ 	/* modifier                     key        function        argument */
+ 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
 URL: http://dwm.suckless.org/patches/pertag
 This patch keeps layout, mwfact, barpos and nmaster per tag.
 
-diff -r 3f87908f9481 dwm.c
---- a/dwm.c	Mon Dec 19 16:09:07 2011 +0100
-+++ b/dwm.c	Sat Feb 11 13:59:10 2012 +0100
-@@ -124,6 +124,7 @@
+diff -r 313839d8bc0f dwm.c
+--- a/dwm.c	Wed Apr 03 22:18:28 2013 +0200
++++ b/dwm.c	Thu Apr 04 21:01:56 2013 +0200
+@@ -126,6 +126,7 @@
  	void (*arrange)(Monitor *);
  } Layout;
  
  struct Monitor {
  	char ltsymbol[16];
  	float mfact;
-@@ -143,6 +144,7 @@
+@@ -145,6 +146,7 @@
  	Monitor *next;
  	Window barwin;
  	const Layout *lt[2];
  };
  
  typedef struct {
-@@ -287,6 +289,15 @@
+@@ -258,7 +260,6 @@
+ 
+ /* variables */
+ static Client *prevclient = NULL;
+-static Client *prevzoom = NULL;
+ static const char broken[] = "broken";
+ static char stext[256];
+ static int screen;
+@@ -294,6 +295,16 @@
  /* configuration, allows nested code to access above variables */
  #include "config.h"
  
 +	unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
 +	const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes  */
 +	Bool showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
++	Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
 +};
 +
  /* compile-time check if all tags fit into an unsigned int bit array. */
  struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
  
-@@ -646,6 +657,7 @@
+@@ -655,6 +666,7 @@
  Monitor *
  createmon(void) {
  	Monitor *m;
  
  	if(!(m = (Monitor *)calloc(1, sizeof(Monitor))))
  		die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));
-@@ -657,6 +669,24 @@
+@@ -666,6 +678,27 @@
  	m->lt[0] = &layouts[0];
  	m->lt[1] = &layouts[1 % LENGTH(layouts)];
  	strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
 +
 +		/* init showbar */
 +		m->pertag->showbars[i] = m->showbar;
++
++		/* swap focus and zoomswap*/
++		m->pertag->prevzooms[i] = NULL;
 +	}
  	return m;
  }
  
-@@ -1028,7 +1058,7 @@
+@@ -1043,7 +1076,7 @@
  
  void
  incnmaster(const Arg *arg) {
  	arrange(selmon);
  }
  
-@@ -1555,10 +1585,13 @@
+@@ -1591,10 +1624,13 @@
  
  void
  setlayout(const Arg *arg) {
  	strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
  	if(selmon->sel)
  		arrange(selmon);
-@@ -1576,7 +1609,7 @@
+@@ -1612,7 +1648,7 @@
  	f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
  	if(f < 0.1 || f > 0.9)
  		return;
  	arrange(selmon);
  }
  
-@@ -1729,7 +1762,7 @@
+@@ -1777,7 +1813,7 @@
  
  void
  togglebar(const Arg *arg) {
  	updatebarpos(selmon);
  	XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
  	arrange(selmon);
-@@ -1763,9 +1796,29 @@
+@@ -1825,9 +1861,29 @@
  void
  toggleview(const Arg *arg) {
  	unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
  		focus(NULL);
  		arrange(selmon);
  	}
-@@ -2043,11 +2096,33 @@
+@@ -2126,11 +2182,33 @@
  
  void
  view(const Arg *arg) {
  	focus(NULL);
  	arrange(selmon);
  }
+@@ -2206,11 +2284,11 @@
+ 	|| (selmon->sel && selmon->sel->isfloating))
+ 		return;
+ 	if(c == nexttiled(selmon->clients)) {
+-		at = findbefore(prevzoom);
++		at = findbefore(selmon->pertag->prevzooms[selmon->pertag->curtag]);
+ 		if(at)
+ 			cprevious = nexttiled(at->next);
+-		if(!cprevious || cprevious != prevzoom) {
+-			prevzoom = NULL;
++		if(!cprevious || cprevious != selmon->pertag->prevzooms[selmon->pertag->curtag]) {
++			selmon->pertag->prevzooms[selmon->pertag->curtag] = NULL;
+ 			if(!c || !(c = prevclient = nexttiled(c->next)))
+ 				return;
+ 		} else
+@@ -2223,7 +2301,7 @@
+ 	attach(c);
+ 	/* swap windows instead of pushing the previous one down */
+ 	if(c != cold && at) {
+-		prevzoom = cold;
++		selmon->pertag->prevzooms[selmon->pertag->curtag] = cold;
+ 		if(cold && at != cold) {
+ 			detach(cold);
+ 			cold->next = at->next;
 maximize_vert_horz.patch
 float_border_color2.patch
 configh_float_border_color2.patch #+personal_configh
+configh_swapfocus.patch #+personal_configh
+swapfocus.patch
+zoomswap.patch
+configh_zoomswap.patch
 pertag.patch
 single_window_no_border.patch
 attachabove.patch
 configh_push.patch #+personal_configh
 push.patch
 statusallmons.patch
-configh_swapfocus.patch #+personal_configh
-swapfocus.patch
-zoomswap.patch
 configh_focusmaster.patch #+personal_configh
 focusmaster.patch
 configh_shifttags.patch #+personal_configh

single_tagset_all.patch

 
 Please be aware that this patch probably breaks any other patch!
 
-diff -r 004645a03fb9 dwm.c
---- a/dwm.c	Sun Aug 05 20:41:01 2012 +0200
-+++ b/dwm.c	Sun Aug 05 20:42:13 2012 +0200
+diff -r b8eb21aa35cd dwm.c
+--- a/dwm.c	Thu Apr 04 21:02:40 2013 +0200
++++ b/dwm.c	Thu Apr 04 21:05:30 2013 +0200
 @@ -46,7 +46,7 @@
  #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)) \
  
  /* configuration, allows nested code to access above variables */
  #include "config.h"
-@@ -331,7 +338,7 @@
+@@ -332,7 +339,7 @@
  		{
  			c->isfloating = r->isfloating;
  			c->tags |= r->tags;
  			if(m)
  				c->mon = m;
  		}
-@@ -412,9 +419,9 @@
+@@ -413,9 +420,9 @@
  void
  arrange(Monitor *m) {
  	if(m)
  	if(m) {
  		arrangemon(m);
  		restack(m);
-@@ -431,27 +438,60 @@
+@@ -432,27 +439,60 @@
  
  void
  attach(Client *c) {
  }
  
  void
-@@ -514,8 +554,8 @@
+@@ -515,8 +555,8 @@
  	view(&a);
  	selmon->lt[selmon->sellt] = &foo;
  	for(m = mons; m; m = m->next)
  	if(dc.font.set)
  		XFreeFontSet(dpy, dc.font.set);
  	else
-@@ -573,7 +613,7 @@
+@@ -574,7 +614,7 @@
  			              || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
  	}
  	else if(cme->message_type == netatom[NetActiveWindow]) {
  			c->mon->seltags ^= 1;
  			c->mon->tagset[c->mon->seltags] = c->tags;
  		}
-@@ -657,7 +697,7 @@
+@@ -658,7 +698,7 @@
  				c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */
  			if((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))
  				configure(c);
  				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
  		}
  		else
-@@ -678,12 +718,18 @@
+@@ -679,12 +719,18 @@
  
  Monitor *
  createmon(void) {
  	m->mfact = mfact;
  	m->nmaster = nmaster;
  	m->showbar = showbar;
-@@ -725,7 +771,7 @@
+@@ -729,7 +775,7 @@
  detach(Client *c) {
  	Client **tc;
  
  	*tc = c->next;
  }
  
-@@ -733,11 +779,11 @@
+@@ -737,11 +783,11 @@
  detachstack(Client *c) {
  	Client **tc, *t;
  
  		c->mon->sel = t;
  	}
  }
-@@ -774,7 +820,7 @@
+@@ -778,7 +824,7 @@
  	unsigned long *col;
  	Client *c;
  
  		occ |= c->tags;
  		if(c->isurgent)
  			urg |= c->tags;
-@@ -890,8 +936,8 @@
+@@ -894,8 +940,8 @@
  
  void
  focus(Client *c) {
  	/* was if(selmon->sel) */
  	if(selmon->sel && selmon->sel != c)
  		unfocus(selmon->sel, False);
-@@ -946,17 +992,17 @@
+@@ -950,17 +996,17 @@
  	if(!selmon->sel)
  		return;
  	if(arg->i > 0) {
  					c = i;
  	}
  	if(c) {
-@@ -1258,12 +1304,12 @@
+@@ -1262,12 +1308,12 @@
  	unsigned int n = 0, r = 0;
  	Client *c;
  
  		/* remove border when in monocle layout */
  		if(c->bw) {
  			c->oldbw = c->bw;
-@@ -1350,8 +1396,8 @@
+@@ -1354,8 +1400,8 @@
  }
  
  Client *
  	return c;
  }
  
-@@ -1503,8 +1549,8 @@
+@@ -1509,8 +1555,8 @@
  	if(m->lt[m->sellt]->arrange) {
  		wc.stack_mode = Below;
  		wc.sibling = m->barwin;
  				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
  				wc.sibling = c->win;
  			}
-@@ -1554,11 +1600,9 @@
+@@ -1560,11 +1606,9 @@
  	if(c->mon == m)
  		return;
  	unfocus(c, True);
  	attachstack(c);
  	focus(NULL);
  	arrange(NULL);
-@@ -1679,6 +1723,8 @@
+@@ -1685,6 +1729,8 @@
  	sw = DisplayWidth(dpy, screen);
  	sh = DisplayHeight(dpy, screen);
  	bh = dc.h = dc.font.height + 2;
  	updategeom();
  	/* init atoms */
  	wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
-@@ -1731,7 +1777,7 @@
+@@ -1737,7 +1783,7 @@
  showhide(Client *c) {
  	if(!c)
  		return;
  		XMoveWindow(dpy, c->win, c->x, c->y);
  		if((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
  			resize(c, c->x, c->y, c->w, c->h, False);
-@@ -1766,14 +1812,29 @@
+@@ -1772,14 +1818,29 @@
  void
  swapfocus(){
  	Client *c;
  		selmon->sel->tags = arg->ui & TAGMASK;
  		focus(NULL);
  		arrange(selmon);
-@@ -1803,7 +1864,7 @@
+@@ -1809,7 +1870,7 @@
  	unsigned int i, n, h, mw, my, ty, r;
  	Client *c;
  
  	if(n == 0)
  		return;
  
-@@ -1811,7 +1872,7 @@
+@@ -1817,7 +1878,7 @@
  		mw = m->nmaster ? m->ww * m->mfact : 0;
  	else
  		mw = m->ww;
  		if(n == 1) {
  			if (c->bw) {
  				/* remove border when only one window is on the current tag */
-@@ -1884,12 +1945,17 @@
+@@ -1890,12 +1951,17 @@
  
  void
  toggletag(const Arg *arg) {
  		selmon->sel->tags = newtags;
  		focus(NULL);
  		arrange(selmon);
-@@ -1898,10 +1964,15 @@
+@@ -1904,10 +1970,15 @@
  
  void
  toggleview(const Arg *arg) {
  		if(newtagset == ~0) {
  			selmon->pertag->prevtag = selmon->pertag->curtag;
  			selmon->pertag->curtag = 0;
-@@ -1920,6 +1991,7 @@
+@@ -1926,6 +1997,7 @@
  		selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
  		selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
  		selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
  		if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
  			togglebar(NULL);
  		focus(NULL);
-@@ -2020,7 +2092,7 @@
+@@ -2026,7 +2098,7 @@
  
  	XDeleteProperty(dpy, root, netatom[NetClientList]);
  	for(m = mons; m; m = m->next)
  			XChangeProperty(dpy, root, netatom[NetClientList],
  			                XA_WINDOW, 32, PropModeAppend,
  			                (unsigned char *) &(c->win), 1);
-@@ -2050,8 +2122,10 @@
+@@ -2056,8 +2128,10 @@
  		if(n <= nn) {
  			for(i = 0; i < (nn - n); i++) { /* new monitors available */
  				for(m = mons; m && m->next; m = m->next);
  				else
  					mons = createmon();
  			}
-@@ -2072,17 +2146,13 @@
+@@ -2078,17 +2152,13 @@
  		else { /* less monitors available nn < n */
  			for(i = nn; i < n; i++) {
  				for(m = mons; m && m->next; m = m->next);
  				cleanupmon(m);
  			}
  		}
-@@ -2222,11 +2292,30 @@
+@@ -2228,11 +2298,30 @@
  
  void
  view(const Arg *arg) {
  	selmon->seltags ^= 1; /* toggle sel tagset */
  	if(arg->ui & TAGMASK) {
  		selmon->pertag->prevtag = selmon->pertag->curtag;
-@@ -2247,6 +2336,7 @@
+@@ -2253,6 +2342,7 @@
  	selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
  	selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
  	selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
  	if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
  		togglebar(NULL);
  	focus(NULL);
-@@ -2259,7 +2349,7 @@
+@@ -2265,7 +2355,7 @@
  	Monitor *m;
  
  	for(m = mons; m; m = m->next)
  			if(c->win == w)
  				return c;
  	return NULL;
-@@ -2317,23 +2407,23 @@
+@@ -2323,24 +2413,24 @@
  void
  zoom(const Arg *arg) {
  	Client *c = selmon->sel;
--	prevclient = selmon->clients;
-+	prevclient = selmon->cl->clients;
- 	Client *at, *tmp;
+-	prevclient = nexttiled(selmon->clients);
++	prevclient = nexttiled(selmon->cl->clients, selmon);
+ 	Client *at = NULL, *cold, *cprevious = NULL;
  
  	if(!selmon->lt[selmon->sellt]->arrange
  	|| (selmon->sel && selmon->sel->isfloating))
  		return;
 -	if(c == nexttiled(selmon->clients)) {
--		for(tmp = selmon->clients; tmp && tmp != prevzoom; tmp = tmp->next) ;
 +	if(c == nexttiled(selmon->cl->clients, selmon)) {
-+		for(tmp = selmon->cl->clients; tmp && tmp != prevzoom; tmp = tmp->next) ;
- 		if(tmp != prevzoom)
- 			prevzoom = NULL;
--		if(!c || !(c = nexttiled(prevzoom))) {
-+		if(!c || !(c = nexttiled(prevzoom, selmon))) {
- 			c = selmon->sel;
--			if(!c || !(c = nexttiled(c->next)))
-+			if(!c || !(c = nexttiled(c->next, selmon)))
+ 		at = findbefore(selmon->pertag->prevzooms[selmon->pertag->curtag]);
+ 		if(at)
+-			cprevious = nexttiled(at->next);
++			cprevious = nexttiled(at->next, selmon);
+ 		if(!cprevious || cprevious != selmon->pertag->prevzooms[selmon->pertag->curtag]) {
+ 			selmon->pertag->prevzooms[selmon->pertag->curtag] = NULL;
+-			if(!c || !(c = prevclient = nexttiled(c->next)))
++			if(!c || !(c = prevclient = nexttiled(c->next, selmon)))
  				return;
- 		}
+ 		} else
+ 			c = cprevious;
  	}
--	for(at = selmon->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next)) ;
-+	for(at = selmon->cl->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next, selmon)) ;
- 	pop(c);
- 	/* swap windows instead of pushing the previous one down */
- 	if(at && at != c) {
-diff -r 004645a03fb9 focusmaster.c
---- a/focusmaster.c	Sun Aug 05 20:41:01 2012 +0200
-+++ b/focusmaster.c	Sun Aug 05 20:42:13 2012 +0200
+-	cold = nexttiled(selmon->clients);
++	cold = nexttiled(selmon->cl->clients, selmon);
+ 	if(c != cold && !at)
+ 		at = findbefore(c);
+ 	detach(c);
+diff -r b8eb21aa35cd focusmaster.c
+--- a/focusmaster.c	Thu Apr 04 21:02:40 2013 +0200
++++ b/focusmaster.c	Thu Apr 04 21:05:30 2013 +0200
 @@ -1,4 +1,4 @@
  static void
  focusmaster(const Arg *arg) {
 -	focus(nexttiled(selmon->clients));
 +	focus(nexttiled(selmon->cl->clients, selmon));
  }
-diff -r 004645a03fb9 push.c
---- a/push.c	Sun Aug 05 20:41:01 2012 +0200
-+++ b/push.c	Sun Aug 05 20:42:13 2012 +0200
+diff -r b8eb21aa35cd push.c
+--- a/push.c	Thu Apr 04 21:02:40 2013 +0200
++++ b/push.c	Thu Apr 04 21:05:30 2013 +0200
 @@ -2,8 +2,8 @@
  prevtiled(Client *c) {
  	Client *p, *r;
  		/* attach after c */
  		detach(sel);
  		sel->next = c->next;
-diff -r 004645a03fb9 tagall.c
---- a/tagall.c	Sun Aug 05 20:41:01 2012 +0200
-+++ b/tagall.c	Sun Aug 05 20:42:13 2012 +0200
+diff -r b8eb21aa35cd tagall.c
+--- a/tagall.c	Thu Apr 04 21:02:40 2013 +0200
++++ b/tagall.c	Thu Apr 04 21:05:30 2013 +0200
 @@ -1,6 +1,6 @@
  void
  tagall(const Arg *arg) {
  		{
  			if(!floating_only || c->isfloating)
  				for(j = 0; j < LENGTH(tags); j++)
+diff -r b8eb21aa35cd zoomswap.c
+--- a/zoomswap.c	Thu Apr 04 21:02:40 2013 +0200
++++ b/zoomswap.c	Thu Apr 04 21:05:30 2013 +0200
+@@ -3,8 +3,8 @@
+ Client *
+ findbefore(Client *c) {
+ 	Client *tmp;
+-	if(c == selmon->clients)
++	if(c == selmon->cl->clients)
+ 		return NULL;
+-	for(tmp = selmon->clients; tmp && tmp->next != c; tmp = tmp->next) ;
++	for(tmp = selmon->cl->clients; tmp && tmp->next != c; tmp = tmp->next) ;
+ 	return tmp;
+ }
 instead of having to think if you should use alt-j or alt-k for reaching the
 last used window.
 
-diff -r f306d51682fb dwm.c
---- a/dwm.c	Wed Apr 04 21:47:32 2012 +0200
-+++ b/dwm.c	Wed Apr 04 21:56:45 2012 +0200
-@@ -228,6 +228,7 @@
+diff -r d5d00b06c12a dwm.c
+--- a/dwm.c	Mon Apr 01 13:59:29 2013 +0200
++++ b/dwm.c	Wed Apr 03 22:13:29 2013 +0200
+@@ -226,6 +226,7 @@
  static void showhide(Client *c);
  static void sigchld(int unused);
  static void spawn(const Arg *arg);
  static void tag(const Arg *arg);
  static void tagmon(const Arg *arg);
  static int textnw(const char *text, unsigned int len);
-@@ -258,6 +259,7 @@
+@@ -256,6 +257,7 @@
  static void zoom(const Arg *arg);
  
  /* variables */
  static const char broken[] = "broken";
  static char stext[256];
  static int screen;
-@@ -1760,6 +1762,14 @@
+@@ -1712,6 +1714,14 @@
  }
  
  void
  tag(const Arg *arg) {
  	if(selmon->sel && arg->ui & TAGMASK) {
  		selmon->sel->tags = arg->ui & TAGMASK;
-@@ -1919,6 +1929,7 @@
+@@ -1826,6 +1836,7 @@
  unfocus(Client *c, Bool setfocus) {
  	if(!c)
  		return;
  	grabbuttons(c, False);
  	if(c->isfloating)
  		XSetWindowBorder(dpy, c->win, dc.norm[ColBorderFloat]);
-@@ -2304,6 +2315,7 @@
+@@ -2187,12 +2198,13 @@
  void
  zoom(const Arg *arg) {
  	Client *c = selmon->sel;
-+	prevclient = selmon->clients;
++	prevclient = nexttiled(selmon->clients);
  
  	if(!selmon->lt[selmon->sellt]->arrange
  	|| (selmon->sel && selmon->sel->isfloating))
+ 		return;
+ 	if(c == nexttiled(selmon->clients))
+-		if(!c || !(c = nexttiled(c->next)))
++		if(!c || !(c = prevclient = nexttiled(c->next)))
+ 			return;
+ 	pop(c);
+ }
 URL: http://dwm.suckless.org/patches/systray
 Implements a system tray for dwm.
 
-diff -r 538dcda1e97f config.def.h
---- a/config.def.h	Sun Oct 14 15:51:34 2012 +0200
-+++ b/config.def.h	Fri Mar 29 18:26:32 2013 +0100
+diff -r b8a8d6ffb375 config.def.h
+--- a/config.def.h	Thu Apr 04 21:05:59 2013 +0200
++++ b/config.def.h	Thu Apr 04 21:06:02 2013 +0200
 @@ -12,6 +12,8 @@
  static const char floatselbordercolor[]  = "#ff0000";
  static const unsigned int borderpx  = 1;        /* border pixel of windows */
  static const Bool showbar           = True;     /* False means no bar */
  static const Bool topbar            = True;     /* False means bottom bar */
  
-diff -r 538dcda1e97f dwm.c
---- a/dwm.c	Sun Oct 14 15:51:34 2012 +0200
-+++ b/dwm.c	Fri Mar 29 18:26:32 2013 +0100
+diff -r b8a8d6ffb375 dwm.c
+--- a/dwm.c	Thu Apr 04 21:05:59 2013 +0200
++++ b/dwm.c	Thu Apr 04 21:06:02 2013 +0200
 @@ -56,12 +56,30 @@
  #define TAGMASK                 ((1 << LENGTH(tags)) - 1)
  #define TEXTW(X)                (textnw(X, strlen(X)) + dc.font.height)
 +static Systray *systray = NULL;
 +static unsigned long systrayorientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ;
  static Client *prevclient = NULL;
- static Client *prevzoom = NULL;
  static const char broken[] = "broken";
-@@ -289,9 +324,10 @@
+ static char stext[256];
+@@ -288,9 +323,10 @@
  	[MapRequest] = maprequest,
  	[MotionNotify] = motionnotify,
  	[PropertyNotify] = propertynotify,
  			focus(NULL);
  			arrange(NULL);
  		}
-@@ -766,6 +847,11 @@
+@@ -769,6 +850,11 @@
  
  	if((c = wintoclient(ev->window)))
  		unmanage(c, True);
  }
  
  void
-@@ -821,6 +907,7 @@
+@@ -824,6 +910,7 @@
  	unsigned long *col;
  	Client *c;
  
  	for(c = m->cl->clients; c; c = c->next) {
  		occ |= c->tags;
  		if(c->isurgent)
-@@ -841,6 +928,9 @@
+@@ -844,6 +931,9 @@
  	x = dc.x;
  	dc.w = TEXTW(stext);
  	dc.x = m->ww - dc.w;
  	if(dc.x < x) {
  		dc.x = x;
  		dc.w = m->ww - x;
-@@ -866,6 +956,7 @@
+@@ -869,6 +959,7 @@
  
  	for(m = mons; m; m = m->next)
  		drawbar(m);
  }
  
  void
-@@ -931,8 +1022,11 @@
+@@ -934,8 +1025,11 @@
  	Monitor *m;
  	XExposeEvent *ev = &e->xexpose;
  
  }
  
  void
-@@ -1018,10 +1112,17 @@
+@@ -1021,10 +1115,17 @@
  	unsigned long dl;
  	unsigned char *p = NULL;
  	Atom da, atom = None;
  		XFree(p);
  	}
  	return atom;
-@@ -1063,6 +1164,15 @@
+@@ -1066,6 +1167,15 @@
  	return result;
  }
  
  Bool
  gettextprop(Window w, Atom atom, char *text, unsigned int size) {
  	char **list = NULL;
-@@ -1197,7 +1307,7 @@
+@@ -1200,7 +1310,7 @@
  killclient(const Arg *arg) {
  	if(!selmon->sel)
  		return;
  		XGrabServer(dpy);
  		XSetErrorHandler(xerrordummy);
  		XSetCloseDownMode(dpy, DestroyAll);
-@@ -1291,6 +1401,12 @@
+@@ -1294,6 +1404,12 @@
  maprequest(XEvent *e) {
  	static XWindowAttributes wa;
  	XMapRequestEvent *ev = &e->xmaprequest;
  
  	if(!XGetWindowAttributes(dpy, ev->window, &wa))
  		return;
-@@ -1416,6 +1532,16 @@
+@@ -1419,6 +1535,16 @@
  	Window trans;
  	XPropertyEvent *ev = &e->xproperty;
  
  	if((ev->window == root) && (ev->atom == XA_WM_NAME))
  		updatestatus();
  	else if(ev->state == PropertyDelete)
-@@ -1467,12 +1593,33 @@
+@@ -1470,12 +1596,33 @@
  }
  
  void
  resizeclient(Client *c, int x, int y, int w, int h) {
  	XWindowChanges wc;
  
-@@ -1539,6 +1686,18 @@
+@@ -1542,6 +1689,18 @@
  }
  
  void
  restack(Monitor *m) {
  	Client *c;
  	XEvent ev;
-@@ -1620,25 +1779,35 @@
+@@ -1623,25 +1782,35 @@
  }
  
  Bool
  	}
  	return exists;
  }
-@@ -1651,7 +1820,7 @@
+@@ -1654,7 +1823,7 @@
   		                XA_WINDOW, 32, PropModeReplace,
   		                (unsigned char *) &(c->win), 1);
  	}
  }
  
  void
-@@ -1736,12 +1905,18 @@
+@@ -1739,12 +1908,18 @@
  	wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
  	netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
  	netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
  	/* init cursors */
  	cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
  	cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
-@@ -1760,6 +1935,8 @@
+@@ -1763,6 +1938,8 @@
  	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
  	if(!dc.font.set)
  		XSetFont(dpy, dc.gc, dc.font.xfont->fid);
  	/* init bars */
  	updatebars();
  	updatestatus();
-@@ -1911,7 +2088,18 @@
+@@ -1914,7 +2091,18 @@
  togglebar(const Arg *arg) {
  	selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar;
  	updatebarpos(selmon);
  	arrange(selmon);
  }
  
-@@ -2054,11 +2242,18 @@
+@@ -2057,11 +2245,18 @@
  		else
  			unmanage(c, False);
  	}
  	XSetWindowAttributes wa = {
  		.override_redirect = True,
  		.background_pixmap = ParentRelative,
-@@ -2067,10 +2262,15 @@
+@@ -2070,10 +2265,15 @@
  	for(m = mons; m; m = m->next) {
  		if (m->barwin)
  			continue;
  		XMapRaised(dpy, m->barwin);
  	}
  }
-@@ -2264,6 +2464,109 @@
+@@ -2267,6 +2467,109 @@
  }
  
  void
  updatewindowtype(Client *c) {
  	Atom state = getatomprop(c, netatom[NetWMState]);
  	Atom wtype = getatomprop(c, netatom[NetWMWindowType]);
-@@ -2374,6 +2677,16 @@
+@@ -2377,6 +2680,16 @@
  	return selmon;
  }
  
 URL: http://dwm.suckless.org/patches/zoomswap
 This patch swaps the current window with the previous master when zooming.
 
-diff -r 1fffcdf75b68 dwm.c
---- a/dwm.c	Wed Apr 04 21:57:05 2012 +0200
-+++ b/dwm.c	Wed Apr 04 22:02:55 2012 +0200
-@@ -260,6 +260,7 @@
+diff -r 1324f1af688b dwm.c
+--- a/dwm.c	Wed Apr 03 22:13:29 2013 +0200
++++ b/dwm.c	Wed Apr 03 22:18:26 2013 +0200
+@@ -258,6 +258,7 @@
  
  /* variables */
  static Client *prevclient = NULL;
  static const char broken[] = "broken";
  static char stext[256];
  static int screen;
-@@ -2316,14 +2317,36 @@
+@@ -2199,14 +2200,38 @@
  zoom(const Arg *arg) {
  	Client *c = selmon->sel;
- 	prevclient = selmon->clients;
-+	Client *at, *tmp;
+ 	prevclient = nexttiled(selmon->clients);
++	Client *at = NULL, *cold, *cprevious = NULL;
  
  	if(!selmon->lt[selmon->sellt]->arrange
  	|| (selmon->sel && selmon->sel->isfloating))
  		return;
 -	if(c == nexttiled(selmon->clients))
--		if(!c || !(c = nexttiled(c->next)))
+-		if(!c || !(c = prevclient = nexttiled(c->next)))
 -			return;
+-	pop(c);
 +	if(c == nexttiled(selmon->clients)) {
-+		for(tmp = selmon->clients; tmp && tmp != prevzoom; tmp = tmp->next) ;
-+		if(tmp != prevzoom)
++		at = findbefore(prevzoom);
++		if(at)
++			cprevious = nexttiled(at->next);
++		if(!cprevious || cprevious != prevzoom) {
 +			prevzoom = NULL;
-+		if(!c || !(c = nexttiled(prevzoom))) {
-+			c = selmon->sel;
-+			if(!c || !(c = nexttiled(c->next)))
++			if(!c || !(c = prevclient = nexttiled(c->next)))
 +				return;
++		} else
++			c = cprevious;
++	}
++	cold = nexttiled(selmon->clients);
++	if(c != cold && !at)
++		at = findbefore(c);
++	detach(c);
++	attach(c);
++	/* swap windows instead of pushing the previous one down */
++	if(c != cold && at) {
++		prevzoom = cold;
++		if(cold && at != cold) {
++			detach(cold);
++			cold->next = at->next;
++			at->next = cold;
 +		}
 +	}
-+	for(at = selmon->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next)) ;
- 	pop(c);
-+	/* swap windows instead of pushing the previous one down */
-+	if(at && at != c) {
-+		/* store c's next neighbor - this window needs to be moved away */
-+		tmp = prevzoom = c->next;
-+		if(c->next != at) {
-+			/* detach c's neighbor from the list of windows */
-+			c->next = tmp->next;
-+			/* attach tmp after c's previous neighbor */
-+			tmp->next = at->next;
-+			at->next = tmp;
-+			arrange(c->mon);
-+		}
-+	}
++	focus(c);
++	arrange(c->mon);
  }
  
  int
+diff -r 1324f1af688b zoomswap.c
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/zoomswap.c	Wed Apr 03 22:18:26 2013 +0200
+@@ -0,0 +1,10 @@
++static Client * findbefore(Client *c);
++
++Client *
++findbefore(Client *c) {
++	Client *tmp;
++	if(c == selmon->clients)
++		return NULL;
++	for(tmp = selmon->clients; tmp && tmp->next != c; tmp = tmp->next) ;
++	return tmp;
++}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.