summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-11-26 20:23:58 +0100
committerbakkeby <[email protected]>2019-11-26 20:23:58 +0100
commitab2c5fe5dace1007ec8423655319a706f881baae (patch)
treef2fcab902de636fe545f732c95b70ecd0f93bff3
parent7d107ce8eb60f74acd3159b9efc0fbb500503694 (diff)
downloaddwm-flexipatch-ab2c5fe5dace1007ec8423655319a706f881baae.tar.gz
dwm-flexipatch-ab2c5fe5dace1007ec8423655319a706f881baae.zip
Adding switchtag improvements
-rw-r--r--README.md2
-rw-r--r--dwm.c12
-rw-r--r--patches.h3
3 files changed, 16 insertions, 1 deletions
diff --git a/README.md b/README.md
index e46fa04..7e2bc03 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
-2019-11-26 - Added dmenumatchtop patch
+2019-11-26 - Added dmenumatchtop patch, added improvements to the switchtag patch based on ideas from the switchtotag patch
2019-11-21 - Added fakefullscreenclient patch
diff --git a/dwm.c b/dwm.c
index 468f5dc..d1fe9bb 100644
--- a/dwm.c
+++ b/dwm.c
@@ -149,6 +149,9 @@ struct Client {
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int bw, oldbw;
unsigned int tags;
+ #if SWITCHTAG_PATCH
+ unsigned int switchtag;
+ #endif // SWITCHTAG_PATCH
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
#if FAKEFULLSCREEN_CLIENT_PATCH
int fakefullscreen;
@@ -526,9 +529,14 @@ applyrules(Client *c)
newtagset = c->tags;
if (newtagset) {
+ c->switchtag = selmon->tagset[selmon->seltags];
c->mon->tagset[c->mon->seltags] = newtagset;
if (r->switchtag == 1)
+ #if PERTAG_PATCH
pertagview(&((Arg) { .ui = newtagset }));
+ #else
+ view(&((Arg) { .ui = newtagset }));
+ #endif // PERTAG_PATCH
arrange(c->mon);
}
}
@@ -3316,6 +3324,10 @@ unmanage(Client *c, int destroyed)
focus(NULL);
updateclientlist();
arrange(m);
+ #if SWITCHTAG_PATCH
+ if (c->switchtag)
+ view(&((Arg) { .ui = c->switchtag }));
+ #endif // SWITCHTAG_PATCH
}
void
diff --git a/patches.h b/patches.h
index 734832e..fdf770e 100644
--- a/patches.h
+++ b/patches.h
@@ -439,7 +439,10 @@
* 1 automatically moves you to the tag of the newly opened application and
* 2 enables the tag of the newly opened application in addition to your existing enabled tags
*
+ * Closing that window reverts the view back to what it was before the window was opened.
+ *
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-switchtag-6.2.diff
+ * Also see https://dwm.suckless.org/patches/switchtotag
*/
#define SWITCHTAG_PATCH 0