From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- widget/gtk/NativeMenuSupport.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'widget/gtk/NativeMenuSupport.cpp') diff --git a/widget/gtk/NativeMenuSupport.cpp b/widget/gtk/NativeMenuSupport.cpp index 4360867fff..60517cd526 100644 --- a/widget/gtk/NativeMenuSupport.cpp +++ b/widget/gtk/NativeMenuSupport.cpp @@ -5,8 +5,11 @@ #include "mozilla/widget/NativeMenuSupport.h" +#include "mozilla/StaticPrefs_widget.h" #include "MainThreadUtils.h" #include "NativeMenuGtk.h" +#include "DBusMenu.h" +#include "nsWindow.h" namespace mozilla::widget { @@ -14,7 +17,14 @@ void NativeMenuSupport::CreateNativeMenuBar(nsIWidget* aParent, dom::Element* aMenuBarElement) { MOZ_RELEASE_ASSERT(NS_IsMainThread(), "Attempting to create native menu bar on wrong thread!"); - // TODO + +#ifdef MOZ_ENABLE_DBUS + if (aMenuBarElement && StaticPrefs::widget_gtk_global_menu_enabled() && + DBusMenuFunctions::Init()) { + static_cast(aParent)->SetDBusMenuBar( + DBusMenuBar::Create(aMenuBarElement)); + } +#endif } already_AddRefed NativeMenuSupport::CreateNativeContextMenu( -- cgit v1.2.3