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
This commit is contained in:
2
thumbs.c
2
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user