fix(tray): left-click tray icon opens main window directly on Windows#1632
fix(tray): left-click tray icon opens main window directly on Windows#1632MarkSunDev wants to merge 1 commit intofarion1231:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d263c66d19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| tray::handle_tray_menu_event(app, &event.id.0); | ||
| }) | ||
| .show_menu_on_left_click(true); | ||
| .show_menu_on_left_click(false); |
There was a problem hiding this comment.
Gate left-click tray behavior to Windows only
This change makes show_menu_on_left_click(false) unconditional, so macOS/Linux also lose the previous left-click menu behavior and are routed through the new click handler. That is a cross-platform regression: on macOS, left-click now bypasses the existing show_main menu path in tray::handle_tray_menu_event that restores normal app visibility policy (apply_tray_policy(app, true)), so users coming from tray/accessory mode can get inconsistent activation/dock behavior. Scope this override to Windows (or keep left-click menu enabled on non-Windows) to preserve prior behavior.
Useful? React with 👍 / 👎.
Problem
On Windows, left-clicking the system tray icon shows the context menu — same behavior as right-click. To open the main window, users must click the tray icon and then click "Open main window" from the menu, which is an unnecessary extra step.
Solution
show_menu_on_left_click(false)to disable menu popup on left-clickMouseButton::Left+MouseButtonState::Upinon_tray_icon_eventto show and focus the main window directlyTesting
set_skip_taskbaris#[cfg(target_os = "windows")])