diff --git a/app/window.go b/app/window.go index 23101a03..a1727dc1 100644 --- a/app/window.go +++ b/app/window.go @@ -423,10 +423,12 @@ func (c *callbacks) Event(e event.Event) { defer func() { c.busy = false }() - for _, e := range c.waitEvents { + for len(c.waitEvents) > 0 { + e := c.waitEvents[0] + copy(c.waitEvents, c.waitEvents[1:]) + c.waitEvents = c.waitEvents[:len(c.waitEvents)-1] c.w.processEvent(c.d, e) } - c.waitEvents = c.waitEvents[:0] c.w.updateState(c.d) if c.w.closing { c.w.closing = false