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
@@ -8,16 +8,8 @@ import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
// windowCounter keeps track of the number of windows.
|
||||
// A send of +1 or -1 represents a change in window count.
|
||||
var windowCounter = make(chan int)
|
||||
|
||||
func Main() {
|
||||
// Wait for first window
|
||||
count := <-windowCounter
|
||||
for count > 0 {
|
||||
count += <-windowCounter
|
||||
}
|
||||
select {}
|
||||
}
|
||||
|
||||
// instead of creating files with build tags for each combination of wayland +/- x11
|
||||
|
||||
Reference in New Issue
Block a user