Skip to content

fix: force tray icon creation + upgrade H.NotifyIcon to 2.3.0#515

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/tray-icon-force-create
May 22, 2026
Merged

fix: force tray icon creation + upgrade H.NotifyIcon to 2.3.0#515
laurentiu021 merged 1 commit into
mainfrom
fix/tray-icon-force-create

Conversation

@laurentiu021
Copy link
Copy Markdown
Owner

@laurentiu021 laurentiu021 commented May 22, 2026

Fixes invisible system tray icon. Added ForceCreate() call + upgraded H.NotifyIcon from 2.2.1 to 2.3.0.

Summary by CodeRabbit

  • Bug Fixes

    • Improved system tray icon initialization to ensure it displays immediately upon application startup, eliminating potential timing-related display issues.
    • Updated tray icon tooltip from a loading message to a simple "SysManager" label for clearer user identification.
  • Chores

    • Updated H.NotifyIcon.Wpf NuGet package to version 2.3.0.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 53a6efb2-3e72-49df-a9c1-a781fed54ecf

📥 Commits

Reviewing files that changed from the base of the PR and between 0dccd6d and 543be04.

📒 Files selected for processing (2)
  • SysManager/SysManager/Services/TrayIconService.cs
  • SysManager/SysManager/SysManager.csproj
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build & unit tests
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (2)
SysManager/SysManager/Services/TrayIconService.cs (2)

57-57: LGTM!


62-62: Confirm TaskbarIcon.ForceCreate() is a valid API and matches the intended tray-icon fix

  • H.NotifyIcon.Wpf’s TaskbarIcon exposes ForceCreate(bool enablesEfficiencyMode = true); it recreates/creates the icon by calling TrayIcon.Create and, when enablesEfficiencyMode is true, enables Efficiency Mode.
  • Calling _trayIcon.ForceCreate() right after setting ToolTipText, Icon, ContextMenu, and Visibility aligns with the documented purpose (“force create icon” when it may be placed in resources), supporting the invisible tray icon fix.
  • Double-check that the 2.3.0 NuGet package you’re targeting includes ForceCreate() (upstream source/docs show it exists).

📝 Walkthrough

Walkthrough

The PR updates the H.NotifyIcon.Wpf NuGet dependency from version 2.2.1 to 2.3.0 and modifies TrayIconService.Initialize to explicitly call ForceCreate() on the tray icon after configuration. The tooltip text is simplified from a loading message to "SysManager".

Changes

Tray Icon Initialization

Layer / File(s) Summary
H.NotifyIcon.Wpf dependency upgrade
SysManager/SysManager/SysManager.csproj
H.NotifyIcon.Wpf NuGet package is updated from 2.2.1 to 2.3.0.
Tray icon initialization with explicit creation
SysManager/SysManager/Services/TrayIconService.cs
Tray icon tooltip text is changed to "SysManager" (from "SysManager — loading…"), and an explicit _trayIcon.ForceCreate() call is added immediately after setting tooltip, icon, context menu, and visibility properties to ensure immediate tray icon creation.

Possibly related PRs

  • laurentiu021/SystemManager#268: Introduced the original TrayIconService implementation that this PR refines with explicit creation and simplified initialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 The tray icon springs to life with force and care,
No loading dance, just presence bright and bare,
A version bump, a simple tooltip name,
Our whiskers twitch with joy—the icon's now aflame! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: forcing tray icon creation via ForceCreate() and upgrading H.NotifyIcon to 2.3.0, matching the file modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tray-icon-force-create

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@laurentiu021 laurentiu021 merged commit fabd0ca into main May 22, 2026
5 checks passed
@laurentiu021 laurentiu021 deleted the fix/tray-icon-force-create branch May 22, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant