fix tray name on linux (#363)

This commit is contained in:
Alan Lin 2025-01-14 02:00:23 +08:00 committed by GitHub
parent d031450bf4
commit f50e3e10e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,8 @@ class ComposeSystemTrayForLinux : IComposeSystemTray {
menu: List<MenuItem>,
onClick: () -> Unit
) {
val systemTray: SystemTray? = remember { SystemTray.get() }
val tooltipString = tooltip.rememberString()
val systemTray: SystemTray? = remember { SystemTray.get(tooltipString) }
if (systemTray == null) {
System.err.println("System tray is not supported")
return
@ -36,7 +37,6 @@ class ComposeSystemTrayForLinux : IComposeSystemTray {
GlobalLayoutDirection,
)
}
val tooltipString = tooltip.rememberString()
LaunchedEffect(awtImage) {
systemTray.setImage(awtImage)