From f9c400ab2eb68211c5f98ee3159eba84892fd7be Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Thu, 22 Dec 2011 19:59:59 +0200 Subject: set minimum window size - do not allow a bigger or smaller master size --- config.def.h | 1 + config.h | 1 + monsterwm.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index b90a9ef..1dd58aa 100644 --- a/config.def.h +++ b/config.def.h @@ -41,6 +41,7 @@ #define UNFOCUS "#444444" /* unfocused window border color */ #define DESKTOPS 4 /* number of desktops - edit DESKTOPCHANGE keys to suit */ #define DEFAULT_DESKTOP 0 /* the desktop to focus on exec */ +#define MINWSZ 50 /* minimum window size in pixels */ /** open applications to specified desktop **/ static const AppRule rules[] = { \ diff --git a/config.h b/config.h index 434f124..626a657 100644 --- a/config.h +++ b/config.h @@ -41,6 +41,7 @@ #define UNFOCUS "#444444" /* unfocused window border color */ #define DESKTOPS 4 /* number of desktops - edit DESKTOPCHANGE keys to suit */ #define DEFAULT_DESKTOP 0 /* the desktop to focus on exec */ +#define MINWSZ 50 /* minimum window size in pixels */ /** open applications to specified desktop **/ static const AppRule rules[] = { \ diff --git a/monsterwm.c b/monsterwm.c index f1773fb..4a1bb45 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -454,7 +454,9 @@ void removeclient(client *c) { } void resize_master(const Arg *arg) { - master_size += arg->i; + int msz = master_size + arg->i; + if((mode == BSTACK ? sh : sw) - msz <= MINWSZ || msz <= MINWSZ) return; + master_size = msz; tile(); } -- cgit v1.3.1