2024-05-10 11:11:54 +00:00
|
|
|
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
|
|
|
|
--- a/toolkit/xre/nsAppRunner.cpp
|
|
|
|
+++ b/toolkit/xre/nsAppRunner.cpp
|
2024-05-13 11:25:18 +00:00
|
|
|
@@ -265,10 +265,13 @@
|
|
|
|
#endif
|
|
|
|
|
2024-05-10 11:11:54 +00:00
|
|
|
#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);
|
2024-05-13 11:25:18 +00:00
|
|
|
|
|
|
|
#define FILE_COMPATIBILITY_INFO "compatibility.ini"_ns
|
|
|
|
@@ -2132,10 +2135,14 @@
|
|
|
|
|
|
|
|
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX)
|
2024-05-10 11:11:54 +00:00
|
|
|
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.
|
2024-05-13 11:25:18 +00:00
|
|
|
DumpArbitraryHelp();
|
|
|
|
}
|
|
|
|
@@ -4370,10 +4377,21 @@
|
|
|
|
DumpFullVersion();
|
|
|
|
*aExitFlag = true;
|
2024-05-10 11:11:54 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef MOZ_ENABLE_DBUS
|
|
|
|
+ if (CheckArg("dbus-service")) {
|
2024-05-13 11:25:18 +00:00
|
|
|
+ UniquePtr<DBusService> dbusService = MakeUnique<DBusService>(gArgv[0]);
|
2024-05-10 11:11:54 +00:00
|
|
|
+ if (dbusService->Init()) {
|
|
|
|
+ dbusService->Run();
|
|
|
|
+ }
|
2024-05-13 11:25:18 +00:00
|
|
|
+ *aExitFlag = true;
|
2024-05-10 11:11:54 +00:00
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
rv = XRE_InitCommandLine(gArgc, gArgv);
|
|
|
|
NS_ENSURE_SUCCESS(rv, 1);
|
|
|
|
|
2024-05-13 11:25:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2024-05-10 11:11:54 +00:00
|
|
|
|