diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-12-03 08:01:22 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-12-03 08:01:22 +0000 |
commit | e288ea153ceffe42d88975fc23196c5dc3aeae5d (patch) | |
tree | ed5d52c1ce96d8c2b029dc21708d6bc6935970c0 /server-client.c | |
parent | 4724702d4eef9e9d7c1bfa39e85b8aeed37a0d12 (diff) | |
parent | fd451aa7962f399250fd166f207451fcf4b9cb94 (diff) | |
download | rtmux-e288ea153ceffe42d88975fc23196c5dc3aeae5d.tar.gz rtmux-e288ea153ceffe42d88975fc23196c5dc3aeae5d.tar.bz2 rtmux-e288ea153ceffe42d88975fc23196c5dc3aeae5d.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/server-client.c b/server-client.c index 66d0d577..451fe2eb 100644 --- a/server-client.c +++ b/server-client.c @@ -40,6 +40,7 @@ static void server_client_repeat_timer(int, short, void *); static void server_client_click_timer(int, short, void *); static void server_client_check_exit(struct client *); static void server_client_check_redraw(struct client *); +static void server_client_check_modes(struct client *); static void server_client_set_title(struct client *); static void server_client_reset_state(struct client *); static int server_client_assume_paste(struct session *); @@ -1353,6 +1354,7 @@ server_client_loop(void) TAILQ_FOREACH(c, &clients, entry) { server_client_check_exit(c); if (c->session != NULL) { + server_client_check_modes(c); server_client_check_redraw(c); server_client_reset_state(c); } @@ -1808,6 +1810,28 @@ server_client_redraw_timer(__unused int fd, __unused short events, log_debug("redraw timer fired"); } +/* + * Check if modes need to be updated. Only modes in the current window are + * updated and it is done when the status line is redrawn. + */ +static void +server_client_check_modes(struct client *c) +{ + struct window *w = c->session->curw->window; + struct window_pane *wp; + struct window_mode_entry *wme; + + if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED)) + return; + if (~c->flags & CLIENT_REDRAWSTATUS) + return; + TAILQ_FOREACH(wp, &w->panes, entry) { + wme = TAILQ_FIRST(&wp->modes); + if (wme != NULL && wme->mode->update != NULL) + wme->mode->update(wme); + } +} + /* Check for client redraws. */ static void server_client_check_redraw(struct client *c) |