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:
Sebastien Binet
2020-06-26 11:01:25 +00:00
committed by Elias Naur
parent facf5cbb9d
commit 6a9a870462
8 changed files with 8 additions and 50 deletions
-5
View File
@@ -576,12 +576,7 @@ func newX11Window(gioWin Callbacks, opts *Options) error {
// make the window visible on the screen
C.XMapWindow(dpy, win)
// Increment window counter.
windowCounter <- +1
go func() {
defer func() {
windowCounter <- -1
}()
w.w.SetDriver(w)
w.setStage(system.StageRunning)
w.loop()