mirror of
https://github.com/tmux/tmux.git
synced 2026-06-20 17:25:57 +00:00
When entering or leaving the alternate screen, discard any pending
resizes. Improves flicking with scrollbars and programs that leave and enter the alternate screen on every WINCH like nano. GitHub issue 4772. Cvs: ----------------------------------------------------------------------
This commit is contained in:
@@ -2765,16 +2765,22 @@ void
|
||||
screen_write_alternateon(struct screen_write_ctx *ctx, struct grid_cell *gc,
|
||||
int cursor)
|
||||
{
|
||||
struct tty_ctx ttyctx;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct tty_ctx ttyctx;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane_resize *r, *r1;
|
||||
|
||||
if (wp != NULL && !options_get_number(wp->options, "alternate-screen"))
|
||||
return;
|
||||
|
||||
screen_write_collect_flush(ctx, 0, __func__);
|
||||
screen_alternate_on(ctx->s, gc, cursor);
|
||||
if (!screen_alternate_on(ctx->s, gc, cursor))
|
||||
return;
|
||||
|
||||
if (wp != NULL) {
|
||||
TAILQ_FOREACH_SAFE (r, &wp->resize_queue, entry, r1) {
|
||||
TAILQ_REMOVE(&wp->resize_queue, r, entry);
|
||||
free(r);
|
||||
}
|
||||
layout_fix_panes(wp->window, NULL);
|
||||
server_redraw_window_borders(wp->window);
|
||||
}
|
||||
@@ -2796,7 +2802,8 @@ screen_write_alternateoff(struct screen_write_ctx *ctx, struct grid_cell *gc,
|
||||
return;
|
||||
|
||||
screen_write_collect_flush(ctx, 0, __func__);
|
||||
screen_alternate_off(ctx->s, gc, cursor);
|
||||
if (!screen_alternate_off(ctx->s, gc, cursor))
|
||||
return;
|
||||
|
||||
if (wp != NULL) {
|
||||
layout_fix_panes(wp->window, NULL);
|
||||
|
||||
Reference in New Issue
Block a user