summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-10-06 11:46:42 -0500
committerRobin Jarry <robin@jarry.cc>2022-10-07 10:51:53 +0200
commit725fe07d240b035205e48fba3af3de6dc0ddc9d2 (patch)
treed0ffd09567c7e0ec875346c4313cf7b45d68ec1f
parentbb1249164d8de6d821dcf3293f5ff2650be95481 (diff)
downloadaerc-725fe07d240b035205e48fba3af3de6dc0ddc9d2.tar.gz
aerc-725fe07d240b035205e48fba3af3de6dc0ddc9d2.zip
render: clean up render code
The render method sets everything as invalid if there was a popover. This is no longer necessary, as everything is redrawn anyways. Remove the check and extra atomic set of dirty and invalidate. Remove unused return value Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--lib/ui/ui.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index e29ab13c..42d584f8 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -79,16 +79,9 @@ func (state *UI) Close() {
state.screen.Fini()
}
-func (state *UI) Render() bool {
- more := false
-
+func (state *UI) Render() {
wasInvalid := atomic.SwapInt32(&state.invalid, 0)
if wasInvalid != 0 {
- if state.popover != nil {
- // if the previous frame had a popover, rerender the entire display
- state.Content.Invalidate()
- atomic.StoreInt32(&state.invalid, 0)
- }
// reset popover for the next Draw
state.popover = nil
state.Content.Draw(state.ctx)
@@ -97,10 +90,7 @@ func (state *UI) Render() bool {
state.popover.Draw(state.ctx)
}
state.screen.Show()
- more = true
}
-
- return more
}
func (state *UI) EnableMouse() {