diff options
author | 2014-11-14 02:19:47 +0000 | |
---|---|---|
committer | 2014-11-14 02:19:47 +0000 | |
commit | d3ba9ba26e02a857e703ae89eae8fcb9676acd7c (patch) | |
tree | ac75b819e030f0347a4f7d9d8c92ab812a4586ab /usr.bin/tmux/resize.c | |
parent | move the slowdown back up. it needs to take place after the allocated page (diff) | |
download | wireguard-openbsd-d3ba9ba26e02a857e703ae89eae8fcb9676acd7c.tar.xz wireguard-openbsd-d3ba9ba26e02a857e703ae89eae8fcb9676acd7c.zip |
Label windows which are smaller than expected with a reason.
Diffstat (limited to 'usr.bin/tmux/resize.c')
-rw-r--r-- | usr.bin/tmux/resize.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/tmux/resize.c b/usr.bin/tmux/resize.c index 661b316f841..8a2dcf63500 100644 --- a/usr.bin/tmux/resize.c +++ b/usr.bin/tmux/resize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resize.c,v 1.13 2014/11/12 16:00:03 nicm Exp $ */ +/* $OpenBSD: resize.c,v 1.14 2014/11/14 02:19:47 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -50,7 +50,7 @@ recalculate_sizes(void) struct window *w; struct window_pane *wp; u_int i, j, ssx, ssy, has, limit; - int flag, has_status, is_zoomed; + int flag, has_status, is_zoomed, forced; RB_FOREACH(s, sessions, &sessions) { has_status = options_get_number(&s->options, "status"); @@ -116,18 +116,26 @@ recalculate_sizes(void) if (ssx == UINT_MAX || ssy == UINT_MAX) continue; + forced = 0; limit = options_get_number(&w->options, "force-width"); - if (limit >= PANE_MINIMUM && ssx > limit) + if (limit >= PANE_MINIMUM && ssx > limit) { ssx = limit; + forced |= WINDOW_FORCEWIDTH; + } limit = options_get_number(&w->options, "force-height"); - if (limit >= PANE_MINIMUM && ssy > limit) + if (limit >= PANE_MINIMUM && ssy > limit) { ssy = limit; + forced |= WINDOW_FORCEHEIGHT; + } if (w->sx == ssx && w->sy == ssy) continue; log_debug("window size %u,%u (was %u,%u)", ssx, ssy, w->sx, w->sy); + w->flags &= ~(WINDOW_FORCEWIDTH|WINDOW_FORCEHEIGHT); + w->flags |= forced; + is_zoomed = w->flags & WINDOW_ZOOMED; if (is_zoomed) window_unzoom(w); |