diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /widget/gtk/NativeMenuSupport.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/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.cpp | 12 |
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( |