From b245ed649d2465797de9d88926e1bf5713351cef Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 14 Nov 2021 01:52:18 +0500 Subject: [PATCH] Apply nmaxmaster patch (dwm-nmaxmaster-20210124-a04bfa8.diff) with pertag fix --- README.md | 1 + config.def.h | 1 + dwm.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b72f7da..3d1472f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Applied patches * focusonclick * hide_vacant_tags * movestack +* nmaxmaster * pertag * smartborders * statusallmons diff --git a/config.def.h b/config.def.h index 9393f12..74ae820 100644 --- a/config.def.h +++ b/config.def.h @@ -4,6 +4,7 @@ static const unsigned int borderpx = 2; /* border pixel of windows */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ +static const int nmaxmaster = 3; /* maximum number of clients allowed in master area */ static const char *fonts[] = { "monospace:size=10" }; static const char dmenufont[] = "monospace:size=10"; static const char col_gray1[] = "#222222"; diff --git a/dwm.c b/dwm.c index 14a24ee..1065f76 100644 --- a/dwm.c +++ b/dwm.c @@ -1180,7 +1180,7 @@ grabkeys(void) void incnmaster(const Arg *arg) { - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MIN(MAX(selmon->nmaster + arg->i, 0), nmaxmaster); arrange(selmon); }