tauri-apps/tauri

[feat] Be able to set default system tray item on Windows

lars-berger opened this issue · 1 comments

Describe the problem

Via SetMenuDefaultItem, an option in the system tray can be emphasized and marked as default. Like so:

image
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:

  1. Expose hpopupmenu() to get the HMENU handle as done in the tray_icon crate. Devs can then call SetMenuDefaultItem themselves.
  2. Be able to pass a flag via the MenuBuilder API to mark an item as default.

Alternatives considered

No response

Additional context

No response

I have exposed the API in #11354, as I couldn't find an equivalent API for SetMenuDefaultItem on Linux and macOS.