ReviewOS

also looking at this

stacks/vite-plugin-tauri

feat: call custom window on tray icon event

#13
Open iamzjohn wants to merge feat/custom_window into main
43 files +5245 -1

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

examples/tray-with-custom-tray-menu-window/src-tauri/Cargo.tomlmodified+1-1
Changes to examples/tray-with-custom-tray-menu-window/src-tauri/Cargo.toml
@@ -22,7 +22,7 @@ tauri = { version = "2.4.1", features = [
2222 "image-png",
2323 "unstable"
2424] }
25tauri-plugin-positioner = { version = "2.0.0", features = [ "tray-icon" ] }
25# tauri-plugin-positioner = { version = "2.0.0", features = [ "tray-icon" ] }
2626
2727[features]
2828# this feature is used for production builds or when `devPath` points to the filesystem
examples/tray-with-custom-tray-menu-window/src/tray.jsmodified+2-2
Changes to examples/tray-with-custom-tray-menu-window/src/tray.js
@@ -3,7 +3,7 @@ import { defaultWindowIcon } from '@tauri-apps/api/app'
33import { TrayIcon } from '@tauri-apps/api/tray'
44import { Webview } from '@tauri-apps/api/webview'
55import { Window } from '@tauri-apps/api/window'
6// import {moveWindow, handleIconState, Position} from '@tauri-apps/plugin-positioner'
6import { handleIconState } from '@tauri-apps/plugin-positioner'
77
88/**
99 * Initialize the system tray icon and menu
@@ -16,7 +16,7 @@ export async function initTray() {
1616 const trayWindow = createTrayCustomWindow()
1717
1818 const action = async (event) => {
19 // await handleIconState(event)
19 await handleIconState(event)
2020
2121 if (event.type === 'Click') {
2222 // eslint-disable-next-line no-console