aboutsummaryrefslogtreecommitdiff
path: root/cmd-set-window-option.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-set-window-option.c')
-rw-r--r--cmd-set-window-option.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/cmd-set-window-option.c b/cmd-set-window-option.c
index 70fdeff6..c92deac3 100644
--- a/cmd-set-window-option.c
+++ b/cmd-set-window-option.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-set-window-option.c,v 1.6 2008-06-06 20:02:27 nicm Exp $ */
+/* $Id: cmd-set-window-option.c,v 1.7 2008-06-14 16:47:20 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -166,6 +166,34 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
}
recalculate_sizes();
+ } else if (strcmp(data->option, "force-width") == 0) {
+ if (data->value == NULL || number == -1) {
+ ctx->error(ctx, "invalid value");
+ return;
+ }
+ if (errstr != NULL) {
+ ctx->error(ctx, "force-width %s", errstr);
+ return;
+ }
+ if (number == 0)
+ wl->window->limitx = UINT_MAX;
+ else
+ wl->window->limitx = number;
+ recalculate_sizes();
+ } else if (strcmp(data->option, "force-height") == 0) {
+ if (data->value == NULL || number == -1) {
+ ctx->error(ctx, "invalid value");
+ return;
+ }
+ if (errstr != NULL) {
+ ctx->error(ctx, "force-height %s", errstr);
+ return;
+ }
+ if (number == 0)
+ wl->window->limity = UINT_MAX;
+ else
+ wl->window->limity = number;
+ recalculate_sizes();
} else {
ctx->error(ctx, "unknown option: %s", data->option);
return;