aerc/lib/ui
Tim Culverhouse 049c72393a invalidatable: always mark ui as dirty OnInvalidate
The Invalidatable struct is designed so that a widget can have a
callback function ran when it is Invalidated. This is used to cascade up
the widget tree, marking things as Invalid along the way so that only
Invalid widgets are drawn. However, this is only implemented at the grid
cell level for checks if the cell is invalidated -- and the grid cells
are never set back to a "valid" state. The effect of this is that no
matter what is invalidated, the entire UI gets drawn again.

The calling through the Invalidate callbacks creates *several* race
conditions, as Invalidate is called from several different goroutines,
and many widgets call invalidate on their parent or children.

Tcell has optimizations to only rerender screen cells that have changed
their rune and style. The only performance penalty by redrawing the
entire screen for aerc is the operations *within the aerc draw methods*.
Most of these are not expensive and have relatively no impact on
performance.

Skip all of the OnInvalidates, and directly invalidate the UI when
DoInvalidate is called by a widget. This reduces data races, and
simplifies the widget redraw logic signficantly.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-10-07 10:51:53 +02:00
..
borders.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
context.go ui: avoid panic when terminal window is shrunk 2022-09-26 17:32:00 +02:00
fill.go view,compose: use border color to separate headers from body 2021-10-28 16:38:23 +02:00
grid.go grid: protect calls to cell.Content 2022-09-20 21:07:42 +02:00
interfaces.go events: introduce AercMsg and QueueRedraw 2022-10-07 10:51:53 +02:00
invalidatable.go invalidatable: always mark ui as dirty OnInvalidate 2022-10-07 10:51:53 +02:00
popover.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
stack.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
tab.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
text.go update tcell to v2 and enable TrueColor support 2020-12-18 07:23:22 +01:00
textinput.go aerc: use single event loop 2022-10-07 10:51:53 +02:00
ui.go invalidatable: always mark ui as dirty OnInvalidate 2022-10-07 10:51:53 +02:00