mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user