diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-08 18:07:13 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-08 18:07:13 +0000 |
commit | 2cec499fb4c1a34fff1e68823e709bae8cf8405b (patch) | |
tree | a11d958d688c338eba789363be4776e1651d2548 /usr.bin/tmux | |
parent | bae7cc96081431691d54e0b15a540ffb4cae5d29 (diff) |
Add a flag to redraw only the overlay, and remove the overlay on resize.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/cmd-display-panes.c | 3 | ||||
-rw-r--r-- | usr.bin/tmux/screen-redraw.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 13 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 6 |
4 files changed, 17 insertions, 9 deletions
diff --git a/usr.bin/tmux/cmd-display-panes.c b/usr.bin/tmux/cmd-display-panes.c index fbc54be6500..f5f38855951 100644 --- a/usr.bin/tmux/cmd-display-panes.c +++ b/usr.bin/tmux/cmd-display-panes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-panes.c,v 1.24 2019/05/07 20:01:41 nicm Exp $ */ +/* $OpenBSD: cmd-display-panes.c,v 1.25 2019/05/08 18:07:12 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -18,7 +18,6 @@ #include <sys/types.h> -#include <ctype.h> #include <stdlib.h> #include <string.h> diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c index 8a8e734cc46..92226d6b6a9 100644 --- a/usr.bin/tmux/screen-redraw.c +++ b/usr.bin/tmux/screen-redraw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-redraw.c,v 1.61 2019/05/07 20:01:41 nicm Exp $ */ +/* $OpenBSD: screen-redraw.c,v 1.62 2019/05/08 18:07:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -447,7 +447,7 @@ screen_redraw_screen(struct client *c) if (ctx.statuslines != 0 && (flags & (CLIENT_REDRAWSTATUS|CLIENT_REDRAWSTATUSALWAYS))) screen_redraw_draw_status(&ctx); - if (c->overlay_draw != NULL) + if (c->overlay_draw != NULL && (flags & CLIENT_REDRAWOVERLAY)) c->overlay_draw(c, &ctx); tty_reset(&c->tty); } diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index caf9044574b..beab89bc5dd 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.281 2019/05/07 20:01:41 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.282 2019/05/08 18:07:12 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -79,6 +79,9 @@ server_client_set_overlay(struct client *c, u_int delay, overlay_draw_cb drawcb, { struct timeval tv; + if (c->overlay_draw != NULL) + server_client_clear_overlay(c); + tv.tv_sec = delay / 1000; tv.tv_usec = (delay % 1000) * 1000L; @@ -1433,6 +1436,8 @@ server_client_reset_state(struct client *c) if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED)) return; + if (c->overlay_draw != NULL) + return; mode = s->mode; tty_region_off(&c->tty); @@ -1543,10 +1548,11 @@ server_client_check_redraw(struct client *c) if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED)) return; if (c->flags & CLIENT_ALLREDRAWFLAGS) { - log_debug("%s: redraw%s%s%s", c->name, + log_debug("%s: redraw%s%s%s%s", c->name, (c->flags & CLIENT_REDRAWWINDOW) ? " window" : "", (c->flags & CLIENT_REDRAWSTATUS) ? " status" : "", - (c->flags & CLIENT_REDRAWBORDERS) ? " borders" : ""); + (c->flags & CLIENT_REDRAWBORDERS) ? " borders" : "", + (c->flags & CLIENT_REDRAWOVERLAY) ? " overlay" : ""); } /* @@ -1702,6 +1708,7 @@ server_client_dispatch(struct imsg *imsg, void *arg) if (c->flags & CLIENT_CONTROL) break; + server_client_clear_overlay(c); tty_resize(&c->tty); recalculate_sizes(); server_redraw_client(c); diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index e01874b37bf..61f36fb7720 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.890 2019/05/07 20:01:41 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.891 2019/05/08 18:07:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1458,11 +1458,13 @@ struct client { #define CLIENT_SIZECHANGED 0x400000 #define CLIENT_STATUSOFF 0x800000 #define CLIENT_REDRAWSTATUSALWAYS 0x1000000 +#define CLIENT_REDRAWOVERLAY 0x2000000 #define CLIENT_ALLREDRAWFLAGS \ (CLIENT_REDRAWWINDOW| \ CLIENT_REDRAWSTATUS| \ CLIENT_REDRAWSTATUSALWAYS| \ - CLIENT_REDRAWBORDERS) + CLIENT_REDRAWBORDERS| \ + CLIENT_REDRAWOVERLAY) #define CLIENT_NOSIZEFLAGS \ (CLIENT_DEAD| \ CLIENT_SUSPENDED| \ |