summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-04-18 06:15:07 +0000
committernicm <nicm@openbsd.org>2020-04-18 06:15:07 +0000
commitefeab936482a571db1ed763f0aa4117e32d53ad2 (patch)
tree53cf24cb25f05b5ad683187c470208ebfb830587
parentdrm/dp_mst: Fix clearing payload state on topology disable (diff)
downloadwireguard-openbsd-efeab936482a571db1ed763f0aa4117e32d53ad2.tar.xz
wireguard-openbsd-efeab936482a571db1ed763f0aa4117e32d53ad2.zip
Revert previous, there is still a problem.
-rw-r--r--usr.bin/tmux/screen-redraw.c15
-rw-r--r--usr.bin/tmux/server-client.c20
-rw-r--r--usr.bin/tmux/tmux.h7
-rw-r--r--usr.bin/tmux/tty.c18
4 files changed, 19 insertions, 41 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c
index 3726c29478e..4f6404d5f42 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.68 2020/04/18 06:10:15 nicm Exp $ */
+/* $OpenBSD: screen-redraw.c,v 1.69 2020/04/18 06:15:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -438,24 +438,17 @@ screen_redraw_screen(struct client *c)
tty_sync_start(&c->tty);
if (flags & (CLIENT_REDRAWWINDOW|CLIENT_REDRAWBORDERS)) {
- log_debug("%s: redrawing borders", c->name);
if (ctx.pane_status != PANE_STATUS_OFF)
screen_redraw_draw_pane_status(&ctx);
screen_redraw_draw_borders(&ctx);
}
- if (flags & CLIENT_REDRAWWINDOW) {
- log_debug("%s: redrawing panes", c->name);
+ if (flags & CLIENT_REDRAWWINDOW)
screen_redraw_draw_panes(&ctx);
- }
if (ctx.statuslines != 0 &&
- (flags & (CLIENT_REDRAWSTATUS|CLIENT_REDRAWSTATUSALWAYS))) {
- log_debug("%s: redrawing status", c->name);
+ (flags & (CLIENT_REDRAWSTATUS|CLIENT_REDRAWSTATUSALWAYS)))
screen_redraw_draw_status(&ctx);
- }
- if (c->overlay_draw != NULL && (flags & CLIENT_REDRAWOVERLAY)) {
- log_debug("%s: redrawing overlay", c->name);
+ if (c->overlay_draw != NULL && (flags & CLIENT_REDRAWOVERLAY))
c->overlay_draw(c, &ctx);
- }
tty_reset(&c->tty);
tty_sync_end(&c->tty);
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 11a1abdd0c9..c23048c69a4 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.321 2020/04/18 06:10:15 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.322 2020/04/18 06:15:07 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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, mode = tty->mode, new_flags = 0;
+ int needed, flags, mode = tty->mode;
struct timeval tv = { .tv_usec = 1000 };
static struct event ev;
size_t left;
@@ -1689,12 +1689,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%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_REDRAWOVERLAY) ? " overlay" : "",
- (c->flags & CLIENT_REDRAWPANES) ? " panes" : "");
+ (c->flags & CLIENT_REDRAWOVERLAY) ? " overlay" : "");
}
/*
@@ -1712,8 +1711,6 @@ server_client_check_redraw(struct client *c)
break;
}
}
- if (needed)
- new_flags |= CLIENT_REDRAWPANES;
}
if (needed && (left = EVBUFFER_LENGTH(tty->out)) != 0) {
log_debug("%s: redraw deferred (%zu left)", c->name, left);
@@ -1723,7 +1720,12 @@ server_client_check_redraw(struct client *c)
log_debug("redraw timer started");
evtimer_add(&ev, &tv);
}
- c->flags |= new_flags;
+
+ /*
+ * We may have got here for a single pane redraw, but force a
+ * full redraw next time in case other panes have been updated.
+ */
+ c->flags |= CLIENT_ALLREDRAWFLAGS;
return;
} else if (needed)
log_debug("%s: redraw needed", c->name);
@@ -1739,12 +1741,10 @@ server_client_check_redraw(struct client *c)
*/
TAILQ_FOREACH(wp, &c->session->curw->window->panes, entry) {
if (wp->flags & PANE_REDRAW) {
- log_debug("%s: redrawing pane %%%u", __func__, wp->id);
tty_update_mode(tty, tty->mode, NULL);
screen_redraw_pane(c, wp);
}
}
- c->flags &= ~CLIENT_REDRAWPANES;
}
if (c->flags & CLIENT_ALLREDRAWFLAGS) {
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 113397281ba..4044ece63df 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.1002 2020/04/18 06:10:15 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1003 2020/04/18 06:15:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1244,7 +1244,6 @@ struct tty {
#define TTY_BLOCK 0x80
#define TTY_HAVEDA 0x100
#define TTY_HAVEDSR 0x200
-#define TTY_SYNCING 0x400
int flags;
struct tty_term *term;
@@ -1539,14 +1538,12 @@ struct client {
#define CLIENT_CONTROL_NOOUTPUT 0x4000000
#define CLIENT_DEFAULTSOCKET 0x8000000
#define CLIENT_STARTSERVER 0x10000000
-#define CLIENT_REDRAWPANES 0x20000000
#define CLIENT_ALLREDRAWFLAGS \
(CLIENT_REDRAWWINDOW| \
CLIENT_REDRAWSTATUS| \
CLIENT_REDRAWSTATUSALWAYS| \
CLIENT_REDRAWBORDERS| \
- CLIENT_REDRAWOVERLAY| \
- CLIENT_REDRAWPANES)
+ CLIENT_REDRAWOVERLAY)
#define CLIENT_UNATTACHEDFLAGS \
(CLIENT_DEAD| \
CLIENT_SUSPENDED| \
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 34e84066c1c..adb962cfe1c 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.355 2020/04/18 06:10:15 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.356 2020/04/18 06:15:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1438,19 +1438,15 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
void
tty_sync_start(struct tty *tty)
{
- if ((~tty->flags & TTY_SYNCING) && (tty_get_flags(tty) & TERM_SYNC)) {
+ if (tty_get_flags(tty) & TERM_SYNC)
tty_puts(tty, "\033P=1s\033\\");
- tty->flags |= TTY_SYNCING;
- }
}
void
tty_sync_end(struct tty *tty)
{
- if (tty_get_flags(tty) & TERM_SYNC) {
+ if (tty_get_flags(tty) & TERM_SYNC)
tty_puts(tty, "\033P=2s\033\\");
- tty->flags &= ~TTY_SYNCING;
- }
}
static int
@@ -1484,14 +1480,6 @@ tty_write(void (*cmdfn)(struct tty *, const struct tty_ctx *),
TAILQ_FOREACH(c, &clients, entry) {
if (!tty_client_ready(c, wp))
continue;
- if (c->flags & CLIENT_REDRAWPANES) {
- /*
- * Redraw is already deferred to redraw another pane -
- * redraw this one also when that happens.
- */
- wp->flags |= PANE_REDRAW;
- break;
- }
ctx->bigger = tty_window_offset(&c->tty, &ctx->ox, &ctx->oy,
&ctx->sx, &ctx->sy);