mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 22:13:36 +08:00
ensure webkit/gtk callbacks run on main thread (#1320)
prevent close event being propagated when handled in app closes #1268 closes #1288
This commit is contained in:
parent
b94db409dd
commit
c3a98b058e
@ -17,6 +17,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"text/template"
|
"text/template"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
@ -49,6 +50,10 @@ type Frontend struct {
|
|||||||
servingFromDisk bool
|
servingFromDisk bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
runtime.LockOSThread()
|
||||||
|
}
|
||||||
|
|
||||||
func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.Logger, appBindings *binding.Bindings, dispatcher frontend.Dispatcher) *Frontend {
|
func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.Logger, appBindings *binding.Bindings, dispatcher frontend.Dispatcher) *Frontend {
|
||||||
|
|
||||||
// Set GDK_BACKEND=x11 to prevent warnings
|
// Set GDK_BACKEND=x11 to prevent warnings
|
||||||
|
Loading…
Reference in New Issue
Block a user