From faba4112894fbb9bb35796fe67d4b0075e30fe4e Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Sat, 22 Aug 2026 13:51:03 +0100 Subject: [PATCH] layout: only mark scrollbar for redraw when the pane actually changed wp->flags |= PANE_REDRAWSCROLLBAR was set unconditionally whenever a pane reserved a scrollbar, even if layout_fix_panes() left its geometry completely unchanged - forcing a needless scrollbar redraw on every layout pass. Move it inside the existing "did this pane's geometry actually change" check. --- layout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layout.c b/layout.c index b8ba1c2ef..552a3880a 100644 --- a/layout.c +++ b/layout.c @@ -492,7 +492,6 @@ layout_fix_panes(struct window *w, struct window_pane *skip) sx = PANE_MINIMUM; else sx = sx - sb_w - sb_pad; - wp->flags |= PANE_REDRAWSCROLLBAR; } window_pane_resize(wp, sx, sy); @@ -500,8 +499,11 @@ layout_fix_panes(struct window *w, struct window_pane *skip) if (wp->xoff != old_xoff || wp->yoff != old_yoff || wp->sx != old_sx || - wp->sy != old_sy) + wp->sy != old_sy) { changed = 1; + if (window_pane_scrollbar_reserve(wp)) + wp->flags |= PANE_REDRAWSCROLLBAR; + } } if (changed) redraw_invalidate_scene(w);