Skip to content
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

SetTitle is not working #26

Open
upendra-web opened this issue Oct 9, 2022 · 14 comments
Open

SetTitle is not working #26

upendra-web opened this issue Oct 9, 2022 · 14 comments

Comments

@upendra-web
Copy link

Hi, thanks for creating a fork of lantern's systray.

I tried the below code with systray library

package main

import (
	"fyne.io/systray"
	"fyne.io/systray/example/icon"
)

func main() {
	systray.Run(onReady, onExit)
}

func onReady() {
	systray.SetIcon(icon.Data)
	systray.SetTitle("Awesome App")
	systray.SetTooltip("Pretty awesome超级棒")
	mQuit := systray.AddMenuItem("Quit", "Quit the whole app")

	// Sets the icon of a menu item. Only available on Mac and Windows.
	mQuit.SetIcon(icon.Data)
}

func onExit() {
	// clean up here
}

But I couldn't see the title in system tray
systray_issue

So was this intentional? Or this is an issue? Thanks in advance!

System and package details

OS: Ubuntu 21.10
Desktop environment: Gnome 40.4.0
Package version: fyne.io/systray v1.10.0
Go version: 1.18

@andydotxyz
Copy link
Member

Can you confirm where the title was expected to appear? My understanding is that it appears on tooltip, but it was not clear from the screenshot that this was not the case?

@upendra-web
Copy link
Author

I tried the below code with latern's systray module

package main

import (
	"github.com/getlantern/systray"
	"github.com/getlantern/systray/example/icon"
)

func main() {
	systray.Run(onReady, onExit)
}

func onReady() {
	systray.SetIcon(icon.Data)
	systray.SetTitle("Awesome App")
	systray.SetTooltip("Pretty awesome超级棒")
	mQuit := systray.AddMenuItem("Quit", "Quit the whole app")

	// Sets the icon of a menu item. Only available on Mac and Windows.
	mQuit.SetIcon(icon.Data)
}

func onExit() {
	// clean up here
}

It rendered the title beside the icon as below
systray_latern

So with fyne.io's systray module I thought the result might be the same.

@upendra-web
Copy link
Author

And just FYI, the Quit you see in the screenshot is a menu option, not a tooltip.

@upendra-web
Copy link
Author

Hi @andydotxyz, any updates on the above, is it an issue or design choice?

@andydotxyz
Copy link
Member

I have checked out the protocol and the code, it should work.
Do you see any error on the command line when running the app?

@andydotxyz
Copy link
Member

It could be a difference in how your window manager handles legacy system tray and the new "AppIndicator" tray items, i'm not entirely sure, as Gnome does not work on this computer.
We are passing the title to the DE correctly as far as I can see, but it is up to the panel whether or not it is displayed.
However in the old model the app controls what is drawn, so the getlantern code may have been forcing it before?

@upendra-web
Copy link
Author

Yeah, that might be the problem of the DE, I will also try to check the getlatern's code. Thanks @andydotxyz for the clarification.

Can you clarify a doubt, is it ok to encode a SVG(which has some text) to byte array and pass that to SetIcon?

@andydotxyz
Copy link
Member

Can you clarify a doubt, is it ok to encode a SVG(which has some text) to byte array and pass that to SetIcon?

I'm pretty sure that the image data must be bitmap (.png even).
In the Fyne library we can rasterise SVG, but the OS systray cannot and this library does not have that feature either.

@henri9813
Copy link

Hello,

Any update on this subject? why it works on get lantern initial project and not this one ?

On MacOS, I don't have the issue but I got it on windows.

@andydotxyz
Copy link
Member

andydotxyz commented Jun 3, 2024

Windows does not support having text next to the system tray icon, so it will show as a tooltip (if none other is set) instead.

For the title issue of this ticket we were waiting for more information from the OP.

@henri9813
Copy link

Thanks for your feedback.

Maybe could we add this to documentation ?

@andydotxyz
Copy link
Member

If it is confirmed that is the answer we could close it with a doc update.

Though I am curious about your comment, how does it look on Windows with the original project?

Any update on this subject? why it works on get lantern initial project and not this one ?

@ar065
Copy link

ar065 commented Aug 11, 2024

Having the same issue here on KDE, although getlantern/systray has the same issue for me.

@andydotxyz
Copy link
Member

I don't think KDE supports inserting text to the system tray. Can you show any app which does that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants