From a04bfa8a5add2a71939e13e36797ebacd0410e0d Mon Sep 17 00:00:00 2001 From: Georgios Oxinos Date: Sun, 24 Jan 2021 16:12:26 +0100 Subject: [PATCH] [dwm][patch] patch that adds limit to number of clients allowed in master area --- config.def.h | 1 + dwm.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 1c0b587..ef895e7 100644 --- a/config.def.h +++ b/config.def.h @@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ 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 664c527..5b61eb3 100644 --- a/dwm.c +++ b/dwm.c @@ -967,7 +967,7 @@ grabkeys(void) void incnmaster(const Arg *arg) { - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MIN(MAX(selmon->nmaster + arg->i, 0), nmaxmaster); arrange(selmon); } -- 2.27.0