mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
app: [macOS] implement custom event dispatching
To get rid of app.Main, we need to control the main thread. The macOS [NSApp run] must be called on the main goroutine and never yields control. Implement the escape hatch which is calling [NSApp stop] to force [NSApp run] to return and allow us to fetch and dispatch events one at a time. This change is separate from the larger change removing app.Main to ease bisecting. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -396,5 +396,12 @@ func gio_runMain() {
|
||||
runMain()
|
||||
}
|
||||
|
||||
func (w *window) wakeup() {
|
||||
runOnMain(func() {
|
||||
w.loop.Wakeup()
|
||||
w.loop.FlushEvents()
|
||||
})
|
||||
}
|
||||
|
||||
func (UIKitViewEvent) implementsViewEvent() {}
|
||||
func (UIKitViewEvent) ImplementsEvent() {}
|
||||
|
||||
Reference in New Issue
Block a user