aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-11-01 22:01:24 +0000
committerThomas Adam <thomas@xteddy.org>2019-11-01 22:01:24 +0000
commit4408df1e8aa1662b197117e1eee13344d4c1d63e (patch)
tree5891186af130423e8d471eebca6078a38e3d99aa
parent4fc8741794af14f142442cdfe8db70dd5747e851 (diff)
parentbad95db8785f4ee6b6e17750500c024642e83134 (diff)
downloadrtmux-4408df1e8aa1662b197117e1eee13344d4c1d63e.tar.gz
rtmux-4408df1e8aa1662b197117e1eee13344d4c1d63e.tar.bz2
rtmux-4408df1e8aa1662b197117e1eee13344d4c1d63e.zip
Merge branch 'obsd-master'
-rw-r--r--server-client.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c
index b144d9b0..cedd00a1 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1266,7 +1266,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);
@@ -1279,19 +1279,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;