Skip to content

Fix system tray tooltip crash in both editions#424

Merged
erikdarlingdata merged 2 commits into
devfrom
fix/tray-tooltip-crash
Mar 4, 2026
Merged

Fix system tray tooltip crash in both editions#424
erikdarlingdata merged 2 commits into
devfrom
fix/tray-tooltip-crash

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Replaces custom visual TrayToolTip (Border + TextBlock) with plain string ToolTipText in both Dashboard and Lite
  • The custom tooltip triggers a known race condition in Hardcodet.NotifyIcon.Wpf where Popup.CreateWindow throws ArgumentException: The root Visual of a VisualTarget cannot have a parent
  • The library is unmaintained (issue open since 2020, no fix)
  • This crash poisoned the DuckDB ReaderWriterLockSlim on the UI thread, breaking Overview queries permanently until restart (see DuckDB ReaderWriterLockSlim not resilient to unhandled exceptions #423 for locking resilience)

Files changed

File Change
Lite/Services/SystemTrayService.cs Replace TrayToolTip with ToolTipText, update pause toggle
Dashboard/Services/NotificationService.cs Replace TrayToolTip with ToolTipText

Fixes #422

Test plan

  • Both projects build clean (0 warnings, 0 errors)
  • Hover over system tray icon — tooltip shows plain text
  • Lite: pause/resume collection updates tooltip text
  • Run for extended period — no VisualTarget crashes in log

🤖 Generated with Claude Code

erikdarlingdata and others added 2 commits March 4, 2026 14:33
The custom visual TrayToolTip (Border + TextBlock) triggers a known race
condition in Hardcodet.NotifyIcon.Wpf where Popup.CreateWindow throws
"The root Visual of a VisualTarget cannot have a parent." This crash
poisons the ReaderWriterLockSlim on the UI thread, breaking Overview
queries permanently until restart.

Plain string ToolTipText avoids the WPF Popup infrastructure entirely.

Fixes #422

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…422)

Reverts the ToolTipText approach which caused context menu positioning and
theme regressions. Instead, keeps the original custom TrayToolTip for proper
dark theme styling and popup anchoring, and adds IsTrayToolTipCrash() detection
in both apps' DispatcherUnhandledException handlers to silently swallow the
rare Hardcodet VisualTarget race condition without showing error dialogs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit b31b0f0 into dev Mar 4, 2026
@erikdarlingdata erikdarlingdata deleted the fix/tray-tooltip-crash branch April 9, 2026 00:34
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