From d6e6ca848aeb4ab546d1c9b250246de959bf0e6d Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 30 Sep 2021 18:19:42 +0200 Subject: [PATCH] app: don't miss driver defers Fixes gio#281 Signed-off-by: Elias Naur --- app/window.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/window.go b/app/window.go index c0180f62..9540d650 100644 --- a/app/window.go +++ b/app/window.go @@ -433,6 +433,13 @@ func (w *Window) runFuncs(d driver) { return } var defers []func(d driver) + // Don't miss deferred functions when ack arrives immediately. There is one + // wakeup event per function, so one select is enough. + select { + case f := <-w.driverDefers: + defers = append(defers, f) + default: + } // Wait for ack while running incoming runnables. for { select {