diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 60dc77e55705..9985f2b3cd17 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -15960,6 +15960,15 @@ value: false mirror: always +# Whether GTK global menubar support is enabled using wayland's experimental +# dbus_annotation protocol: +# https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/52 +# Disabled until it has a final shape and it is available in compositors. +- name: widget.gtk.global-menu.wayland.enabled + type: RelaxedAtomicBool + value: false + mirror: always + # Whether native GTK context menus are enabled. # Disabled because at the very least there's missing custom icon support. - name: widget.gtk.native-context-menus diff --git a/widget/gtk/NativeMenuGtk.cpp b/widget/gtk/NativeMenuGtk.cpp index 5f935c239ac9..3f8aeb194093 100644 --- a/widget/gtk/NativeMenuGtk.cpp +++ b/widget/gtk/NativeMenuGtk.cpp @@ -735,6 +735,9 @@ void DBusMenuBar::OnNameOwnerChanged() { # ifdef MOZ_WAYLAND if (auto* display = widget::WaylandDisplayGet()) { + if (!StaticPrefs::widget_gtk_global_menu_wayland_enabled()) { + return; + } xdg_dbus_annotation_manager_v1* annotationManager = display->GetXdgDbusAnnotationManager(); if (NS_WARN_IF(!annotationManager)) {