From f07e4093be1aa955a955fff5cdfd3b5bb9a51d38 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 9 Oct 2023 17:35:28 +1100 Subject: [PATCH] [windows] Don't show menu for frameless window --- v3/pkg/application/webview_window_windows.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/v3/pkg/application/webview_window_windows.go b/v3/pkg/application/webview_window_windows.go index ad4c8e20b..9ac003fc7 100644 --- a/v3/pkg/application/webview_window_windows.go +++ b/v3/pkg/application/webview_window_windows.go @@ -192,7 +192,7 @@ func (w *windowsWebviewWindow) run() { var appMenu w32.HMENU // Process Menu - if !options.Windows.DisableMenu { + if !options.Windows.DisableMenu && !options.Frameless { theMenu := globalApplication.ApplicationMenu // Create the menu if we have one if w.parent.options.Windows.Menu != nil { @@ -253,6 +253,7 @@ func (w *windowsWebviewWindow) run() { if !options.Windows.DisableIcon { // App icon ID is 3 icon, err := NewIconFromResource(w32.GetModuleHandle(""), uint16(3)) + println("icon", icon) if err == nil { w.setIcon(icon) } @@ -314,6 +315,11 @@ func (w *windowsWebviewWindow) run() { w.Focus() } + if options.Frameless { + // Trigger a resize to ensure the window is sized correctly + w.chromium.Resize() + } + if !options.Hidden { w.show() w.update() @@ -789,10 +795,6 @@ func (w *windowsWebviewWindow) getScreen() (*Screen, error) { } func (w *windowsWebviewWindow) setFrameless(b bool) { - // If the window is already frameless, don't do anything - if w.parent.options.Frameless == b { - return - } // Remove or add the frame if b { w32.SetWindowLong(w.hwnd, w32.GWL_STYLE, w32.WS_VISIBLE|w32.WS_POPUP)