Feat: allow config for showing the main app on tray icon click#5361
Open
mattdjenkinson wants to merge 1 commit intoDioxusLabs:mainfrom
Open
Feat: allow config for showing the main app on tray icon click#5361mattdjenkinson wants to merge 1 commit intoDioxusLabs:mainfrom
mattdjenkinson wants to merge 1 commit intoDioxusLabs:mainfrom
Conversation
nicoburns
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
Configoption to control whether the main window is shown and focused when the tray icon is left-clicked. This allows tray/menu bar apps to show only the context menu on click, without activating the main window.Ref: #5360
Problem
Currently,
handle_tray_icon_eventinapp.rsunconditionally shows and focuses all windows when the tray icon is left-clicked. This is the default behavior many apps want, but tray apps (menu bar / status bar apps) often want to show only the context menu without activating the main window.Solution
Add
tray_icon_show_window_on_click: booltoConfig(defaulttrueto preserve current behavior). When set tofalse, the tray icon left-click will not show or focus the window—only the menu will appear (if configured).Changes
config.rs: Addedtray_icon_show_window_on_clickfield (defaulttrue) andwith_tray_icon_show_window_on_click(bool)setter.app.rs: Added the field toApp, passed it from config, and updatedhandle_tray_icon_eventto only show/focus windows when the option istrue.Usage