sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit b418122eafecdaa6d913424ca519ec75a62154c4
parent 6053fcc5d5924b14e553424a8d1f2766e157ba98
Author: Aaron Duxler <aaron@duxler.xyz>
Date:   Mon, 22 Jun 2020 12:57:07 +0200

[dwm][patch] dwm-pertag-perseltag fix tag 0

Diffstat:
Mdwm.suckless.org/patches/pertag/dwm-pertag-perseltag-6.2.diff | 58++++++++++++++++++++++++++++++++++++++++------------------
Mdwm.suckless.org/patches/pertag/index.md | 2+-
2 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/dwm.suckless.org/patches/pertag/dwm-pertag-perseltag-6.2.diff b/dwm.suckless.org/patches/pertag/dwm-pertag-perseltag-6.2.diff @@ -1,6 +1,6 @@ diff -up a/dwm.c b/dwm.c ---- a/dwm.c 2020-04-17 13:37:50.926942626 +0200 -+++ b/dwm.c 2020-04-17 13:44:30.578373509 +0200 +--- a/dwm.c 2020-05-23 00:20:34.877944603 +0200 ++++ b/dwm.c 2020-06-22 12:49:55.298859682 +0200 @@ -111,6 +111,7 @@ typedef struct { void (*arrange)(Monitor *); } Layout; @@ -62,19 +62,24 @@ diff -up a/dwm.c b/dwm.c return m; } -@@ -966,7 +992,11 @@ grabkeys(void) +@@ -966,7 +992,16 @@ grabkeys(void) void incnmaster(const Arg *arg) { + unsigned int i; selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); -+ for(i=0; i<=LENGTH(tags); ++i) ++ for(i=0; i<LENGTH(tags); ++i) + if(selmon->tagset[selmon->seltags] & 1<<i) -+ selmon->pertag->nmasters[(i+1)%(LENGTH(tags)+1)] = selmon->nmaster; ++ selmon->pertag->nmasters[i+1] = selmon->nmaster; ++ ++ if(selmon->pertag->curtag == 0) ++ { ++ selmon->pertag->nmasters[0] = selmon->nmaster; ++ } arrange(selmon); } -@@ -1500,11 +1530,20 @@ setfullscreen(Client *c, int fullscreen) +@@ -1500,11 +1535,26 @@ setfullscreen(Client *c, int fullscreen) void setlayout(const Arg *arg) { @@ -85,17 +90,23 @@ diff -up a/dwm.c b/dwm.c selmon->lt[selmon->sellt] = (Layout *)arg->v; strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); + -+ for(i=0; i<=LENGTH(tags); ++i) ++ for(i=0; i<LENGTH(tags); ++i) + if(selmon->tagset[selmon->seltags] & 1<<i) + { -+ selmon->pertag->ltidxs[(i+1)%(LENGTH(tags)+1)][selmon->sellt] = selmon->lt[selmon->sellt]; -+ selmon->pertag->sellts[(i+1)%(LENGTH(tags)+1)] = selmon->sellt; ++ selmon->pertag->ltidxs[i+1][selmon->sellt] = selmon->lt[selmon->sellt]; ++ selmon->pertag->sellts[i+1] = selmon->sellt; + } ++ ++ if(selmon->pertag->curtag == 0) ++ { ++ selmon->pertag->ltidxs[0][selmon->sellt] = selmon->lt[selmon->sellt]; ++ selmon->pertag->sellts[0] = selmon->sellt; ++ } + if (selmon->sel) arrange(selmon); else -@@ -1516,13 +1555,19 @@ void +@@ -1516,13 +1566,24 @@ void setmfact(const Arg *arg) { float f; @@ -104,30 +115,41 @@ diff -up a/dwm.c b/dwm.c if (!arg || !selmon->lt[selmon->sellt]->arrange) return; f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; +- if (f < 0.1 || f > 0.9) + if (arg->f == 0.0) + f = mfact; - if (f < 0.1 || f > 0.9) ++ if (f < 0.05 || f > 0.95) return; selmon->mfact = f; -+ for(i=0; i<=LENGTH(tags); ++i) ++ for(i=0; i<LENGTH(tags); ++i) + if(selmon->tagset[selmon->seltags] & 1<<i) -+ selmon->pertag->mfacts[(i+1)%(LENGTH(tags)+1)] = f; ++ selmon->pertag->mfacts[i+1] = f; ++ ++ if(selmon->pertag->curtag == 0) ++ { ++ selmon->pertag->mfacts[0] = f; ++ } arrange(selmon); } -@@ -1699,7 +1744,11 @@ tile(Monitor *m) +@@ -1699,7 +1760,16 @@ tile(Monitor *m) void togglebar(const Arg *arg) { + unsigned int i; selmon->showbar = !selmon->showbar; -+ for(i=0; i<=LENGTH(tags); ++i) ++ for(i=0; i<LENGTH(tags); ++i) + if(selmon->tagset[selmon->seltags] & 1<<i) -+ selmon->pertag->showbars[(i+1)%(LENGTH(tags)+1)] = selmon->showbar; ++ selmon->pertag->showbars[i+1] = selmon->showbar; ++ ++ if(selmon->pertag->curtag == 0) ++ { ++ selmon->pertag->showbars[0] = selmon->showbar; ++ } updatebarpos(selmon); XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); arrange(selmon); -@@ -1738,9 +1787,33 @@ void +@@ -1738,9 +1808,33 @@ void toggleview(const Arg *arg) { unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); @@ -161,7 +183,7 @@ diff -up a/dwm.c b/dwm.c focus(NULL); arrange(selmon); } -@@ -2035,11 +2108,37 @@ updatewmhints(Client *c) +@@ -2035,11 +2129,37 @@ updatewmhints(Client *c) void view(const Arg *arg) { diff --git a/dwm.suckless.org/patches/pertag/index.md b/dwm.suckless.org/patches/pertag/index.md @@ -27,7 +27,7 @@ Download * With this version of pertag, changes are always applied to all selected tags. For exmaple: If tag 2 and tag 3 are selected, changes to barpos, layout, mfact, nmaster will apply to both tags. With the original pertag patch, changes only effect the tag which was selected first. - * [dwm-pertag-perseltag-6.2.diff](dwm-pertag-perseltag-6.2.diff) (20200418) + * [dwm-pertag-perseltag-6.2.diff](dwm-pertag-perseltag-6.2.diff) (20200622) Authors