-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor incorrect triggering of "Failed to convert systray icon" error #5389
Comments
It likely isn't wrong - the icon appearing does not mean that it worked, it could mean that the icon fell back to the app icon which is the default if no system tray icon is set. |
As I am still actively developing, I didn't use fyne package, just building with flags to gen my binary. So the fact the icon shows properly can only mean the conversion worked. The icon is stored in a custom config dir, so no way the app can pick it up automatically More interestingly, I suspected a conversion problem so tried a svg but that failed completely with tray showing empty icon. Not a big issue, figure I just track it. |
I'm not sure that's the only explanation. You could have placed the file as
That is an interesting point, thanks. Looking at the code: img, err := toOSIcon(resource.Content())
if err != nil {
fyne.LogError("Failed to convert systray icon", err)
return
}
if _, ok := resource.(*theme.ThemedResource); ok {
systray.SetTemplateIcon(img, img)
} else {
systray.SetIcon(img)
} You can see that if the error occurs then it will not apply the system tray icon - so it must be defaulting. I have tried to replicate the issue with the icon from your repository but so far I have not managed to do so. So I tried one more thing, to look at your code - I wonder it something strange is happening in your asset manager: func (am *AssetManager) GetIcon(name string) (fyne.Resource, error) {
...
return fyne.NewStaticResource("app-icon.png", iconData), nil
} In this method I see that it is always returning an asset with the same name. This means you could be getting cache collisions and possible undefined behaviour. If you use the file name in the name of the resource that you load we will get a more accurate picture of what is actually happening... |
i am sorry, i must have paste link from an old branch, i updated that a while back, link must have been from old branch. here's the update code i saw that the error said something about gl, could this be a lower level problem? my dev machine is running a amd 6900xt. could this be a weird gl related amd vs nvidia problem? |
That link has the same problem (and so does the
No, the error is reported in an image parse line of code - not rendering related. |
Checklist
Describe the bug
Using 118x118 px a png file as a system tray icon on Windows 11 using desktop.App.SetSystemTrayIcon(trayIcon) causes a error message on stdout
2025/01/09 21:28:05 Fyne error: Failed to convert systray icon 2025/01/09 21:28:05 Cause: image: unknown format 2025/01/09 21:28:05 At: C:/Users/karlk/development/Go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/driver_desktop.go:174
The applications functions normally and tray icon is rendered correctly
How to reproduce
Screenshots
2025/01/09 21:28:05 Fyne error: Failed to convert systray icon 2025/01/09 21:28:05 Cause: image: unknown format 2025/01/09 21:28:05 At: C:/Users/karlk/development/Go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/driver_desktop.go:174
Example code
https://github.com/dixieflatline76/Spice/blob/5c147fbd952ece84e0f0c22a64043339968249e8/ui/ui.go#L50
Fyne version
v2.5.3
Go compiler version
go version go1.23.3 windows/amd64
Operating system and version
Windows 11
Additional Information
No response
The text was updated successfully, but these errors were encountered: