From 4ef76f0a95fc1aba7d92fd1a84308286280856e7 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Wed, 15 Feb 2023 18:38:19 +0100 Subject: aerc: show effects of mailto: and mbox: immediately When handling a mailto-Link or opening an mbox file, another update is required before the composer is shown. This is caused by the view not being invalidated and no redraw being queued. Invalidate the UI and queue a redraw when an IPC command is received. Fixes: 7a489cb0011a ("Add Unix socket for communicating with aerc") Signed-off-by: Moritz Poldrack Acked-by: Robin Jarry --- widgets/aerc.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'widgets') diff --git a/widgets/aerc.go b/widgets/aerc.go index 8eec8823..b946b158 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -733,6 +733,9 @@ func (aerc *Aerc) Mailto(addr *url.URL) error { return errors.New("No account selected") } + defer ui.Invalidate() + defer ui.QueueRedraw() + composer, err := NewComposer(aerc, acct, acct.AccountConfig(), acct.Worker(), "", h, nil) if err != nil { @@ -773,6 +776,9 @@ func (aerc *Aerc) Mbox(source string) error { acctConf.Postpone = "Drafts" acctConf.CopyTo = "Sent" + defer ui.Invalidate() + defer ui.QueueRedraw() + mboxView, err := NewAccountView(aerc, &acctConf, aerc, nil) if err != nil { aerc.NewTab(errorScreen(err.Error()), acctConf.Name) -- cgit