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] Add native menu bar support #54

Closed
stuartmorgan opened this issue May 10, 2018 · 5 comments
Closed

[linux] Add native menu bar support #54

stuartmorgan opened this issue May 10, 2018 · 5 comments
Assignees

Comments

@stuartmorgan
Copy link
Collaborator

We'll need to define a protocol on the Dart side for populating and managing native menu bars, and receiving callbacks when they are selected, then implement corresponding plugins for each platform.

On macOS the native side should be relatively straightforward. Currently for Linux it will be tricky, since GLFW doesn't have menu bar support. If the GTK version is working by the time we get to this it'll be much more straightforward, otherwise we can look into a temporary solution like a floating menu window on Linux.

@krisgiesing
Copy link
Contributor

krisgiesing commented May 11, 2018

The most Flutter-like way to do this is probably to have a MenuBuilder widget (name subject to bikeshedding) that controls an underlying MenuManager class that does the channel communication. Then the menu configuration is set up in the build pipeline the same way as other UI elements.

@krisgiesing
Copy link
Contributor

Also, just to capture something we discussed out of band: menus get more complex when keyboard shortcuts enter the picture, because keyboard shortcut handling requires coordination with other kinds of input (e.g. IME). So I think this issue is meant to capture menus without shortcuts, and we'll file another issue to track keyboard shortcuts.

@mrmcq2u
Copy link

mrmcq2u commented May 12, 2018

GtkUIManager was deprecated in gtk3 and will be removed in 4. AMTK might prove useful to you, it's recently moved to be part of the tepl project.
https://developer.gnome.org/amtk/unstable/amtk-intro.html
https://developer.gnome.org/tepl/stable/amtk.html

@stuartmorgan stuartmorgan self-assigned this Jun 18, 2018
stuartmorgan added a commit that referenced this issue Jun 21, 2018
Provides a way for an embedder to add a set of Flutter-controlled
top-level menu items to the application menu.

Knowns limitations:
- No ability to set keyboard shortcuts.
- No ability to mix Flutter-controlled and native-controlled items
  within a top-level menu item.
- No handling of special native menus (e.g., the Window menu on macOS).
- No ability to interleave Flutter-controlled and native-controlled
  top-level menus; the Flutter-controlled menus must be a contiguous
  block.
- No handling of anything other than text (check marks, icons, etc.).

Future improvements will address some or all of these limitations.

Currently implemented on macOS only.

Addresses #54 for macOS
@stuartmorgan stuartmorgan changed the title Add native menu bar support [linux] Add native menu bar support Jun 22, 2018
@stuartmorgan
Copy link
Collaborator Author

Retitling to reflect the remaining scope.

@stuartmorgan
Copy link
Collaborator Author

PR #130 fixed this (in the limited way we can using GLFW); just forgot to close this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants