mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
app: remove ackEvent, tighten error check
ackEvent is not necessary, a nil event.Event doesn't allocate. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-7
@@ -125,9 +125,6 @@ type queue struct {
|
|||||||
q router.Router
|
q router.Router
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pre-allocate the ack event to avoid garbage.
|
|
||||||
var ackEvent event.Event
|
|
||||||
|
|
||||||
// NewWindow creates a new window for a set of window
|
// NewWindow creates a new window for a set of window
|
||||||
// options. The options are hints; the platform is free to
|
// options. The options are hints; the platform is free to
|
||||||
// ignore or adjust them.
|
// ignore or adjust them.
|
||||||
@@ -679,7 +676,7 @@ func (w *Window) waitAck(d driver) {
|
|||||||
select {
|
select {
|
||||||
case f := <-w.driverFuncs:
|
case f := <-w.driverFuncs:
|
||||||
f(d)
|
f(d)
|
||||||
case w.out <- ackEvent:
|
case w.out <- event.Event(nil):
|
||||||
// A dummy event went through, so we know the application has processed the previous event.
|
// A dummy event went through, so we know the application has processed the previous event.
|
||||||
return
|
return
|
||||||
case <-w.immediateRedraws:
|
case <-w.immediateRedraws:
|
||||||
@@ -713,7 +710,7 @@ func (w *Window) waitFrame(d driver) *op.Ops {
|
|||||||
case frame := <-w.frames:
|
case frame := <-w.frames:
|
||||||
// The client called FrameEvent.Frame.
|
// The client called FrameEvent.Frame.
|
||||||
return frame
|
return frame
|
||||||
case w.out <- ackEvent:
|
case w.out <- event.Event(nil):
|
||||||
// The client ignored FrameEvent and continued processing
|
// The client ignored FrameEvent and continued processing
|
||||||
// events.
|
// events.
|
||||||
return nil
|
return nil
|
||||||
@@ -844,8 +841,7 @@ func (w *Window) processEvent(d driver, e event.Event) bool {
|
|||||||
off.Pop()
|
off.Pop()
|
||||||
}
|
}
|
||||||
deco.Add(wrapper)
|
deco.Add(wrapper)
|
||||||
err := w.validateAndProcess(d, viewSize, e2.Sync, wrapper, signal)
|
if err := w.validateAndProcess(d, viewSize, e2.Sync, wrapper, signal); err != nil {
|
||||||
if err != nil {
|
|
||||||
w.destroyGPU()
|
w.destroyGPU()
|
||||||
w.out <- system.DestroyEvent{Err: err}
|
w.out <- system.DestroyEvent{Err: err}
|
||||||
close(w.dead)
|
close(w.dead)
|
||||||
|
|||||||
Reference in New Issue
Block a user