mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 23:55:39 +00:00
ui/app: note that Window.Invalidate is safe for concurrent use
Invalidate is intended to be called as a result of external events, which might very well be from a different goroutine than the one driving the window. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -158,6 +158,7 @@ func (w *Window) draw(size image.Point, frame *ui.Ops) {
|
||||
// Invalidate the window such that a UpdateEvent will be generated
|
||||
// immediately. If the window is inactive, the event is sent when the
|
||||
// window becomes active.
|
||||
// Invalidate is safe for concurrent use.
|
||||
func (w *Window) Invalidate() {
|
||||
select {
|
||||
case w.invalidates <- struct{}{}:
|
||||
|
||||
Reference in New Issue
Block a user