Skip to content

[Linux] Window icon is ignored on Gnome taskbar #6004

@Balk-Z

Description

@Balk-Z

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

When using the fyne cli to package an application for Linux the StartupWMClass specified under [LinuxAndBSD] is removed, regardless of how it is configured.

This results in the window icon in the dock being the default one. (on Ubuntu at least)

How to reproduce

  1. Create a FyneApp.toml containing a StartUpWMClass entry, for example:
    [LinuxAndBSD]
    GenericName = "Test"
    StartupWMClass = "Test Window"

  2. Run "fyne package -os linux -icon icon.png"

  3. StartupWMClass is removed from toml and not present in resulting .desktop file

Screenshots

No response

Example code

func main() {
	a := app.NewWithID("test")
	w := a.NewWindow("Test Window")

	logText := widget.NewLabel("")
	logText.Wrapping = fyne.TextWrapBreak
	logScrollContainer := container.NewScroll(logText)

	w.SetContent(logScrollContainer)
	w.Resize(fyne.NewSize(500, 400))
	w.Hide()

	if desk, ok := a.(desktop.App); ok {
		iconResource := fyne.NewStaticResource("app-icon.png", embeddedIcon)
		desk.SetSystemTrayIcon(iconResource)

		m := fyne.NewMenu("Menu",
			fyne.NewMenuItem("Quit", func() {
				a.Quit()
			}),
		)
		desk.SetSystemTrayMenu(m)

		w.SetCloseIntercept(func() {
			w.Hide()
		})
	}

	a.Run()
}

Fyne version

fyne cli version: v1.7.0, fyne library version: v2.7.0

Go compiler version

go1.25.3

Operating system and version

Ubuntu 24.04.3 LTS

Additional Information

As far as I can tell I should be able to inject the WMClass during the package of fyne using the Linux entry section as per:
https://docs.fyne.io/started/metadata/#linux--bsd-configuration

Running Ubuntu on wayland so maybe related to #5983. Regardless, adding the StartUpWMClass to the .desktop file resolves the issues of the icon not showing only on the window and fyne should respect the [LinuxAndBSD] properties added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unverifiedA bug that has been reported but not verified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions