summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-10-19 09:22:07 +0000
committernicm <nicm@openbsd.org>2016-10-19 09:22:07 +0000
commitde5a0fddf30cf8a522f43b204f06a093c95af74c (patch)
treed8444cbcf144f19da5354c37e6b533fe8f460ada /usr.bin/tmux/server-client.c
parentLets just be safe and check M_PREPEND return values for functions that (diff)
downloadwireguard-openbsd-de5a0fddf30cf8a522f43b204f06a093c95af74c.tar.xz
wireguard-openbsd-de5a0fddf30cf8a522f43b204f06a093c95af74c.zip
Alerts are too slow, so rather than walking all sessions and windows,
add a link of winlinks to each window and a pointer to the session to each winlink. Also rewrite the alerts processing to return to the old behaviour (alert in any window sets the flag on any winlink).
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 85c2a258ae0..ed910d57a8d 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.196 2016/10/16 22:06:40 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.197 2016/10/19 09:22:07 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -853,6 +853,7 @@ server_client_loop(void)
struct client *c;
struct window *w;
struct window_pane *wp;
+ int focus;
TAILQ_FOREACH(c, &clients, entry) {
server_client_check_exit(c);
@@ -866,11 +867,13 @@ 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.
*/
+ focus = options_get_number(global_options, "focus-events");
RB_FOREACH(w, windows, &windows) {
w->flags &= ~WINDOW_REDRAW;
TAILQ_FOREACH(wp, &w->panes, entry) {
if (wp->fd != -1) {
- server_client_check_focus(wp);
+ if (focus)
+ server_client_check_focus(wp);
server_client_check_resize(wp);
}
wp->flags &= ~PANE_REDRAW;
@@ -937,10 +940,6 @@ server_client_check_focus(struct window_pane *wp)
struct client *c;
int push;
- /* Are focus events off? */
- if (!options_get_number(global_options, "focus-events"))
- return;
-
/* Do we need to push the focus state? */
push = wp->flags & PANE_FOCUSPUSH;
wp->flags &= ~PANE_FOCUSPUSH;