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

Tray: Child menu items of a parent won't display if there is more than one parent item on Linux Mint #4843

Open
2 tasks done
joshuar opened this issue May 16, 2024 · 0 comments
Labels
unverified A bug that has been reported but not verified

Comments

@joshuar
Copy link

joshuar commented May 16, 2024

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

I am constructing a tray menu with the following structure:

  • Parent Menu Item 1
  • Parent Menu Item 2
    • Child Menu Item 1
    • Child Menu Item 2

Two parent items, one which has two child items.

On some Linux distributions, such as Linux Mint, the child menu items do not display. They do display on other distributions like Fedora. I am unsure why the different distribution would change the behaviour of the same code?

How to reproduce

Run the example code:

  • Running on Fedora, all menu items are shown correctly.
  • Running on Mint, the child menu items do not display.

Screenshots

On Fedora:

image

On Mint:

Screenshot from 2024-05-16 12-58-10

Example code

The code:

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/cmd/fyne_demo/data"
	"fyne.io/fyne/v2/driver/desktop"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.NewWithID("fyne-test")
	a.SetIcon(data.FyneLogo)

	w := a.NewWindow("SysTray")

	aMenu := fyne.NewMenuItem("Menu 1", nil)
	aMenuWithChild := fyne.NewMenuItem("Menu 2", nil)
	aMenuWithChild.ChildMenu = fyne.NewMenu("",
		fyne.NewMenuItem("Childmenu 1", nil),
		fyne.NewMenuItem("Childmenu 2", nil))
	if desk, ok := a.(desktop.App); ok {
		m := fyne.NewMenu("MyApp",
			aMenu,
			aMenuWithChild,
		)
		desk.SetSystemTrayMenu(m)
	}

	w.SetContent(widget.NewLabel("Fyne System Tray"))
	w.SetCloseIntercept(func() {
		w.Hide()
	})
	a.Run()
}

Fyne version

2.4.5

Go compiler version

go version go1.22.2 linux/amd64

Operating system and version

Fedora 40 and Linux Mint

Additional Information

No response

@joshuar joshuar added the unverified A bug that has been reported but not verified label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

1 participant