ui/app: make DrawEvent optional

It is never a good idea not to draw in response to a DrawEvent, but
let's not hang the program if it doesn't call Window.Draw.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-21 21:58:54 +02:00
parent 4724666ba0
commit dd081c78b9
+7 -1
View File
@@ -248,7 +248,13 @@ func (w *Window) run(opts *WindowOptions) {
w.drawStart = time.Now()
w.hasNextFrame = false
w.out <- e
frame := <-w.frames
var frame *ui.Ops
// Wait for either a frame or the ack event,
// which meant that the client didn't draw.
select {
case frame = <-w.frames:
case w.out <- ackEvent:
}
if w.gpu != nil {
if e2.sync {
w.gpu.Refresh()