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

Menu does not change when the front window changes #4740

Open
2 tasks done
ohler55 opened this issue Mar 24, 2024 · 0 comments
Open
2 tasks done

Menu does not change when the front window changes #4740

ohler55 opened this issue Mar 24, 2024 · 0 comments
Labels
bug Something isn't working OS:macOS Tickets affecting only macOS

Comments

@ohler55
Copy link

ohler55 commented Mar 24, 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

On macOS with more than one window open the menu for the last window opened is alway displayed even if that window is hidden or not in the foreground.

How to reproduce

Create the simple app with a menu that includes a checked item so it is possible to recognize one menu from another. Flip between windows and notice the menu does not change. The simple app is included in the code below.

Screenshots

No response

Example code

func main() {
	a := app.New()

	w1 := a.NewWindow("Hello")
	w1.SetContent(widget.NewLabel("Hello"))
	w1.SetMainMenu(makeMenu())
	w1.Resize(fyne.NewSize(200, 200))
	w1.Show()

	w2 := a.NewWindow("Ohaiyo")
	w2.SetContent(widget.NewLabel("Ohaiyo"))
	w2.SetMainMenu(makeMenu())
	w2.Resize(fyne.NewSize(200, 200))
	w2.Show()

	a.Run()
}

func makeMenu() *fyne.MainMenu {
	check := &fyne.MenuItem{
		Label: "Check",
	}

	mm := fyne.NewMainMenu(
		fyne.NewMenu("Sample", check),
	)
	check.Action = func() {
		check.Checked = !check.Checked
	}
	return mm
}

Fyne version

2.4.4

Go compiler version

1.22.0

Operating system and version

macOS 14.4

Additional Information

No response

@ohler55 ohler55 added the unverified A bug that has been reported but not verified label Mar 24, 2024
@andydotxyz andydotxyz added bug Something isn't working OS:macOS Tickets affecting only macOS and removed unverified A bug that has been reported but not verified labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OS:macOS Tickets affecting only macOS
Projects
None yet
Development

No branches or pull requests

2 participants