mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Add a flag to redraw only the overlay, and remove the overlay on resize.
This commit is contained in:
parent
a384245c5a
commit
f9682d2e55
@ -18,7 +18,6 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
4
tmux.h
4
tmux.h
@ -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| \
|
||||
|
Loading…
Reference in New Issue
Block a user