Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2020-04-20 08:01:31 +01:00
commit b1be668a3e
2 changed files with 19 additions and 10 deletions

View File

@ -1724,11 +1724,15 @@ server_client_check_redraw(struct client *c)
log_debug("redraw timer started"); log_debug("redraw timer started");
evtimer_add(&ev, &tv); evtimer_add(&ev, &tv);
} }
if (new_flags & CLIENT_REDRAWPANES) {
if (~c->flags & CLIENT_REDRAWWINDOW) {
c->redraw_panes = 0; c->redraw_panes = 0;
TAILQ_FOREACH(wp, &w->panes, entry) { TAILQ_FOREACH(wp, &w->panes, entry) {
if (wp->flags & PANE_REDRAW) if (wp->flags & PANE_REDRAW) {
log_debug("%s: pane %%%u needs redraw",
c->name, wp->id);
c->redraw_panes |= (1 << bit); c->redraw_panes |= (1 << bit);
}
if (++bit == 64) { if (++bit == 64) {
/* /*
* If more that 64 panes, give up and * If more that 64 panes, give up and
@ -1739,6 +1743,8 @@ server_client_check_redraw(struct client *c)
break; break;
} }
} }
if (c->redraw_panes != 0)
c->flags |= CLIENT_REDRAWPANES;
} }
c->flags |= new_flags; c->flags |= new_flags;
return; return;

View File

@ -299,7 +299,7 @@ window_copy_scroll_timer(__unused int fd, __unused short events, void *arg)
static struct screen * static struct screen *
window_copy_clone_screen(struct screen *src, struct screen *hint, u_int *cx, window_copy_clone_screen(struct screen *src, struct screen *hint, u_int *cx,
u_int *cy) u_int *cy, int trim)
{ {
struct screen *dst; struct screen *dst;
u_int sy; u_int sy;
@ -308,11 +308,13 @@ window_copy_clone_screen(struct screen *src, struct screen *hint, u_int *cx,
dst = xcalloc(1, sizeof *dst); dst = xcalloc(1, sizeof *dst);
sy = screen_hsize(src) + screen_size_y(src); sy = screen_hsize(src) + screen_size_y(src);
while (sy > screen_hsize(src)) { if (trim) {
gl = grid_peek_line(src->grid, sy - 1); while (sy > screen_hsize(src)) {
if (gl->cellused != 0) gl = grid_peek_line(src->grid, sy - 1);
break; if (gl->cellused != 0)
sy--; break;
sy--;
}
} }
log_debug("%s: target screen is %ux%u, source %ux%u", __func__, log_debug("%s: target screen is %ux%u, source %ux%u", __func__,
screen_size_x(src), sy, screen_size_x(hint), screen_size_x(src), sy, screen_size_x(hint),
@ -386,7 +388,8 @@ window_copy_init(struct window_mode_entry *wme,
u_int i, cx, cy; u_int i, cx, cy;
data = window_copy_common_init(wme); data = window_copy_common_init(wme);
data->backing = window_copy_clone_screen(base, &data->screen, &cx, &cy); data->backing = window_copy_clone_screen(base, &data->screen, &cx, &cy,
wme->swp != wme->wp);
if (cy < screen_hsize(data->backing)) { if (cy < screen_hsize(data->backing)) {
data->cx = cx; data->cx = cx;
@ -2042,7 +2045,7 @@ window_copy_cmd_refresh_from_pane(struct window_copy_cmd_state *cs)
screen_free(data->backing); screen_free(data->backing);
free(data->backing); free(data->backing);
data->backing = window_copy_clone_screen(&wp->base, &data->screen, NULL, data->backing = window_copy_clone_screen(&wp->base, &data->screen, NULL,
NULL); NULL, wme->swp != wme->wp);
window_copy_size_changed(wme); window_copy_size_changed(wme);
return (WINDOW_COPY_CMD_REDRAW); return (WINDOW_COPY_CMD_REDRAW);