From 810a9651a362992383081619ca63122f41f1cd0a Mon Sep 17 00:00:00 2001 From: NRK Date: Wed, 1 Jun 2022 14:59:16 +0600 Subject: reduce calls to win-title rather than calling the script unconditionally per redraw, we now have a `title_dirty` flag and keep track of when any of the relavent information changes. Co-authored-by: Arthur Williams Partially fixes: https://github.com/nsxiv/nsxiv/issues/258 --- thumbs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'thumbs.c') diff --git a/thumbs.c b/thumbs.c index 52820d4..8ca0c58 100644 --- a/thumbs.c +++ b/thumbs.c @@ -459,6 +459,7 @@ void tns_render(tns_t *tns) } tns->dirty = false; tns_highlight(tns, *tns->sel, true); + title_dirty = true; } void tns_mark(tns_t *tns, int n, bool mark) @@ -527,6 +528,7 @@ bool tns_move_selection(tns_t *tns, direction_t dir, int cnt) tns_check_view(tns, false); if (!tns->dirty) tns_highlight(tns, *tns->sel, true); + title_dirty = true; } return *tns->sel != old; } -- cgit v1.2.3-70-g09d2