KDE Plasma 6 global menus for GTK applications (like Firefox)

Hi! I’m trying to configure global menus in KDE Plasma 6. I’ve gotten it working for Qt applications, but have not yet had success making it work for GTK applications. When I run a GTK application (like Firefox), I see this warning in the terminal from which I launched it:

Gtk-Message: 20:08:54.284: Failed to load module "appmenu-gtk-module": 'gtk_module_display_init': /run/current-system/sw/lib/gtk-3.0/modules/libwindow-decorations-gtk-module.so: undefined symbol: gtk_module_display_init

This same message appears for the other GTK applications I’ve tried: Inkscape, GIMP, QEMU. I believe it does not work for any GTK application.

Here’s a minimal configuration which reproduces the issue:

{ config, pkgs, ... }:
{
	boot.loader.systemd-boot.enable = true;
	boot.loader.efi.canTouchEfiVariables = true;

	system.stateVersion = "26.05";

	users.users.plasma = {
		isNormalUser = true;
		initialPassword = "plasma";
		extraGroups = [ "wheel" ];
	};

	environment.systemPackages = [
		#pkgs.appmenu-glib-translator
		#pkgs.libdbusmenu
		#pkgs.libdbusmenu-gtk3
		pkgs.firefox
	];

	services = {
		desktopManager.plasma6.enable = true;
		displayManager.plasma-login-manager.enable = true;
	};
}

To reproduce it:

  1. Build a VM from the configuration using nix-build ‘<nixpkgs/nixos>’ -A vm -I nixpkgs=channel:nixos-unstable -I nixos-config=./that-config.nix
  2. Copy the run-nixos-vm script out of result/bin/ and edit it to specify -m 4096M and -object memory-backend-memft,id=mem0,size=4096M,share=on instead of 1024 (required otherwise the VM runs out of memory trying to open Firefox)
  3. Run the edited run-nixos-vm script
  4. Log in as plasma:plasma
  5. Right click the desktop, choose “Enter edit mode”, click the drop-down next to “+ Add Panel” and choose “Application menu bar”, click “Exit edit mode”
  6. Launch Firefox
  7. Change these two about:config knobs to true:
    1. widget.gtk.global-menu.enabled
    2. widget.gtk.global-menu.wayland.enabled
  8. Quit Firefox
  9. Launch Konsole and run firefox
  10. Observe the global menus for Konsole, but not for Firefox, and the message described above

I thought I might be missing some packages, so I tried adding the commented-out ones, but the message/lack-of-menus persisted.

I don’t have a good understanding of GTK internals, so I’m not sure how to troubleshoot the specific missing symbol error. The symbol name seems like something that should be in any GTK application already, which is puzzling.

Is this a misconfiguration on my part? Is it a bug in KDE packaging? Firefox packaging? All GTK packaging on NixOS?

I did some more digging, and it seems like the libraries involved in the message come from kdePackages.kde-gtk-config. I’m not sure what to do with this information yet, other than maybe try to build it myself to see if it has optional dependencies or something

Global menu in Plasma on Wayland does not currently work for non-QT programs, see the section “Waiting on new Wayland protocol”.

Thank you for that link! I had not found that page before.

While I understand that a clean, well-specified, compatible implementation of global menus is waiting on that Wayland protocol change, the kde-gtk-config package seems to be trying to accomplish the same thing in a hack-y way by linking against the various GTK libraries. Do you have any idea why the libraries it provides are triggering this message in the output? It sure looks like it’s trying to load some kind of global menu support, and failing for a not-obviously-Wayland-related reason.