Merge pull request #982 from stffabi/feature/windows-startstate-only-once

[v2] windows: Do not apply WindowStartState on reloads
This commit is contained in:
Lea Anthony 2021-11-29 10:55:42 -08:00 committed by GitHub
commit 5bad81e182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 {