Open Bug 1419151 Opened 7 years ago Updated 2 months ago

Firefox does not support KDE Plasma 5.9.x+ global menu

Categories

(Core :: Widget: Gtk, enhancement, P3)

57 Branch
Unspecified
Linux
enhancement

Tracking

()

People

(Reporter: vbspam, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.89 Chrome/62.0.3202.89 Safari/537.36 Steps to reproduce: 1. Install most recent Ubuntu 2. Install KDE suite including Plasma 5.9x+ and activate global menu 3. Install most recent Firefox (version 57 at the time of reporting) 4. Run Firefox and wait until it starts Actual results: There is global menu visible, but can't be clicked or used in any way. Expected results: Firefox should be able provide its application menu through the KDE Plasma global menu panel/applet. The same way as it worked in KDE Plasma 4.x or the same way as it is working in other applications such as Chromium.
Summary: Firefox do not support KDE Plasma 5.9.x+ global menu → Firefox does not support KDE Plasma 5.9.x+ global menu
Component: Untriaged → Widget: Gtk
OS: Unspecified → Linux
Product: Firefox → Core
what is "KDE Plasma global menu panel/applet" ?
(In reply to firefox@firemail.cc from comment #1) > what is "KDE Plasma global menu panel/applet" ? I am sorry but I did not get the point of your question. Summary of my issue is that Mozilla SW (Thunderbird, Firefox, etc.) does not support KDE 5 global menu (actually at least in versions 5.9-5.12). Could you be more specific?
Recently I noticed that there is workaround the brave KDE guys provided, which introduces kind of global menu proxy. Global menu proxy should bring my required functionality for applications which does not want to support the global menu natively in KDE.
(In reply to VaBi from comment #3) > Recently I noticed that there is workaround the brave KDE guys provided, > which introduces kind of global menu proxy. Global menu proxy should bring > my required functionality for applications which does not want to support > the global menu natively in KDE. I forgot to mention that it should be available in the KDE Plasma 5.13.

Yes, issue still exists.
Plasma 5.17
FF 74.0

I just setup global menu in KDE & it's empty for firefox.

(In reply to 5n00p4eg from comment #7)

Yes, issue still exists.
Plasma 5.17
FF 74.0

I just setup global menu in KDE & it's empty for firefox.

I'm using Plasma 5.17 too (in Fedora 31), can confirm this issue still persist.

I have to say Mozilla SW depends on the appmenu-gtk-module, which is directly related to the Firefox support for this feature.
However, when I use any other GTK+ based SW, KDE shows the global menu. I'm aware GTK apps print exactly the same "Gtk-message" ("Failed to load module "appmenu-gtk-module") when their are running in a non-GTK based workspace/framework. For example, when I start Brave Browser I get this warning, but the KDE global menu works as intended. I can't say the same about Firefox (this happens with Thunderbird too)

This is something I notice every day using Firefox on KDE with global menu. All other GTK and QT apps export their menus properly, Firefox is the only one that refuses to cooperate. This would also be an issue on Unity or any other DE with a global menu. I'm surprised this hasn't gotten more attention – I guess global menu has gone out of fashion lately?

These patches seem to make it work: https://gitlab.com/Thaodan/firefox-kde-opensuse/ . But I would need to custom compile every time since I use Debian. Any interest in addressing this upstream rather than leaving it for the distros to hack together workarounds?

Hi, please do support this! Although one does not use the "File Edit View . . ." menu bar much while browsing the Internet, it would still be nice to have the global menu rather than the space (which is supposed to be the menu) being empty.

I'm using KDE Plasma 5.22.4 on Manjaro.

Will look at it. It would be great if SUSE fols submit that by phabricator (phabricator.services.mozilla.com/) so we can merge it to Firefox.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #11)

Will look at it. It would be great if SUSE fols submit that by phabricator (phabricator.services.mozilla.com/) so we can merge it to Firefox.

Hey I'm the maintainer of that package mentioned in comment #9. The patch is from Chris Coulson with updates from Rico Tzschichholz.
The original bug for this was bug 19899. the follow up is bug 1546004.
I can submit that patch thou if the original authors don't want to do that.

I have the patch in my package since Firefox 38(2015), its working flawless ever since.

I tested this version (I did backport to 93) but seems to work on X11 only, right? Is there any way to support Wayland?

(In reply to Martin Stránský [:stransky] (ni? me) from comment #13)

I tested this version (I did backport to 93) but seems to work on X11 only, right? Is there any way to support Wayland?

There's work to make DBusMenu working on Wayland.
Read here:
https://bugs.kde.org/show_bug.cgi?id=424485
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/33

Hi, I'm the author of the aforementioned Wayland protocol (now https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/52) that would allow for app menu support under Wayland, was looking at maybe getting an implementation for Firefox after getting a Chromium implementation working, and ran across this bug report. I'm curious what the status of the DBus functionality itself being upstreamed from the Canonical/SUSE patches is, since obviously we can't annotate a Firefox window as having an appmenu object that doesn't exist :)

(In reply to uhhadd from comment #16)

Hi, I'm the author of the aforementioned Wayland protocol (now https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/52) that would allow for app menu support under Wayland, was looking at maybe getting an implementation for Firefox after getting a Chromium implementation working, and ran across this bug report. I'm curious what the status of the DBus functionality itself being upstreamed from the Canonical/SUSE patches is, since obviously we can't annotate a Firefox window as having an appmenu object that doesn't exist :)

Hello,

I think there isn't any related patches upstreamed from Canonical/SUSE. I tried to apply https://gitlab.com/Thaodan/firefox-kde-opensuse/blob/master/unity-menubar.patch locally but that does not work under Wayland (and afaik also failed to apply to nightly).

Anyway, I'm happy to help with upstreaming any of these changes, they just need to be submitted via Phabricator (https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html) and preferably divided to smaller patches - just ask me for review.

Thanks.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #17)

(In reply to uhhadd from comment #16)

Hi, I'm the author of the aforementioned Wayland protocol (now https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/52) that would allow for app menu support under Wayland, was looking at maybe getting an implementation for Firefox after getting a Chromium implementation working, and ran across this bug report. I'm curious what the status of the DBus functionality itself being upstreamed from the Canonical/SUSE patches is, since obviously we can't annotate a Firefox window as having an appmenu object that doesn't exist :)

Hello,

I think there isn't any related patches upstreamed from Canonical/SUSE. I tried to apply https://gitlab.com/Thaodan/firefox-kde-opensuse/blob/master/unity-menubar.patch locally but that does not work under Wayland (and afaik also failed to apply to nightly).
The patches are from Canonical and the upstream of them is here:
http://bazaar.launchpad.net/~mozillateam/firefox/firefox-trunk.head/view/head:/debian/patches/unity-menubar.patch

Great. We need to get them submitted via phabricator and go through review process in Firefox. Can anyone from Canonical submit them?

Curious, why would it be needed? IIRC we did a bunch of work to have native menus on macOS, and NativeMenu should be sorta straight-forward to implement on GTK?

Ah, that only be needed for context menus.

See also bug 1149972. Maybe that one can be closed now if GNOME doesn't use a menu bar, or it could be marked as a duplicate of this.

Did you get the patch via phabricator?
This is a big disadvantage of Firefox and Thunderbird. They are the only applications on my desktop that do not work with the global menu of KDE Plasma. Because switching is not an option, I would very much appreciate if mozilla software supported the global menu.
Firefox and Thunderbird are one of the most used OSS on the Linux Desktop.

Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 13 votes.
:stransky, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(stransky)

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Flags: needinfo?(stransky)

It is still relevant for any one using Globalmenu. The only issue is right now that the GTK implementation of it depends on X11.

See Also: → 1639332

(In reply to Martin Stránský [:stransky] (ni? me) from comment #30)

From my understanding SUSE ships the menubar customization:

https://gitlab.com/Thaodan/firefox-kde-opensuse/-/tree/master
https://gitlab.com/Thaodan/firefox-kde-opensuse/-/blob/master/0023-Bug-1419151-Add-Unity-menubar-support.patch

Ah, thank you!
Was used to the custom Manjaro version, where you could click the title bar, but that works fine!

Have a great day!

Unfortunately SUSE doesn't care to upstream their changes so other distros miss it.

(In reply to Mr. Garibaldi from comment #31)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #30)

From my understanding SUSE ships the menubar customization:

https://gitlab.com/Thaodan/firefox-kde-opensuse/-/tree/master
https://gitlab.com/Thaodan/firefox-kde-opensuse/-/blob/master/0023-Bug-1419151-Add-Unity-menubar-support.patch

Ah, thank you!
Was used to the custom Manjaro version, where you could click the title bar, but that works fine!

Have a great day!

The patches come from Ubuntu originally (see patch author). The package is called firefox-kde-opensuse because the package originally only contained SUSE's KDE patches.
The last few releases I updated the patch if needed. The patch works well so far. If there would be changes needed to it in, I can do that.

Thanks for explanation. Last time I checked it works for X11. Is that already usable on Wayland too? May we consider to upstream it then?
Thanks.

Flags: needinfo?(bjorn.bidar)

Thanks for explanation. Last time I checked it works for X11. Is that already
usable on Wayland too? May we consider to upstream it then?
Thanks.

It should work on Wayland. Other plugins for other Desktop Environments
e.g. XFCE with vala-panel-appmenu or Mate with said plugin claim to have
Wayland Support.

The patch works in any case as the patch implement the support for the
protocol to work. The implementation of the target desktop does not
matter, e.g. it will work on KDE but also on XFCE.

Flags: needinfo?(bjorn.bidar)
Flags: needinfo?(stransky)

I tested the KDE patches on Fedora 38/KDE but it fails to work for me (other KDE apps shows the titlebar menu). Not sure what I do wrong.

Flags: needinfo?(stransky)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #36)

I tested the KDE patches on Fedora 38/KDE but it fails to work for me (other KDE apps shows the titlebar menu). Not sure what I do wrong.

I checked the current code but the plugin doesn't work on Wayland for KDE right now. The vala panel plugin already supports dbusmenu for Wayland GTK apps.

The KDE panel only supports GTK apps under X11, this a limitation of GTK from I know.

(In reply to Thaodan from comment #38)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #36)

I tested the KDE patches on Fedora 38/KDE but it fails to work for me (other KDE apps shows the titlebar menu). Not sure what I do wrong.

I checked the current code but the plugin doesn't work on Wayland for KDE right now. The vala panel plugin already supports dbusmenu for Wayland GTK apps.

The KDE panel only supports GTK apps under X11, this a limitation of GTK from I know.

Well, it's X11 only and also not enabled by default (at least Fedora/KDE default setup is without upper menubar). I'd be interested to look at it if Wayland is supported at least.

Thaodan, I see there are KDE integration patches shipped by SUSE. May it be possible to ship that upstream? Can you provide info what the patches does?
Thanks.

Flags: needinfo?(bjorn.bidar)

The KDE patches are from Bug 528598, Bug 528510 and Bug 140751.

Flags: needinfo?(bjorn.bidar)

This is upstreaming a patch that has been floating around in the Canonical/SUSE ether for a while.
The commit differs from the patch in that it incorporates Wayland support (and generally makes the code
less X11-dependent) via the xdg_dbus_annotation_v1 protocol.

Assignee: nobody → uhhadd
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

I ran out of time here, but this reuses a lot more of the NativeMenu
code.

This is what GTK does, effectively, and this would reuse all the Actions
code that we have for native menus.

So I couldn't test much (other than using dbus-monitor) because on my Plasma 6 the global menu is broken in X11. But I wonder why something like the two patches I posted wouldn't be workable.

Thanks for submitting the patch. I will try the patch this week.

Blocks: gtk-kde
Type: defect → enhancement
Priority: P5 → P3
Depends on: 1883184

Comment on attachment 9377567 [details]
Bug 1419151 - Add Unity menubar support r?stransky

Revision D200259 was moved to bug 1883184. Setting attachment 9377567 [details] to obsolete.

Attachment #9377567 - Attachment is obsolete: true
Depends on: 1883209

The patch is now disabled on Wayland by default until it has a final shape and it is available in compositors.
Given that it won't be available in (all) compositors. When is available in compositors? E.g. is it enough that that Wlroots and KDE support it?

Yes, as soon as the protocol is stable enough imo

Compared to the original patch I'm getting now:
dbusmenu_menuitem_property_set_shortcut: assertion 'gtk_accelerator_valid(key, modifier)' failed

How did you test the reworked version of the global menu patch?

Compared to the old patch no menus are shown on Plasma 6 for me (global menu enable in about:config).

Hello.
ff in snap still not working:
darkshvein@lexx9:~/downloads$ firefox

Gtk-Message: 11:41:08.863: Failed to load module "appmenu-gtk-module"
Gtk-Message: 11:41:08.864: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
Maximum number of clients reachedError: cannot open display: :0

sudo apt-get install appmenu-gtk2-module appmenu-gtk3-module
[TLDR]
appmenu-gtk2-module is already the newest version (0.7.6-2).
appmenu-gtk3-module is already the newest version (0.7.6-2).
The following package was automatically installed and is no longer required:
gir1.2-nm-1.0
Use 'sudo apt autoremove' to remove it.

sudo systemctl restart snapd ###cannot help
darkshvein@lexx9:~/downloads$ firefox
[the same error]

It's not working for me either, on the official packages.mozilla.org deb file for 126.0. I have widget.gtk.global-menu.enabled set to true, but no global menubar.

Unlike Darkshvein, I do not have anything showing up in the terminal when I launch firefox from the command line.

I build Firefox with Unity menbar (global menu), in Ubuntu launchpad, every version and try to continue the patch as it suits me with my programming knowledge. In Firefox under "about:config" after "ui.use_unity_menubar" > true to activate the unity menubar.

(In reply to info@darkgrave.de from comment #54)

I build Firefox with Unity menbar (global menu), in Ubuntu launchpad, every version and try to continue the patch as it suits me with my programming knowledge. In Firefox under "about:config" after "ui.use_unity_menubar" > true to activate the unity menubar.

For anyone landing here from a Google search, here's a brief of the current status of this bug:

  • Basic support for app menus was mainlined in Firefox 126.0.
  • The original unity-menubar.patch patchset is no longer necessary to use app menus - the functionality is now mostly built-in.
  • Menus are currently gated behind a config option: widget.gtk.global-menu.enabled.
    • On Wayland, menus are additionally gated behind widget.gtk.global-menu.wayland.enabled.
  • The appmenu-gtk-module package is required to be able to use app menus.
    • I found a bug in this package while investigating the new app menu support - inside a hook on the GTK widget_realize function, under Wayland, the code tries to set properties on each window before the GDK backing window is created, which results in a warning being printed to the console. It doesn't appear to cause issues, but it can be annoying when running from a terminal window.
  • Wayland support depends on the draft protocol xdg-dbus-annotation-v1, which is not yet implemented in KWin. Therefore, app menus currently do not work on KDE/Wayland systems.

I haven't tried it on X11 yet, as I just updated from 124.0.2 after the old patch broke when I switched to Wayland, but a quick test on XWayland doesn't appear to work at the moment either. It's looking very promising on Wayland though - with the small bridging patch for KWin 6.1, it's working great in my test build (still waiting for the full instrumented build to compile).

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: uhhadd → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: