5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 02:31:58 +08:00

[v2] Windows do not apply WindowStartState on reloads

This commit is contained in:
stffabi 2021-11-24 13:30:27 +01:00
parent 6a3a822640
commit 2e15f22621

View File

@ -43,6 +43,8 @@ type Frontend struct {
bindings *binding.Bindings
dispatcher frontend.Dispatcher
servingFromDisk bool
hasStarted bool
}
func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.Logger, appBindings *binding.Bindings, dispatcher frontend.Dispatcher) *Frontend {
@ -452,6 +454,11 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC
f.ExecJS("window.wails.flags.enableResize = true;")
}
if f.hasStarted {
return
}
f.hasStarted = true
// Hack to make it visible: https://github.com/MicrosoftEdge/WebView2Feedback/issues/1077#issuecomment-825375026
err := f.chromium.Hide()
if err != nil {