forked from joejulian/gio
app{,/internal/window}: make app.Main blocking on desktop platforms
This CL implements the app.Main function as a blocking-forever function for JS, Wayland, Windows and X11. This works better for applications that can now programmatically close windows.
This commit is contained in:
committed by
Elias Naur
parent
facf5cbb9d
commit
6a9a870462
@@ -36,8 +36,6 @@ type window struct {
|
||||
animating bool
|
||||
}
|
||||
|
||||
var mainDone = make(chan struct{})
|
||||
|
||||
func NewWindow(win Callbacks, opts *Options) error {
|
||||
doc := js.Global().Get("document")
|
||||
cont := getContainer(doc)
|
||||
@@ -70,7 +68,6 @@ func NewWindow(win Callbacks, opts *Options) error {
|
||||
w.draw(true)
|
||||
select {}
|
||||
w.cleanup()
|
||||
close(mainDone)
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
@@ -449,7 +446,7 @@ func (w *window) config() (int, int, float32, unit.Metric) {
|
||||
}
|
||||
|
||||
func Main() {
|
||||
<-mainDone
|
||||
select {}
|
||||
}
|
||||
|
||||
func translateKey(k string) (string, bool) {
|
||||
|
||||
Reference in New Issue
Block a user