commit 9b14e95c80e952c160203ff7b3cf368c6f66ba9a
parent 573eb5207898d34f3df365914f0e7300aeb5ae2d
Author: Markus Teich <markus.teich@stusta.mhn.de>
Date: Sat, 30 Mar 2013 14:25:26 +0100
add emptyview patch for dwm.
This patch allows for no tag to be selected in dwm.
Diffstat:
2 files changed, 78 insertions(+), 0 deletions(-)
diff --git a/dwm.suckless.org/patches/dwm-6.0-emptyview.diff b/dwm.suckless.org/patches/dwm-6.0-emptyview.diff
@@ -0,0 +1,61 @@
+diff --git a/dwm.c b/dwm.c
+index 1d78655..a526e57 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -322,7 +322,9 @@ applyrules(Client *c) {
+ XFree(ch.res_class);
+ if(ch.res_name)
+ XFree(ch.res_name);
+- c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
++ if(c->tags & TAGMASK) c->tags = c->tags & TAGMASK;
++ else if(c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags];
++ else c->tags = 1;
+ }
+
+ Bool
+@@ -649,7 +651,7 @@ createmon(void) {
+
+ if(!(m = (Monitor *)calloc(1, sizeof(Monitor))))
+ die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));
+- m->tagset[0] = m->tagset[1] = 1;
++ m->tagset[0] = m->tagset[1] = 0;
+ m->mfact = mfact;
+ m->nmaster = nmaster;
+ m->showbar = showbar;
+@@ -1479,7 +1481,7 @@ sendmon(Client *c, Monitor *m) {
+ detach(c);
+ detachstack(c);
+ c->mon = m;
+- c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
++ c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1);
+ attach(c);
+ attachstack(c);
+ focus(NULL);
+@@ -1763,12 +1765,9 @@ toggletag(const Arg *arg) {
+ void
+ toggleview(const Arg *arg) {
+ unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
+-
+- if(newtagset) {
+- selmon->tagset[selmon->seltags] = newtagset;
+- focus(NULL);
+- arrange(selmon);
+- }
++ selmon->tagset[selmon->seltags] = newtagset;
++ focus(NULL);
++ arrange(selmon);
+ }
+
+ void
+@@ -2043,7 +2042,7 @@ updatewmhints(Client *c) {
+
+ void
+ view(const Arg *arg) {
+- if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
++ if(arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+ if(arg->ui & TAGMASK)
+--
+1.8.2
+
diff --git a/dwm.suckless.org/patches/emptyview.md b/dwm.suckless.org/patches/emptyview.md
@@ -0,0 +1,17 @@
+emptyview
+=========
+
+Description
+-----------
+I like my wallpapers. Also i found it kind of unintuitive that you can not toggle the last tag out of view. So i created a patch to allow no tag at all to be selected.
+
+With this patch, dwm will start with no tag selected. When you start a client with no tag rule and no tag selected, it gets opened in the first tag.
+
+Download
+--------
+
+ * [dwm-6.0-emptyview.diff](dwm-6.0-emptyview.diff) (1753b) (20130330)
+
+Authors
+-------
+ * Markus Teich - `<teichm at in dot tum dot de>`