Open Jacalz opened 3 years ago
A global menu bar is front and center in helloSystem. In the course of putting it together, we found documentation pretty much non-existent and bits and pieces scattered around in various projects here and there. So we started to collect information about this topic here, possibly it can serve as a starting point for your investigations.
We can't add it if it requires depending upon those toolkits.
Luckily, you don't need to depend on Qt or Gtk if you want to support global menus for applications written in those toolkits.
Basically you have two options:
Thanks for all of the hints and information @probonopd. Using D-bus is probably the best solution then, given that we already use it for notifications.
https://github.com/helloSystem/Menu/tree/actionsearch/src/appmenu has relevant source code for importing appplication menus via D-Bus into the global menu bar.
https://code.launchpad.net/libdbusmenu-qt may also be relevant.
On a Fyne ticket I think we will be exporting rather than importing. I guess the key element is determining if a global menu is available somehow.
Luckily, you don't need to depend on Qt or Gtk if you want to support global menus for applications written in those toolkits.
I think that's the wrong end of the equation - this ticket is about Fyne apps showing their menu in a global bar.
Need to do the equivalent of this bash snippet:
RESULT=$(dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep AppMenu)
if [ "${RESULT}" != "" ] ; then
... # Export menu on D-Bus
Is your feature request related to a problem? Please describe:
The native menu support on macOS is taking shape nicely as is a very clean solution for making sure that the menus take up no extra vertical space (as opposed to having them in the application). This is unfortunately not currently supported by Fyne on Linux/BSD in various desktop environments.
Is it possible to construct a solution with the existing API?
I think it would theoretically be better way to implement API wise as it wouldn't need to expose any new APIs. The problem could however surface depending on how the global menu support in Qt/GTK desktop environments is hooked up. We can't add it if it requires depending upon those toolkits.
Describe the solution you'd like to see:
I would have preferred to have this available on the most prominent desktops. Gnome doesn't have any support for this as far as I know, at least not without extensions. However, I know KDE has native support an dI think the same goes for Mate and possibly others.