forked from mirrors/gecko-dev
Bug 1883254 - Fix dbus-disabled build after bug 1883184. r=stransky
Ugh Differential Revision: https://phabricator.services.mozilla.com/D203487
This commit is contained in:
parent
0553a60afb
commit
bcc968a60b
6 changed files with 23 additions and 8 deletions
|
|
@ -444,6 +444,8 @@ void NativeMenuGtk::CloseSubmenu(dom::Element*) {
|
||||||
// TODO: For testing mostly.
|
// TODO: For testing mostly.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_DBUS
|
||||||
|
|
||||||
class MenubarModelDBus final : public MenuModel {
|
class MenubarModelDBus final : public MenuModel {
|
||||||
public:
|
public:
|
||||||
explicit MenubarModelDBus(dom::Element* aElement) : MenuModel(aElement) {
|
explicit MenubarModelDBus(dom::Element* aElement) : MenuModel(aElement) {
|
||||||
|
|
@ -517,7 +519,7 @@ static uint32_t KeyFrom(const dom::Element* aElement) {
|
||||||
return ParseKey(key, keycode);
|
return ParseKey(key, keycode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(emilio): Unifiy with nsMenuUtilsX::GeckoModifiersForNodeAttribute (or
|
// TODO(emilio): Unify with nsMenuUtilsX::GeckoModifiersForNodeAttribute (or
|
||||||
// at least switch to strtok_r).
|
// at least switch to strtok_r).
|
||||||
static uint32_t ParseModifiers(const nsAString& aModifiers) {
|
static uint32_t ParseModifiers(const nsAString& aModifiers) {
|
||||||
if (aModifiers.IsEmpty()) {
|
if (aModifiers.IsEmpty()) {
|
||||||
|
|
@ -812,5 +814,6 @@ RefPtr<DBusMenuBar> DBusMenuBar::Create(dom::Element* aElement) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DBusMenuBar::~DBusMenuBar() = default;
|
DBusMenuBar::~DBusMenuBar() = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace mozilla::widget
|
} // namespace mozilla::widget
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ class NativeMenuGtk : public NativeMenu {
|
||||||
nsTArray<NativeMenu::Observer*> mObservers;
|
nsTArray<NativeMenu::Observer*> mObservers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_DBUS
|
||||||
|
|
||||||
class DBusMenuBar final : public RefCounted<DBusMenuBar> {
|
class DBusMenuBar final : public RefCounted<DBusMenuBar> {
|
||||||
public:
|
public:
|
||||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(DBusMenuBar)
|
MOZ_DECLARE_REFCOUNTED_TYPENAME(DBusMenuBar)
|
||||||
|
|
@ -82,6 +84,8 @@ class DBusMenuBar final : public RefCounted<DBusMenuBar> {
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace widget
|
} // namespace widget
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,13 @@ void NativeMenuSupport::CreateNativeMenuBar(nsIWidget* aParent,
|
||||||
MOZ_RELEASE_ASSERT(NS_IsMainThread(),
|
MOZ_RELEASE_ASSERT(NS_IsMainThread(),
|
||||||
"Attempting to create native menu bar on wrong thread!");
|
"Attempting to create native menu bar on wrong thread!");
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_DBUS
|
||||||
if (aMenuBarElement && StaticPrefs::widget_gtk_global_menu_enabled() &&
|
if (aMenuBarElement && StaticPrefs::widget_gtk_global_menu_enabled() &&
|
||||||
DBusMenuFunctions::Init()) {
|
DBusMenuFunctions::Init()) {
|
||||||
static_cast<nsWindow*>(aParent)->SetDBusMenuBar(
|
static_cast<nsWindow*>(aParent)->SetDBusMenuBar(
|
||||||
DBusMenuBar::Create(aMenuBarElement));
|
DBusMenuBar::Create(aMenuBarElement));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<NativeMenu> NativeMenuSupport::CreateNativeContextMenu(
|
already_AddRefed<NativeMenu> NativeMenuSupport::CreateNativeContextMenu(
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ UNIFIED_SOURCES += [
|
||||||
"AsyncGtkClipboardRequest.cpp",
|
"AsyncGtkClipboardRequest.cpp",
|
||||||
"CompositorWidgetChild.cpp",
|
"CompositorWidgetChild.cpp",
|
||||||
"CompositorWidgetParent.cpp",
|
"CompositorWidgetParent.cpp",
|
||||||
"DBusMenu.cpp",
|
|
||||||
"DMABufLibWrapper.cpp",
|
"DMABufLibWrapper.cpp",
|
||||||
"DMABufSurface.cpp",
|
"DMABufSurface.cpp",
|
||||||
"GfxInfo.cpp",
|
"GfxInfo.cpp",
|
||||||
|
|
@ -174,6 +173,7 @@ if CONFIG["MOZ_ENABLE_DBUS"]:
|
||||||
]
|
]
|
||||||
UNIFIED_SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
"AsyncDBus.cpp",
|
"AsyncDBus.cpp",
|
||||||
|
"DBusMenu.cpp",
|
||||||
]
|
]
|
||||||
CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"]
|
CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6984,10 +6984,12 @@ void nsWindow::UpdateWindowDraggingRegion(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_DBUS
|
||||||
void nsWindow::SetDBusMenuBar(
|
void nsWindow::SetDBusMenuBar(
|
||||||
RefPtr<mozilla::widget::DBusMenuBar> aDbusMenuBar) {
|
RefPtr<mozilla::widget::DBusMenuBar> aDbusMenuBar) {
|
||||||
mDBusMenuBar = std::move(aDbusMenuBar);
|
mDBusMenuBar = std::move(aDbusMenuBar);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
LayoutDeviceIntCoord nsWindow::GetTitlebarRadius() {
|
LayoutDeviceIntCoord nsWindow::GetTitlebarRadius() {
|
||||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||||
|
|
|
||||||
|
|
@ -374,7 +374,9 @@ class nsWindow final : public nsBaseWidget {
|
||||||
void UpdateWindowDraggingRegion(
|
void UpdateWindowDraggingRegion(
|
||||||
const LayoutDeviceIntRegion& aRegion) override;
|
const LayoutDeviceIntRegion& aRegion) override;
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_DBUS
|
||||||
void SetDBusMenuBar(RefPtr<mozilla::widget::DBusMenuBar> aDbusMenuBar);
|
void SetDBusMenuBar(RefPtr<mozilla::widget::DBusMenuBar> aDbusMenuBar);
|
||||||
|
#endif
|
||||||
|
|
||||||
// HiDPI scale conversion
|
// HiDPI scale conversion
|
||||||
gint GdkCeiledScaleFactor();
|
gint GdkCeiledScaleFactor();
|
||||||
|
|
@ -908,7 +910,9 @@ class nsWindow final : public nsBaseWidget {
|
||||||
RefPtr<nsWindow> mWaylandPopupNext;
|
RefPtr<nsWindow> mWaylandPopupNext;
|
||||||
RefPtr<nsWindow> mWaylandPopupPrev;
|
RefPtr<nsWindow> mWaylandPopupPrev;
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_DBUS
|
||||||
RefPtr<mozilla::widget::DBusMenuBar> mDBusMenuBar;
|
RefPtr<mozilla::widget::DBusMenuBar> mDBusMenuBar;
|
||||||
|
#endif
|
||||||
|
|
||||||
// When popup is resized by Gtk by move-to-rect callback,
|
// When popup is resized by Gtk by move-to-rect callback,
|
||||||
// we store final popup size here. Then we use mMoveToRectPopupSize size
|
// we store final popup size here. Then we use mMoveToRectPopupSize size
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue