diff options
author | 2019-11-01 20:26:21 +0000 | |
---|---|---|
committer | 2019-11-01 20:26:21 +0000 | |
commit | d069abbed478f14455797f3d6eedddace13a5d82 (patch) | |
tree | 2a62d240af871e436462c150c084d444505568e1 /usr.bin/tmux/server-client.c | |
parent | In evp/pmeth_lib.c rev. 1.16, jsing@ enabled EVP_PKEY_RSA_PSS. (diff) | |
download | wireguard-openbsd-d069abbed478f14455797f3d6eedddace13a5d82.tar.xz wireguard-openbsd-d069abbed478f14455797f3d6eedddace13a5d82.zip |
Limit lazy resize to panes in attached sessions only - those in
unattached are likely to have been resized by something like
split-window where the user probably wants the resize to happen
immediately. GitHub issue 1963.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 2fdde1da8bc..f93d17a66dd 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.295 2019/09/19 09:02:30 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.296 2019/11/01 20:26:21 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1268,7 +1268,7 @@ server_client_loop(void) struct window_pane *wp; struct winlink *wl; struct session *s; - int focus; + int focus, attached, resize; TAILQ_FOREACH(c, &clients, entry) { server_client_check_exit(c); @@ -1281,19 +1281,33 @@ server_client_loop(void) /* * Any windows will have been redrawn as part of clients, so clear * their flags now. Also check pane focus and resize. + * + * As an optimization, panes in windows that are in an attached session + * but not the current window are not resized (this reduces the amount + * of work needed when, for example, resizing an X terminal a + * lot). Windows in no attached session are resized immediately since + * that is likely to have come from a command like split-window and be + * what the user wanted. */ focus = options_get_number(global_options, "focus-events"); RB_FOREACH(w, windows, &windows) { + attached = resize = 0; TAILQ_FOREACH(wl, &w->winlinks, wentry) { s = wl->session; - if (s->attached != 0 && s->curw == wl) + if (s->attached != 0) + attached = 1; + if (s->attached != 0 && s->curw == wl) { + resize = 1; break; + } } + if (!attached) + resize = 1; TAILQ_FOREACH(wp, &w->panes, entry) { if (wp->fd != -1) { if (focus) server_client_check_focus(wp); - if (wl != NULL) + if (resize) server_client_check_resize(wp); } wp->flags &= ~PANE_REDRAW; |