summaryrefslogtreecommitdiffstats
path: root/thumbs.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-06-01 10:59:16 +0200
committerN-R-K <nrk@disroot.org>2022-06-02 10:09:51 +0200
commit810a9651a362992383081619ca63122f41f1cd0a (patch)
treebea298b12676f642a4801a5d6385a781f918a639 /thumbs.c
parent364c3d6f019a26e68f2bfb9594d6bc599a947be2 (diff)
downloadnsxiv-810a9651a362992383081619ca63122f41f1cd0a.tar.zst
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 <taaparthur@gmail.com> Partially fixes: https://github.com/nsxiv/nsxiv/issues/258
Diffstat (limited to 'thumbs.c')
-rw-r--r--thumbs.c2
1 files changed, 2 insertions, 0 deletions
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;
}