From 24eab0f5ef6324b00717997f671cf1d13317bd5c Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 17 Jul 2023 14:09:16 +0200 Subject: msglist: fetch headers even when not focused Do not rely on MessageList.Draw only to fetch missing headers. In Draw, report the current scroll offset and length to the message store and use them to determine if a new message UID should be candidate for fetching headers. This allows the mail-received hook to work even when the message list is not focused. Fixes: https://todo.sr.ht/~rjarry/aerc/147 Signed-off-by: Robin Jarry Tested-by: Tristan Partin --- widgets/msglist.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'widgets') diff --git a/widgets/msglist.go b/widgets/msglist.go index 8263b945..a334d0d4 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -81,6 +81,8 @@ func (ml *MessageList) Draw(ctx *ui.Context) { } } + store.UpdateScroll(ml.Scroll(), ml.height) + textWidth := ctx.Width() if ml.NeedScrollbar() { textWidth -= 1 -- cgit