From 7a82e86827e3d863a6dc4f1d50985f287d1ff86b Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 8 Dec 2008 16:19:51 +0000 Subject: Make window options work the same was as session options, add mode-fg/mode-bg options, force -g for global on set/show/setw/showw/ --- resize.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'resize.c') 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 @@ -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) -- cgit