diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-22 19:59:59 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-22 19:59:59 +0200 |
| commit | f9c400ab2eb68211c5f98ee3159eba84892fd7be (patch) | |
| tree | 6ca23ed3a26f1af64454f1b13fa36ae27bbe508e | |
| parent | 4736c56064b894db19220dd60b4c01b0277824c4 (diff) | |
set minimum window size - do not allow a bigger or smaller master size
| -rw-r--r-- | config.def.h | 1 | ||||
| -rw-r--r-- | config.h | 1 | ||||
| -rw-r--r-- | monsterwm.c | 4 |
3 files changed, 5 insertions, 1 deletions
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[] = { \ @@ -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(); } |
