Skip to content

On MacOS SysTray menu does not show when clicked on an active space in second monitor #5223

@udelledo

Description

@udelledo

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

The basic sample application found on the documentation when running on a MacOS shows the systray menu on when the systray icon is clicked in a Desktop window, it doesn't show anything when it's clicked with a space active

How to reproduce

  1. Run the sample systray application
  2. Get to a space on a second monitor (full window application)
  3. click on the systray icon
  4. The menu does not show

Screenshots

No response

Example code

package main

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

func main() {
	a := app.New()
	w := a.NewWindow("SysTray")

	if desk, ok := a.(desktop.App); ok {
		m := fyne.NewMenu("MyApp",
			fyne.NewMenuItem("Show", func() {
				w.Show()
			}))
		desk.SetSystemTrayMenu(m)
	}

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

Fyne version

2.5.1

Go compiler version

1.23.2

Operating system and version

Mac OS 14.5

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    unverifiedA bug that has been reported but not verified

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions