mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 03:40:45 +08:00
[v2] Windows do not apply WindowStartState on reloads
This commit is contained in:
parent
6a3a822640
commit
2e15f22621
@ -43,6 +43,8 @@ type Frontend struct {
|
|||||||
bindings *binding.Bindings
|
bindings *binding.Bindings
|
||||||
dispatcher frontend.Dispatcher
|
dispatcher frontend.Dispatcher
|
||||||
servingFromDisk bool
|
servingFromDisk bool
|
||||||
|
|
||||||
|
hasStarted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
@ -452,6 +454,11 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC
|
|||||||
f.ExecJS("window.wails.flags.enableResize = true;")
|
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
|
// Hack to make it visible: https://github.com/MicrosoftEdge/WebView2Feedback/issues/1077#issuecomment-825375026
|
||||||
err := f.chromium.Hide()
|
err := f.chromium.Hide()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user