Windows tray: activation click also opens the menu, and right-click can open two stacked menus
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 69/100
Research direction
Start in src/platform/windows/webview2_host.cpp, reading the tray handling in windowProc and showTrayMenu() to trace how activation and right-click events reach the menu. Reproduce the reported behavior on Windows 11 with an activation_command, then check it again without one. Done means left-click dispatches the configured command without opening the menu and right-click opens only one menu.
Written by the indexing model from the issue text.
Description
I’m primarily a backend TypeScript developer, so apologies for the shallow C++/Zig diagnosis 😆 this looks like the Windows tray host rather than the Zig core.
My Native SDK app configures a tray activation_command (show/hide) and has normal tray menu items. On Windows 11, left-clicking the tray icon runs the activation command and opens the context menu. I only want the activation command on left-click; the menu should be the right-click action.
Separately, some Windows shells deliver both WM_CONTEXTMENU and WM_RBUTTONUP for a tray right-click. Both paths call showTrayMenu(), so two menus get stacked and I have to click twice to choose an item.
I currently have a local patch oof src/platform/windows/webview2_host.cpp that:
- only calls
showTrayMenu()from the activation branch whentray_activation_commandis empty; - debounces
showTrayMenu()for 300 ms to collapse duplicate context-menu events.
It works, but I'd like to remove the patch.
Likely area: the tray handling in windowProc and showTrayMenu(). If activation_command is configured, left-click should only dispatch it. For right-click, one of the two context events should drive the menu, or the duplicate should be coalesced at the event level rather than relying on a global debounce.
Steps to reproduce (TODO to verify):
- Build a Windows Native SDK tray app with an
activation_commandand at least one menu item. - Left-click the tray icon: observe the command running and the menu opening; expected only the command.
- Right-click the tray icon: observe two stacked menus / needing two clicks to choose; expected one menu and one click.
- Re-test with no
activation_command, to confirm the intended default left-click/menu behavior.
Happy to test a candidate build or provide more details 😉
Some system info:
- Affected/Tested Native SDK versions: 0.10.1, 0.11.1
- OS: Windows 11 x64
- Dominant language
- Zig
- Stars
- 7.9k
- Forks
- 335
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 147
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel-labs/native
-
Per-view widget layout budget (1024 nodes) drops whole frames on real multi-pane app viewsPossibly taken @slicenferqin claimed this 100 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vercel-labs/native#408 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
vercel-labs/native#387 ·
Maintainers usually reply within 1 day
-
macOS: the window frame event reports the frame size where everything else expects the content sizeOpen
Difficulty 1/5 Under an hour Newbie friendliness 84/100
vercel-labs/native#355 ·
Maintainers usually reply within 1 day
-
cef.zig: InstallResult.archive_path leaks on successPossibly taken @versecafe claimed this 206 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vercel-labs/native#32 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
vercel-labs/native#957 ·
Maintainers usually reply within 1 day
All issues in vercel-labs/native
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
GUI: the space panel stays stale after a run stops with no spacePossibly taken @nikkexe0-del claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
xevrion/hatchzip#237 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
flathub/org.ardour.Ardour#89 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Javis603/token-monitor#1861 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day