diff options
author | Robin Jarry <robin@jarry.cc> | 2023-04-27 00:14:05 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-04-27 10:28:46 +0200 |
commit | 9a20640ff6e315dc43c247e295d1325f08ee3ca0 (patch) | |
tree | 876e5a13ab215e3fdcd91401bce98fbd4fdb62cb /widgets/pgpinfo.go | |
parent | c65f7dca01872ce17491ffb3240993d3b60e1e96 (diff) | |
download | aerc-9a20640ff6e315dc43c247e295d1325f08ee3ca0.tar.gz |
ui: avoid races with queue redraw
When calling ui.QueueRedraw() and a redraw is currently in progress, the
redraw int value still holds REDRAW_PENDING since it is updated once the
redraw is finished. This can lead to incomplete screen redraws on the
embedded terminal.
Even changing the redraw value before starting to redraw is exposed to
races. Use a single atomic int to represent the state of the UI so that
there cannot be any confusion.
Rename the constants to make them less confusing.
Fixes: b148b94cfe1f ("ui: avoid duplicate queued redraws")
Reported-by: Jason Cox <dev@jasoncarloscox.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Jason Cox <dev@jasoncarloscox.com>
Diffstat (limited to 'widgets/pgpinfo.go')
0 files changed, 0 insertions, 0 deletions