[feat] Be able to set default system tray item on Windows
lars-berger opened this issue · 1 comments
lars-berger commented
Describe the problem
Via SetMenuDefaultItem
, an option in the system tray can be emphasized and marked as default. Like so:
Show Bluetooth Devices
is the default item
This requires the HMENU
handle to the menu, which is currently inaccessible through the Tauri system tray API. It is, however, accessible through hpopupmenu()
in the tray_icon
crate.
Describe the solution you'd like
Either:
- Expose
hpopupmenu()
to get theHMENU
handle as done in thetray_icon
crate. Devs can then callSetMenuDefaultItem
themselves. - Be able to pass a flag via the
MenuBuilder
API to mark an item as default.
Alternatives considered
No response
Additional context
No response
amrbashir commented
I have exposed the API in #11354, as I couldn't find an equivalent API for SetMenuDefaultItem on Linux and macOS.