Skip to content

How to set app always fix on the top(nearby the tray icon) at launch #6023

Answered by JonasKruckenberg
Jun10ng asked this question in Q&A
Discussion options

You must be logged in to vote

There is the tauri-plugin-positioner that can help with tray relative positions (only works after the user clicked on the tray icon once though) so what I would do is the following (if that works for your use case):

  1. Have the app be "visible": false at the start
  2. Once the user clicks the tray icon once we know its position and can position the window
  3. Have a system-tray button that says "Open UI" or something like this
  4. In the buttons callback you call let _ = win.move_window(Position::TrayCenter); and then win.show()

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Jun10ng
Comment options

@kurdin
Comment options

@DaniBedz
Comment options

Answer selected by Jun10ng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants