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
+6 -4
View File
@@ -141,28 +141,30 @@ func Main() {
<-mainDone
}
func createWindow(opts *WindowOptions) (*Window, error) {
func createWindow(opts *WindowOptions) error {
connMu.Lock()
defer connMu.Unlock()
if len(winMap) > 0 {
panic("multiple windows are not supported")
}
if err := waylandConnect(); err != nil {
return nil, err
return err
}
w, err := createNativeWindow(opts)
if err != nil {
conn.destroy()
return nil, err
return err
}
go func() {
windows <- w.w
w.setStage(StageVisible)
w.loop()
w.destroy()
conn.destroy()
close(windows)
close(mainDone)
}()
return w.w, nil
return nil
}
func createNativeWindow(opts *WindowOptions) (*window, error) {