forked from joejulian/gio
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user