Skip to content

Add tray icon mouse wheel performance mode cycling - #5661

Open
aimagist wants to merge 1 commit into
seerge:mainfrom
aimagist:tray-wheel-performance-mode
Open

Add tray icon mouse wheel performance mode cycling#5661
aimagist wants to merge 1 commit into
seerge:mainfrom
aimagist:tray-wheel-performance-mode

Conversation

@aimagist

@aimagist aimagist commented Jul 2, 2026

Copy link
Copy Markdown

Summary

Adds a convenient shortcut for changing performance modes from the system tray.

When the cursor is over the G-Helper tray icon, scrolling the mouse wheel cycles the current performance mode without opening the main window or context menu:

  • Scroll up: next performance mode
  • Scroll down: previous performance mode

This uses the existing ModeControl.CyclePerformanceMode() path, preserving the current mode cycling, toast, and delay behavior.

Details

Since WinForms NotifyIcon does not provide a MouseWheel event, this PR adds a small tray wheel handler that listens for mouse wheel messages and only handles them when the cursor is over the G-Helper tray icon.

The handler resolves the tray icon bounds via Shell_NotifyIconGetRect, with a fallback based on the last NotifyIcon.MouseMove position.

The hook is disposed during application exit.

Testing

  • dotnet build app/GHelper.sln -c Release -p:Platform=x64 -p:GITHUB_ACTIONS=true
  • Manual test on Windows: scrolling over the tray icon successfully cycles between performance modes.

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