window: redraw only borders/status on active-pane change

window_set_active_pane() unconditionally called server_redraw_window(w)
on every active-pane change, redrawing every pane's content even though
only the previous and new active pane's border/status appearance
actually changed. Unzooming (which does change every pane's geometry)
still gets the full redraw; otherwise this now only redraws borders and
status.
This commit is contained in:
Michael Grant
2026-08-22 16:42:56 +01:00
parent 48cdd85886
commit b26eeb5229

View File

@@ -713,6 +713,7 @@ int
window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
{
struct window_pane *lastwp;
int was_zoomed;
log_debug("%s: pane %%%u", __func__, wp->id);
@@ -720,7 +721,8 @@ window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
return (0);
if (w->modal != NULL && wp != w->modal)
return (0);
if (w->flags & WINDOW_ZOOMED)
was_zoomed = (w->flags & WINDOW_ZOOMED) != 0;
if (was_zoomed)
window_unzoom(w, 1);
lastwp = w->active;
@@ -737,7 +739,19 @@ window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
}
tty_update_window_offset(w);
server_redraw_window(w);
/*
* Unzooming changes every pane's geometry and needs a full window
* redraw. Otherwise, only the previous and new active pane's border
* and status appearance changed, so avoid redrawing unaffected pane
* content.
*/
if (was_zoomed)
server_redraw_window(w);
else {
server_redraw_window_borders(w);
server_status_window(w);
}
if (notify)
window_fire_pane_changed(w, w->active, lastwp);