From 0e70fbc1262920a69c60409285795b6bb8701b09 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 29 Apr 2020 10:22:02 +0200 Subject: [PATCH] app: add note about the safe use of Window.Queue. Signed-off-by: Elias Naur --- app/window.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/window.go b/app/window.go index 9b7c0809..3c0e1702 100644 --- a/app/window.go +++ b/app/window.go @@ -107,8 +107,12 @@ func (w *Window) Events() <-chan event.Event { return w.out } -// Queue returns the Window's event queue. The queue contains -// the events received since the last frame. +// Queue returns the Window's event queue. The queue contains the events +// received since the last frame. +// +// Note: the Queue may only be used after receiving a FrameEvent and before the +// next event is received, or the FrameEvent.Frame method is called, whichever +// comes first. func (w *Window) Queue() *Queue { return &w.queue }