From 983c3e1dfd07c7c433e5b3052ac70158818324ec Mon Sep 17 00:00:00 2001 From: chun_qiu Date: Fri, 31 Jul 2026 21:33:36 +0800 Subject: [PATCH] Fix Windows tray startup --- app.go | 7 +++---- app.manifest | 8 +++++++- build.ps1 | 4 ++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app.go b/app.go index 587891f..5be598b 100644 --- a/app.go +++ b/app.go @@ -42,14 +42,13 @@ func newApp(mw *walk.MainWindow, appDir string, cfg Config, cache *CacheIndex) ( if err != nil { return nil, err } - icon, err := walk.NewIconFromSysDLL("shell32.dll", 4) + icon, err := walk.NewIconFromSysDLL("shell32", 4) if err != nil { - ni.Dispose() - return nil, fmt.Errorf("加载托盘图标: %w", err) + icon = walk.IconApplication() } if err := ni.SetIcon(icon); err != nil { ni.Dispose() - return nil, err + return nil, fmt.Errorf("设置托盘图标: %w", err) } if err := ni.SetToolTip(appName + " - 右键打开菜单"); err != nil { ni.Dispose() diff --git a/app.manifest b/app.manifest index ca615a4..1b8fa98 100644 --- a/app.manifest +++ b/app.manifest @@ -2,6 +2,11 @@ GoWallpaper + + + + + @@ -16,7 +21,8 @@ - true/pm + PerMonitorV2, PerMonitor + True true diff --git a/build.ps1 b/build.ps1 index 5061e61..2951fa8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -6,6 +6,10 @@ param( ) $ErrorActionPreference = "Stop" +$ProxyUrl = "http://127.0.0.1:10808" +$env:HTTP_PROXY = $ProxyUrl +$env:HTTPS_PROXY = $ProxyUrl +$env:NO_PROXY = "localhost,127.0.0.1" $ProjectRoot = $PSScriptRoot $DistDir = Join-Path $ProjectRoot "dist" $OutputPath = Join-Path $DistDir "GoWallpaper.exe"