From eafbbab233b45e749273f269c3dbf7abd7ddc197 Mon Sep 17 00:00:00 2001 From: stffabi Date: Mon, 12 Jun 2023 05:12:49 +0200 Subject: [PATCH] [v3 windows] Do not Hide/Show chromium on every load of the frontend --- v3/pkg/application/webview_window_windows.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/v3/pkg/application/webview_window_windows.go b/v3/pkg/application/webview_window_windows.go index c174a0fd7..e885d4373 100644 --- a/v3/pkg/application/webview_window_windows.go +++ b/v3/pkg/application/webview_window_windows.go @@ -1227,11 +1227,12 @@ func (w *windowsWebviewWindow) navigationCompleted(sender *edge.ICoreWebView2, a } */ - // TODO: Work out why we need this - //if w.hasStarted { - // return - //} - //w.hasStarted = true + if w.hasStarted { + // NavigationCompleted is triggered for every Load. If an application uses reloads the Hide/Show will trigger + // a flickering of the window with every reload. So we only do this once for the first NavigationCompleted. + return + } + w.hasStarted = true // Hack to make it visible: https://github.com/MicrosoftEdge/WebView2Feedback/issues/1077#issuecomment-825375026 err := w.chromium.Hide() @@ -1244,7 +1245,6 @@ func (w *windowsWebviewWindow) navigationCompleted(sender *edge.ICoreWebView2, a err = w.chromium.Show() if err != nil { globalApplication.fatal(err.Error()) - } //f.mainWindow.hasBeenShown = true