diff options
author | nicm <nicm> | 2020-05-16 15:34:08 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-05-16 15:34:08 +0000 |
commit | 9605b080f6c942ff2e51a2ba538cccc91c91c161 (patch) | |
tree | a2cb5c229410d3c8b749a1e0da2716494c08445c /server-client.c | |
parent | 379ca54c80837d09dff53ffa7b9ea3b80d87096b (diff) | |
download | rtmux-9605b080f6c942ff2e51a2ba538cccc91c91c161.tar.gz rtmux-9605b080f6c942ff2e51a2ba538cccc91c91c161.tar.bz2 rtmux-9605b080f6c942ff2e51a2ba538cccc91c91c161.zip |
Do not hoke into struct window_pane from the tty code and instead set
everything up in tty_ctx. Provide a way to initialize the tty_ctx from a
callback and use it to let popups draw directly through input_parse in
the same way as panes do, rather than forcing a full redraw on every
change.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/server-client.c b/server-client.c index b21dac1d..a45e9812 100644 --- a/server-client.c +++ b/server-client.c @@ -1542,9 +1542,9 @@ server_client_reset_state(struct client *c) struct tty *tty = &c->tty; struct window *w = c->session->curw->window; struct window_pane *wp = w->active, *loop; - struct screen *s; + struct screen *s = NULL; struct options *oo = c->session->options; - int mode, cursor, flags; + int mode = 0, cursor, flags; u_int cx = 0, cy = 0, ox, oy, sx, sy; if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED)) @@ -1556,17 +1556,14 @@ server_client_reset_state(struct client *c) /* Get mode from overlay if any, else from screen. */ if (c->overlay_draw != NULL) { - s = NULL; - if (c->overlay_mode == NULL) - mode = 0; - else - mode = c->overlay_mode(c, &cx, &cy); - } else { + if (c->overlay_mode != NULL) + s = c->overlay_mode(c, &cx, &cy); + } else s = wp->screen; + if (s != NULL) mode = s->mode; - if (c->prompt_string != NULL || c->message_string != NULL) - mode &= ~MODE_CURSOR; - } + if (c->prompt_string != NULL || c->message_string != NULL) + mode &= ~MODE_CURSOR; log_debug("%s: client %s mode %x", __func__, c->name, mode); /* Reset region and margin. */ |