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

Linux (ubuntu) menu shortcuts not working #5355

Open
2 tasks done
pneumaticdeath opened this issue Jan 3, 2025 · 3 comments
Open
2 tasks done

Linux (ubuntu) menu shortcuts not working #5355

pneumaticdeath opened this issue Jan 3, 2025 · 3 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@pneumaticdeath
Copy link

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

My code has working menu shortcuts on MacOS, but the same shortcuts don't work on Linux (with a different modifier key)

How to reproduce

Create a simple menu item with a shortcut

Screenshots

No response

Example code

package main

import (
	"runtime"

	"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("Menu test")

	text := widget.NewLabel("Hello")
	w.SetContent(text)

	var modKey fyne.KeyModifier = fyne.KeyModifierControl
	if runtime.GOOS == "darwin" {
                modKey = fyne.KeyModifierSuper
	}

	item := fyne.NewMenuItem("Test", func() {
		text.SetText("World!")
	})
	item.Shortcut = &desktop.CustomShortcut{KeyName: fyne.KeyT, Modifier: modKey}

	menu := fyne.NewMenu("Menu", item)

	w.SetMainMenu(fyne.NewMainMenu(menu))

	w.ShowAndRun()
}

Fyne version

2.5.3

Go compiler version

go version go1.23.4 darwin/arm64 and go version go1.23.4 linux/amd64

Operating system and version

macOS Sonoma and Ubuntu 24.04.1 LTS

Additional Information

Works on macOS, not on linux

@pneumaticdeath pneumaticdeath added the unverified A bug that has been reported but not verified label Jan 3, 2025
@andydotxyz
Copy link
Member

Good catch. macOS does this for us, we need to code it in for the other systems I think...

@andydotxyz andydotxyz added this to the "F" release, Early 2025 milestone Jan 3, 2025
@andydotxyz andydotxyz added bug Something isn't working blocker Items that would block a forthcoming release and removed unverified A bug that has been reported but not verified labels Jan 3, 2025
@andydotxyz
Copy link
Member

Marking for "F" release as this will be a change due to the way that it will skip canvas shortcuts if the menu activates instead...

@andydotxyz
Copy link
Member

Also relates to #2627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants