ui/app,apps/gophers,apps/hello: revert NewWindow to CreateWindow

It turns out we already support multiple windows on Android: when
the activity is recreated.

This reverts commit f21b5eb1df.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-04-02 19:26:23 +02:00
parent 6899f96532
commit ed2590e30e
9 changed files with 90 additions and 80 deletions
+4 -6
View File
@@ -36,7 +36,6 @@ type Window struct {
mu sync.Mutex
stage Stage
size image.Point
skipAcks int
syncGPU bool
animating bool
hasNextFrame bool
@@ -208,9 +207,11 @@ func (w *Window) event(e Event) {
case key.Event:
needRedraw = true
case ChangeStage:
needAck = true
w.stage = e.Stage
w.syncGPU = true
if w.stage > StageDead {
needAck = true
w.syncGPU = true
}
case Draw:
if e.Size == (image.Point{}) {
panic(errors.New("internal error: zero-sized Draw"))
@@ -223,9 +224,6 @@ func (w *Window) event(e Event) {
w.syncGPU = e.sync
w.size = e.Size
}
if !needAck {
w.skipAcks++
}
stage := w.stage
w.mu.Unlock()
if needRedraw {