diff options
author | nicm <nicm> | 2020-04-17 22:16:28 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-04-17 22:16:28 +0000 |
commit | a7a9460d2790161f7bb60c4047acf32d3aa93ed9 (patch) | |
tree | 28e41a1116bfb1442a6cd405ad013564fb95d463 | |
parent | a877a5d8c96f317cb8c496f0c9afa0304be926a6 (diff) | |
download | rtmux-a7a9460d2790161f7bb60c4047acf32d3aa93ed9.tar.gz rtmux-a7a9460d2790161f7bb60c4047acf32d3aa93ed9.tar.bz2 rtmux-a7a9460d2790161f7bb60c4047acf32d3aa93ed9.zip |
Set mode properly before and after redrawing, and don't bother
calculating cursor position if it won't be used.
-rw-r--r-- | server-client.c | 8 | ||||
-rw-r--r-- | tty.c | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c index 1b27ae20..8365831f 100644 --- a/server-client.c +++ b/server-client.c @@ -1681,7 +1681,7 @@ server_client_check_redraw(struct client *c) struct session *s = c->session; struct tty *tty = &c->tty; struct window_pane *wp; - int needed, flags; + int needed, flags, mode = tty->mode; struct timeval tv = { .tv_usec = 1000 }; static struct event ev; size_t left; @@ -1732,6 +1732,7 @@ server_client_check_redraw(struct client *c) flags = tty->flags & (TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR); tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE)) | TTY_NOCURSOR; + tty_update_mode(tty, mode, NULL); if (~c->flags & CLIENT_REDRAWWINDOW) { /* @@ -1752,8 +1753,9 @@ server_client_check_redraw(struct client *c) screen_redraw_screen(c); } - tty->flags = (tty->flags & ~(TTY_FREEZE|TTY_NOCURSOR)) | flags; - tty_update_mode(tty, tty->mode, NULL); + tty->flags = (tty->flags & ~TTY_NOCURSOR) | (flags & TTY_NOCURSOR); + tty_update_mode(tty, mode, NULL); + tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR)) | flags; c->flags &= ~(CLIENT_ALLREDRAWFLAGS|CLIENT_STATUSFORCE); @@ -2151,6 +2151,9 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy) u_int thisx, thisy; int change; + if (tty->flags & TTY_BLOCK) + return; + if (cx > tty->sx - 1) cx = tty->sx - 1; |