ui/app,apps/gophers,apps/hello: replace CreateWindow with NewWindow

Gio doesn't support multiple windows anyway, so get rid of the
app.Windows channel and use NewWindow call for the mobile platforms
as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-03-31 13:36:24 +02:00
parent cf258f707f
commit f21b5eb1df
10 changed files with 81 additions and 93 deletions
+4 -6
View File
@@ -141,30 +141,28 @@ func Main() {
<-mainDone
}
func createWindow(opts WindowOptions) error {
func createWindow(opts WindowOptions) (*Window, error) {
connMu.Lock()
defer connMu.Unlock()
if len(winMap) > 0 {
panic("multiple windows are not supported")
}
if err := waylandConnect(); err != nil {
return err
return nil, err
}
w, err := createNativeWindow(opts)
if err != nil {
conn.destroy()
return err
return nil, err
}
go func() {
windows <- w.w
w.setStage(StageVisible)
w.loop()
w.destroy()
conn.destroy()
close(windows)
close(mainDone)
}()
return nil
return w.w, nil
}
func createNativeWindow(opts WindowOptions) (*window, error) {