From 31986e550c6fd1d739acb8568d7e5020006265ad Mon Sep 17 00:00:00 2001 From: Jackie Chen Date: Wed, 5 Aug 2026 20:34:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BC=E5=B8=83=20ThermoTray=201.1.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正多 GPU 重構帶進的系統匣缺陷:RebuildGpuIcons 為了維持 CPU 在左的 排列會重新註冊 CPU NotifyIcon,但沒有清除 _cpuIconKey,導致隨後的 UpdateCpuIcon 誤判圖示未變而跳過繪製,全新的 NotifyIcon 始終沒有圖片。 第一次偵測到 GPU 時 CPU 圖示會變成空白,且在 CPU 數字沒有變化時 (例如讀不到 CPU 感測器)會一直維持空白。 版本號提升至 1.1.5,安裝指令碼與 README 的版本示例一併更新。 Co-Authored-By: Claude Opus 5 --- AI_HANDOFF.md | 15 +++++++++++++++ Directory.Build.props | 2 +- README.md | 4 ++-- installer/ThermoTray.iss | 4 ++-- src/ThermoTray/TrayIconService.cs | 4 ++++ 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/AI_HANDOFF.md b/AI_HANDOFF.md index 5790105..1a1b55a 100644 --- a/AI_HANDOFF.md +++ b/AI_HANDOFF.md @@ -268,3 +268,18 @@ Findings and what each one changed. None of them reproduced on this machine's ow - Fast-forwarded the local `main` branch from `b8625f7` to `0407c60`, integrating the committed `agent/release-1.1.4` release work without creating an unnecessary merge commit. - The working tree still contains the existing uncommitted GPU/card changes and was not staged, committed, stashed, or discarded. `origin/main` remains at `b8625f7`; no remote push was performed. + +## 2026-08-05 version 1.1.5 publication attempt + +- The current checkout is clean on `main` at `c62a44d`, and `origin/main` is at the same commit; the existing GitHub release is `v1.1.4`. +- The user requested a version update and GitHub upload. The intended next patch version is `1.1.5`. +- Publication is currently blocked before any version edit or Git mutation because `gh auth status` reports the `nojackno2-ctrl` token as invalid. No commit, push, tag, or release was created for `1.1.5`. +- Resume after `gh auth login -h github.com` succeeds: update the single source version plus release documentation fallback, run the full win-x64 release validation, then create the release branch/commit, push, and publish the GitHub release. + +## 2026-08-05 version 1.1.5 release + +- `gh auth status` now reports a valid `nojackno2-ctrl` token, so the blocker recorded in the previous entry is cleared. +- Pre-release validation on `main` at `c62a44d` (win-x64, Release): `dotnet build` 0 warnings / 0 errors, `dotnet test` 141/141 passed, `dotnet format --verify-no-changes` clean, and the self-contained single-file `dotnet publish` produced `publish/win-x64/ThermoTray.exe`. +- Fixed a tray-icon defect introduced by the multi-GPU refactor: `TrayIconService.RebuildGpuIcons` re-registers the CPU `NotifyIcon` to keep the CPU-left ordering but left `_cpuIconKey` set, so the following `UpdateCpuIcon` treated the icon as unchanged and never drew onto the fresh `NotifyIcon`. The CPU tray slot went blank the first time a GPU appeared, and stayed blank whenever the CPU digits did not change afterwards (for example when no CPU sensor is readable). `_cpuIconKey` is now cleared alongside the icon replacement. +- Bumped `` to `1.1.5` in `Directory.Build.props`, with the documentation fallbacks in `installer/ThermoTray.iss` and `README.md` updated to match. +- Elevated live verification of the tray fix on real hardware is still pending; it needs a manual launch of the published build with a GPU present. diff --git a/Directory.Build.props b/Directory.Build.props index 49e9ce9..dba84b2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 1.1.4 + 1.1.5 latest enable enable diff --git a/README.md b/README.md index 7edea11..b0951e0 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ dotnet publish .\src\ThermoTray\ThermoTray.csproj -c Release -r win-x64 --self-c ### 建立安裝檔 -安裝 [Inno Setup](https://jrsoftware.org/isinfo.php),以 Inno Setup Compiler 開啟 `installer\ThermoTray.iss` 並編譯(命令列可用 `ISCC.exe /DAppVersion=1.1.4 installer\ThermoTray.iss` 指定版本)。它會使用 `publish\win-x64` 的輸出,安裝檔生成於 `artifacts\installer`。安裝精靈安裝到目前使用者的 LocalAppData,本身不需系統管理員權限;啟動 ThermoTray 時才會顯示 UAC。登入自動啟動請在程式內勾選「隨 Windows 啟動」。安裝精靈使用英文;已安裝的 ThermoTray 本身可切換繁體中文與英文。 +安裝 [Inno Setup](https://jrsoftware.org/isinfo.php),以 Inno Setup Compiler 開啟 `installer\ThermoTray.iss` 並編譯(命令列可用 `ISCC.exe /DAppVersion=1.1.5 installer\ThermoTray.iss` 指定版本)。它會使用 `publish\win-x64` 的輸出,安裝檔生成於 `artifacts\installer`。安裝精靈安裝到目前使用者的 LocalAppData,本身不需系統管理員權限;啟動 ThermoTray 時才會顯示 UAC。登入自動啟動請在程式內勾選「隨 Windows 啟動」。安裝精靈使用英文;已安裝的 ThermoTray 本身可切換繁體中文與英文。 ### 溫度正確性說明 @@ -91,4 +91,4 @@ Build it with Visual Studio 2022 / .NET 8 using `ThermoTray.sln` and run `dotnet After installation, accept UAC and wait one or two seconds for the first sample. CPU utilization and temperature plus one card per GPU are shown together; 0% is a valid idle reading, while missing data is shown as `Unavailable` and never as `0 °C` for temperature. Each card independently controls whether its utilization and temperature appear in the tray; the card values remain visible, while the icon and tooltip follow those choices. Each tray icon places utilization above temperature, and each GPU tooltip identifies its GPU number and device name. The CPU tray icon is registered to the left of the GPU icons unless Windows has preserved a manually rearranged notification-area order. The startup option creates a `ThermoTray` logon task with `RL HIGHEST` so it can start elevated without another UAC prompt. -For a tagged GitHub release, push a tag matching the version in `Directory.Build.props`, such as `v1.1.4`. The release workflow verifies the tag, publishes the self-contained `win-x64` build, creates the Inno Setup installer, creates a PDB-free portable ZIP, verifies the embedded `requireAdministrator` manifest, and publishes SHA-256 checksums with the release assets. +For a tagged GitHub release, push a tag matching the version in `Directory.Build.props`, such as `v1.1.5`. The release workflow verifies the tag, publishes the self-contained `win-x64` build, creates the Inno Setup installer, creates a PDB-free portable ZIP, verifies the embedded `requireAdministrator` manifest, and publishes SHA-256 checksums with the release assets. diff --git a/installer/ThermoTray.iss b/installer/ThermoTray.iss index 8d7f27f..33faa77 100644 --- a/installer/ThermoTray.iss +++ b/installer/ThermoTray.iss @@ -3,12 +3,12 @@ ; 1. 先執行自包含發行發布 (Self-contained Publish): ; dotnet publish .\src\ThermoTray\ThermoTray.csproj -c Release -r win-x64 --self-contained true -o .\publish\win-x64 ; 2. 呼叫 ISCC 進行編譯: -; ISCC.exe /DAppVersion=1.1.4 .\installer\ThermoTray.iss +; ISCC.exe /DAppVersion=1.1.5 .\installer\ThermoTray.iss #define AppName "ThermoTray" ; 可由 CI 或命令列參數 /DAppVersion= 覆蓋預設版本號 #ifndef AppVersion - #define AppVersion "1.1.4" + #define AppVersion "1.1.5" #endif #define AppPublisher "ThermoTray" #define AppExeName "ThermoTray.exe" diff --git a/src/ThermoTray/TrayIconService.cs b/src/ThermoTray/TrayIconService.cs index f128cc7..14591e6 100644 --- a/src/ThermoTray/TrayIconService.cs +++ b/src/ThermoTray/TrayIconService.cs @@ -175,6 +175,10 @@ private void RebuildGpuIcons(bool restoreCpuOrder) var oldCpuIcon = _cpuNotifyIcon; _cpuNotifyIcon = CreateNotifyIcon(); DisposeNotifyIcon(oldCpuIcon); + + // 新的 NotifyIcon 還沒有任何圖片,快取鍵必須一併清除, + // 否則 UpdateCpuIcon 會誤判圖示未變而跳過繪製,系統匣只剩空白格。 + _cpuIconKey = null; } UpdateCpuIcon();