diff --git a/v2/internal/frontend/desktop/windows/frontend.go b/v2/internal/frontend/desktop/windows/frontend.go index 2fc64cd51..58ab60df2 100644 --- a/v2/internal/frontend/desktop/windows/frontend.go +++ b/v2/internal/frontend/desktop/windows/frontend.go @@ -181,7 +181,7 @@ func (f *Frontend) WindowUnfullscreen() { func (f *Frontend) WindowShow() { runtime.LockOSThread() - f.mainWindow.Show() + f.ShowWindow() } func (f *Frontend) WindowHide() { @@ -518,20 +518,31 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC } else { f.mainWindow.Show() } + f.ShowWindow() + case options.Minimised: f.mainWindow.Minimise() case options.Fullscreen: f.mainWindow.Fullscreen() - f.mainWindow.Show() + f.ShowWindow() default: if f.frontendOptions.Fullscreen { f.mainWindow.Fullscreen() } - f.mainWindow.Show() + f.ShowWindow() } } +func (f *Frontend) ShowWindow() { + f.mainWindow.Invoke(func() { + f.mainWindow.Restore() + w32.SetForegroundWindow(f.mainWindow.Handle()) + w32.SetFocus(f.mainWindow.Handle()) + }) + +} + func (f *Frontend) onFocus(arg *winc.Event) { f.chromium.Focus() }