pertag: making prevzooms an integration hint

pull/19/head
bakkeby 4 years ago
parent 10bda6f323
commit 6c583cf72e

@ -1,4 +1,4 @@
From e293b80a74a060446c431971034ebd91834f13cb Mon Sep 17 00:00:00 2001
From 95f79d41f42188d4e4b3d714eac7031ba79b2acf Mon Sep 17 00:00:00 2001
From: bakkeby <bakkeby@gmail.com>
Date: Tue, 7 Apr 2020 12:34:15 +0200
Subject: [PATCH] pertag patch, keeps layout, mwfact, barpos and nmaster per
@ -6,11 +6,11 @@ Subject: [PATCH] pertag patch, keeps layout, mwfact, barpos and nmaster per
Refer to https://dwm.suckless.org/patches/pertag/
---
dwm.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 86 insertions(+), 7 deletions(-)
dwm.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 89 insertions(+), 7 deletions(-)
diff --git a/dwm.c b/dwm.c
index 4465af1..55f8f92 100644
index 4465af1..5254f27 100644
--- a/dwm.c
+++ b/dwm.c
@@ -111,6 +111,7 @@ typedef struct {
@ -29,7 +29,7 @@ index 4465af1..55f8f92 100644
};
typedef struct {
@@ -271,6 +273,16 @@ static Window root, wmcheckwin;
@@ -271,6 +273,18 @@ static Window root, wmcheckwin;
/* configuration, allows nested code to access above variables */
#include "config.h"
@ -40,13 +40,15 @@ index 4465af1..55f8f92 100644
+ 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 */
+ #if ZOOMSWAP_PATCH
+ Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
+ #endif // ZOOMSWAP_PATCH
+};
+
/* compile-time check if all tags fit into an unsigned int bit array. */
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
@@ -631,6 +643,7 @@ Monitor *
@@ -631,6 +645,7 @@ Monitor *
createmon(void)
{
Monitor *m;
@ -54,7 +56,7 @@ index 4465af1..55f8f92 100644
m = ecalloc(1, sizeof(Monitor));
m->tagset[0] = m->tagset[1] = 1;
@@ -641,6 +654,27 @@ createmon(void)
@@ -641,6 +656,28 @@ createmon(void)
m->lt[0] = &layouts[0];
m->lt[1] = &layouts[1 % LENGTH(layouts)];
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
@ -76,13 +78,14 @@ index 4465af1..55f8f92 100644
+ /* init showbar */
+ m->pertag->showbars[i] = m->showbar;
+
+ /* swap focus and zoomswap*/
+ #if ZOOMSWAP_PATCH
+ m->pertag->prevzooms[i] = NULL;
+ #endif // ZOOMSWAP_PATCH
+ }
return m;
}
@@ -966,7 +1000,7 @@ grabkeys(void)
@@ -966,7 +1003,7 @@ grabkeys(void)
void
incnmaster(const Arg *arg)
{
@ -91,7 +94,7 @@ index 4465af1..55f8f92 100644
arrange(selmon);
}
@@ -1500,10 +1534,13 @@ setfullscreen(Client *c, int fullscreen)
@@ -1500,10 +1537,13 @@ setfullscreen(Client *c, int fullscreen)
void
setlayout(const Arg *arg)
{
@ -108,7 +111,7 @@ index 4465af1..55f8f92 100644
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
if (selmon->sel)
arrange(selmon);
@@ -1522,7 +1559,7 @@ setmfact(const Arg *arg)
@@ -1522,7 +1562,7 @@ setmfact(const Arg *arg)
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
if (f < 0.1 || f > 0.9)
return;
@ -117,7 +120,7 @@ index 4465af1..55f8f92 100644
arrange(selmon);
}
@@ -1699,7 +1736,7 @@ tile(Monitor *m)
@@ -1699,7 +1739,7 @@ tile(Monitor *m)
void
togglebar(const Arg *arg)
{
@ -126,7 +129,7 @@ index 4465af1..55f8f92 100644
updatebarpos(selmon);
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
arrange(selmon);
@@ -1738,9 +1775,29 @@ void
@@ -1738,9 +1778,29 @@ void
toggleview(const Arg *arg)
{
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
@ -156,7 +159,7 @@ index 4465af1..55f8f92 100644
focus(NULL);
arrange(selmon);
}
@@ -2035,11 +2092,33 @@ updatewmhints(Client *c)
@@ -2035,11 +2095,33 @@ updatewmhints(Client *c)
void
view(const Arg *arg)
{

Loading…
Cancel
Save