From 25233441d29ced79c1e032efadb2a2bb9745ce1e Mon Sep 17 00:00:00 2001 From: thinkbook14 Date: Wed, 22 May 2024 13:28:09 +0800 Subject: [PATCH 1/2] support windows style toolwindow --- v2/internal/frontend/desktop/windows/window.go | 6 +++++- v2/pkg/options/windows/windows.go | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/internal/frontend/desktop/windows/window.go b/v2/internal/frontend/desktop/windows/window.go index a513e875a92..b1a9fc1b55e 100644 --- a/v2/internal/frontend/desktop/windows/window.go +++ b/v2/internal/frontend/desktop/windows/window.go @@ -3,10 +3,11 @@ package windows import ( - "github.com/wailsapp/go-webview2/pkg/edge" "sync" "unsafe" + "github.com/wailsapp/go-webview2/pkg/edge" + "github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32" "github.com/wailsapp/wails/v2/internal/system/operatingsystem" @@ -63,6 +64,9 @@ func NewWindow(parent winc.Controller, appoptions *options.App, versionInfo *ope if windowsOptions.WindowIsTranslucent { exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP } + if windowsOptions.ToolWindow { + exStyle |= w32.WS_EX_TOOLWINDOW + } } if appoptions.AlwaysOnTop { exStyle |= w32.WS_EX_TOPMOST diff --git a/v2/pkg/options/windows/windows.go b/v2/pkg/options/windows/windows.go index 39b91ee8def..2e9cbb70fb5 100644 --- a/v2/pkg/options/windows/windows.go +++ b/v2/pkg/options/windows/windows.go @@ -61,6 +61,7 @@ type ThemeSettings struct { // Options are options specific to Windows type Options struct { + ToolWindow bool WebviewIsTransparent bool WindowIsTranslucent bool DisableWindowIcon bool From 0571da77d4e57987d11bcf48e4df4481fdb1e2fe Mon Sep 17 00:00:00 2001 From: thinkbook14 Date: Wed, 22 May 2024 14:17:56 +0800 Subject: [PATCH 2/2] fixbug toolwindow --- v2/internal/frontend/desktop/windows/window.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/internal/frontend/desktop/windows/window.go b/v2/internal/frontend/desktop/windows/window.go index b1a9fc1b55e..47e83cd2e5d 100644 --- a/v2/internal/frontend/desktop/windows/window.go +++ b/v2/internal/frontend/desktop/windows/window.go @@ -65,7 +65,7 @@ func NewWindow(parent winc.Controller, appoptions *options.App, versionInfo *ope exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP } if windowsOptions.ToolWindow { - exStyle |= w32.WS_EX_TOOLWINDOW + exStyle = w32.WS_EX_TOOLWINDOW | w32.WS_EX_NOREDIRECTIONBITMAP | w32.WS_EX_TOPMOST } } if appoptions.AlwaysOnTop {