File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,12 @@ type Window struct {
108
108
}
109
109
110
110
type eventSummary struct {
111
- wakeup bool
112
- cfg * ConfigEvent
113
- view * ViewEvent
114
- frame * frameEvent
115
- destroy * DestroyEvent
111
+ wakeup bool
112
+ cfg * ConfigEvent
113
+ view * ViewEvent
114
+ frame * frameEvent
115
+ framePending bool
116
+ destroy * DestroyEvent
116
117
}
117
118
118
119
type callbacks struct {
@@ -219,6 +220,7 @@ func (w *Window) frame(frame *op.Ops, viewport image.Point) error {
219
220
}
220
221
221
222
func (w * Window ) processFrame (frame * op.Ops , ack chan <- struct {}) {
223
+ w .coalesced .framePending = false
222
224
wrapper := & w .decorations .Ops
223
225
off := op .Offset (w .lastFrame .off ).Push (wrapper )
224
226
ops .AddCall (& wrapper .Internal , & frame .Internal , ops.PC {}, ops .PCFor (& frame .Internal ))
@@ -567,6 +569,10 @@ func (w *Window) nextEvent() (event.Event, bool) {
567
569
w .mayInvalidate = (w .mayInvalidate || mayInvalidate ) && w .driver != nil
568
570
}()
569
571
switch {
572
+ case s .framePending :
573
+ // If the user didn't call FrameEvent.Event, process
574
+ // an empty frame.
575
+ w .processFrame (new (op.Ops ), nil )
570
576
case s .view != nil :
571
577
e := * s .view
572
578
s .view = nil
@@ -583,6 +589,7 @@ func (w *Window) nextEvent() (event.Event, bool) {
583
589
case s .frame != nil :
584
590
e := * s .frame
585
591
s .frame = nil
592
+ s .framePending = true
586
593
return e .FrameEvent , true
587
594
case s .wakeup :
588
595
return wakeupEvent {}, true
You can’t perform that action at this time.
0 commit comments