summaryrefslogtreecommitdiffstats
path: root/resize.c
diff options
context:
space:
mode:
Diffstat (limited to 'resize.c')
-rw-r--r--resize.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/resize.c b/resize.c
index ca9059de..4068e471 100644
--- a/resize.c
+++ b/resize.c
@@ -1,4 +1,4 @@
-/* $Id: resize.c,v 1.16 2008-06-19 22:04:02 nicm Exp $ */
+/* $Id: resize.c,v 1.17 2008-12-08 16:19:51 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -48,7 +48,8 @@ recalculate_sizes(void)
struct session *s;
struct client *c;
struct window *w;
- u_int i, j, ssx, ssy, has;
+ u_int i, j, ssx, ssy, has, limit;
+ int flag;
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
s = ARRAY_ITEM(&sessions, i);
@@ -93,13 +94,14 @@ recalculate_sizes(void)
w = ARRAY_ITEM(&windows, i);
if (w == NULL)
continue;
+ flag = options_get_number(&w->options, "aggressive-resize");
ssx = ssy = UINT_MAX;
for (j = 0; j < ARRAY_LENGTH(&sessions); j++) {
s = ARRAY_ITEM(&sessions, j);
if (s == NULL || s->flags & SESSION_UNATTACHED)
continue;
- if (w->flags & WINDOW_AGGRESSIVE)
+ if (flag)
has = s->curw->window == w;
else
has = session_has(s, w);
@@ -116,10 +118,12 @@ recalculate_sizes(void)
}
w->flags &= ~WINDOW_HIDDEN;
- if (ssx > w->limitx)
- ssx = w->limitx;
- if (ssy > w->limity)
- ssy = w->limity;
+ limit = options_get_number(&w->options, "force-width");
+ if (limit != 0 && ssx > limit)
+ ssx = limit;
+ limit = options_get_number(&w->options, "force-height");
+ if (limit != 0 && ssy > limit)
+ ssy = limit;
if (screen_size_x(&w->base) == ssx &&
screen_size_y(&w->base) == ssy)