From b26eeb5229964391e0b631114c863894f2b22f3e Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Sat, 22 Aug 2026 16:42:56 +0100 Subject: [PATCH] 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. --- window.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/window.c b/window.c index a1ef01f53..1fb7b8e86 100644 --- a/window.c +++ b/window.c @@ -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);