From 7582b835bcd02d36e827f5fd119c466364d719ec Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 21 Jul 2019 12:43:42 +0200 Subject: [PATCH] ui/app: make window event queue buffered Input events are asynchronous, so add buffered to the event queue so that a slow client does not stall the native window. Signed-off-by: Elias Naur --- ui/app/window.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/app/window.go b/ui/app/window.go index 69d2b8b0..bac4fa12 100644 --- a/ui/app/window.go +++ b/ui/app/window.go @@ -88,8 +88,9 @@ func NewWindow(opts *WindowOptions) *Window { } w := &Window{ - in: make(chan Event), - out: make(chan Event), + in: make(chan Event), + // Make room for buffered input events. + out: make(chan Event, 100), ack: make(chan struct{}), invalidates: make(chan struct{}, 1), frames: make(chan *ui.Ops),