From ee7937d0dd9201fdb78f363ddc8af950d0778f1b Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 14 Sep 2022 21:09:02 +0200 Subject: ui: cleanup internals and api Now that tcell events are handled in a goroutine, no need for a channel to buffer them. Rename ui.Tick() to ui.Render() and ui.Run() to ui.ProcessEvents() to better reflect what these functions do. Move screen.PollEvent() into ui.ProcessEvents(). Register the panic handler in ui.ProcessEvents(). Remove aerc.ui.Tick() from DecryptKeys(). What the hell was that? Signed-off-by: Robin Jarry Tested-by: Tim Culverhouse --- aerc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'aerc.go') diff --git a/aerc.go b/aerc.go index 37d9509f..e1a1345b 100644 --- a/aerc.go +++ b/aerc.go @@ -241,12 +241,12 @@ func main() { setWindowTitle() } - go ui.Run() + go ui.ProcessEvents() for !ui.ShouldExit() { for aerc.Tick() { // Continue updating our internal state } - if !ui.Tick() { + if !ui.Render() { // ~60 FPS time.Sleep(16 * time.Millisecond) } -- cgit