summaryrefslogtreecommitdiffstats
path: root/widget/gtk/NativeMenuSupport.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /widget/gtk/NativeMenuSupport.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/gtk/NativeMenuSupport.cpp')
-rw-r--r--widget/gtk/NativeMenuSupport.cpp12
1 files changed, 11 insertions, 1 deletions
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<nsWindow*>(aParent)->SetDBusMenuBar(
+ DBusMenuBar::Create(aMenuBarElement));
+ }
+#endif
}
already_AddRefed<NativeMenu> NativeMenuSupport::CreateNativeContextMenu(