mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Fix redraw defer code in the presence of multiple clients - the timer
may be needed for all of them, so don't delete it on the first; and don't skip setting the redraw flag if the timer is already running. Reported by Pol Van Aubel in GitHub issue 1003.
This commit is contained in:
parent
8b84fc177c
commit
2678fe53f5
14
proc.c
14
proc.c
@ -255,13 +255,13 @@ proc_clear_signals(struct tmuxproc *tp)
|
|||||||
sigaction(SIGPIPE, &sa, NULL);
|
sigaction(SIGPIPE, &sa, NULL);
|
||||||
sigaction(SIGTSTP, &sa, NULL);
|
sigaction(SIGTSTP, &sa, NULL);
|
||||||
|
|
||||||
event_del(&tp->ev_sighup);
|
signal_del(&tp->ev_sighup);
|
||||||
event_del(&tp->ev_sigchld);
|
signal_del(&tp->ev_sigchld);
|
||||||
event_del(&tp->ev_sigcont);
|
signal_del(&tp->ev_sigcont);
|
||||||
event_del(&tp->ev_sigterm);
|
signal_del(&tp->ev_sigterm);
|
||||||
event_del(&tp->ev_sigusr1);
|
signal_del(&tp->ev_sigusr1);
|
||||||
event_del(&tp->ev_sigusr2);
|
signal_del(&tp->ev_sigusr2);
|
||||||
event_del(&tp->ev_sigwinch);
|
signal_del(&tp->ev_sigwinch);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tmuxpeer *
|
struct tmuxpeer *
|
||||||
|
@ -1321,28 +1321,23 @@ server_client_check_redraw(struct client *c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (needed) {
|
if (needed && (left = EVBUFFER_LENGTH(tty->out)) != 0) {
|
||||||
left = EVBUFFER_LENGTH(tty->out);
|
log_debug("%s: redraw deferred (%zu left)", c->name, left);
|
||||||
if (left != 0) {
|
if (!evtimer_initialized(&ev))
|
||||||
log_debug("%s: redraw deferred (%zu left)", c->name, left);
|
|
||||||
if (evtimer_initialized(&ev) && evtimer_pending(&ev, NULL))
|
|
||||||
return;
|
|
||||||
log_debug("redraw timer started");
|
|
||||||
evtimer_set(&ev, server_client_redraw_timer, NULL);
|
evtimer_set(&ev, server_client_redraw_timer, NULL);
|
||||||
|
if (!evtimer_pending(&ev, NULL)) {
|
||||||
|
log_debug("redraw timer started");
|
||||||
evtimer_add(&ev, &tv);
|
evtimer_add(&ev, &tv);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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_REDRAW;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (evtimer_initialized(&ev))
|
|
||||||
evtimer_del(&ev);
|
/*
|
||||||
|
* 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_REDRAW;
|
||||||
|
return;
|
||||||
|
} else if (needed)
|
||||||
log_debug("%s: redraw needed", c->name);
|
log_debug("%s: redraw needed", c->name);
|
||||||
}
|
|
||||||
|
|
||||||
if (c->flags & (CLIENT_REDRAW|CLIENT_STATUS)) {
|
if (c->flags & (CLIENT_REDRAW|CLIENT_STATUS)) {
|
||||||
if (options_get_number(s->options, "set-titles"))
|
if (options_get_number(s->options, "set-titles"))
|
||||||
|
Loading…
Reference in New Issue
Block a user