firefox/D209911.1715685535.diff
2024-05-13 13:25:18 +02:00

56 lines
1.4 KiB
Diff

diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -265,10 +265,13 @@
#endif
#ifdef MOZ_WIDGET_GTK
# include "nsAppShell.h"
#endif
+#ifdef MOZ_ENABLE_DBUS
+# include "DBusService.h"
+#endif
extern uint32_t gRestartMode;
extern void InstallSignalHandlers(const char* ProgramName);
#define FILE_COMPATIBILITY_INFO "compatibility.ini"_ns
@@ -2132,10 +2135,14 @@
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX)
printf(" --headless Run without a GUI.\n");
#endif
+#if defined(MOZ_ENABLE_DBUS)
+ printf(" --dbus-service Run as DBus service.\n");
+#endif
+
// this works, but only after the components have registered. so if you drop
// in a new command line handler, --help won't not until the second run. out
// of the bug, because we ship a component.reg file, it works correctly.
DumpArbitraryHelp();
}
@@ -4370,10 +4377,21 @@
DumpFullVersion();
*aExitFlag = true;
return 0;
}
+#ifdef MOZ_ENABLE_DBUS
+ if (CheckArg("dbus-service")) {
+ UniquePtr<DBusService> dbusService = MakeUnique<DBusService>(gArgv[0]);
+ if (dbusService->Init()) {
+ dbusService->Run();
+ }
+ *aExitFlag = true;
+ return 1;
+ }
+#endif
+
rv = XRE_InitCommandLine(gArgc, gArgv);
NS_ENSURE_SUCCESS(rv, 1);
return 0;
}