0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-06-01 23:52:13 +00:00
Files
termux-packages/x11-packages/firefox/0028-fix-headless-mode.patch
Robert Kirkman c60d807c4a bump(x11/firefox): 137.0
- Fixes #24069
2025-04-05 11:15:12 -05:00

32 lines
1.0 KiB
Diff

Fixes a crash in the command "firefox -headless" when run with no X11 server present
in all distros when firefox was built with the edge case intersection of:
with MOZ_HAS_REMOTE, with MOZ_X11, without MOZ_ENABLE_DBUS and without MOZ_WAYLAND
as described here https://github.com/termux/termux-packages/issues/22286
and here https://bugzilla.mozilla.org/show_bug.cgi?id=1946405
--- a/toolkit/components/remote/nsGTKRemoteServer.cpp
+++ b/toolkit/components/remote/nsGTKRemoteServer.cpp
@@ -18,9 +18,7 @@
#include "nsGTKToolkit.h"
-#ifdef MOZ_WAYLAND
-# include "mozilla/WidgetUtilsGtk.h"
-#endif
+#include "mozilla/WidgetUtilsGtk.h"
nsresult nsGTKRemoteServer::Startup(const char* aAppName,
const char* aProfileName) {
@@ -36,6 +34,10 @@ nsresult nsGTKRemoteServer::Startup(const char* aAppName,
}
#endif
+ if (!mozilla::widget::GdkIsX11Display()) {
+ return NS_ERROR_FAILURE;
+ }
+
XRemoteBaseStartup(aAppName, aProfileName);
mServerWindow = gtk_invisible_new();