diff --git a/v3/pkg/application/webview_window_windows.go b/v3/pkg/application/webview_window_windows.go index 062b840d1..36a680075 100644 --- a/v3/pkg/application/webview_window_windows.go +++ b/v3/pkg/application/webview_window_windows.go @@ -146,6 +146,9 @@ func (w *windowsWebviewWindow) setMaxSize(width, height int) { } func (w *windowsWebviewWindow) execJS(js string) { + if w.chromium == nil { + return + } globalApplication.dispatchOnMainThread(func() { w.chromium.Eval(js) }) @@ -210,6 +213,8 @@ func (w *windowsWebviewWindow) run() { panic("Unable to create window") } + w.setupChromium() + // Register the window with the application getNativeApplication().registerWindow(w) @@ -292,8 +297,6 @@ func (w *windowsWebviewWindow) run() { w.Focus() } - w.setupChromium() - if !options.Hidden { w.show() w.update() @@ -323,6 +326,7 @@ func (w *windowsWebviewWindow) size() (int, int) { rect := w32.GetWindowRect(w.hwnd) width := int(rect.Right - rect.Left) height := int(rect.Bottom - rect.Top) + // Scaling appears to give invalid results... //width, height = w.scaleToDefaultDPI(width, height) return width, height }