forked from mirrors/gecko-dev
Bug 1882255 [Linux] Quit early if there isn't any display connection and we need it r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D202807
This commit is contained in:
parent
7fd26424b8
commit
59f283c3cc
1 changed files with 23 additions and 20 deletions
|
|
@ -4747,31 +4747,13 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
|
||||||
if (saveDisplayArg) {
|
if (saveDisplayArg) {
|
||||||
if (GdkIsX11Display(disp)) {
|
if (GdkIsX11Display(disp)) {
|
||||||
SaveWordToEnv("DISPLAY", nsDependentCString(display_name));
|
SaveWordToEnv("DISPLAY", nsDependentCString(display_name));
|
||||||
}
|
} else if (GdkIsWaylandDisplay(disp)) {
|
||||||
# ifdef MOZ_WAYLAND
|
|
||||||
else if (GdkIsWaylandDisplay(disp)) {
|
|
||||||
SaveWordToEnv("WAYLAND_DISPLAY", nsDependentCString(display_name));
|
SaveWordToEnv("WAYLAND_DISPLAY", nsDependentCString(display_name));
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
# ifdef MOZ_WIDGET_GTK
|
|
||||||
else {
|
|
||||||
gdk_display_manager_open_display(gdk_display_manager_get(), nullptr);
|
gdk_display_manager_open_display(gdk_display_manager_get(), nullptr);
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
// Check that Wayland only and X11 only builds
|
|
||||||
// use appropriate displays.
|
|
||||||
# if defined(MOZ_WAYLAND) && !defined(MOZ_X11)
|
|
||||||
if (!GdkIsWaylandDisplay()) {
|
|
||||||
Output(true, "Wayland only build is missig Wayland display!\n");
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
# if !defined(MOZ_WAYLAND) && defined(MOZ_X11)
|
|
||||||
if (!GdkIsX11Display()) {
|
|
||||||
Output(true, "X11 only build is missig X11 display!\n");
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
# if defined(MOZ_WAYLAND)
|
# if defined(MOZ_WAYLAND)
|
||||||
// We want to use proxy for main connection only so
|
// We want to use proxy for main connection only so
|
||||||
// restore original Wayland display for next potential Wayland connections
|
// restore original Wayland display for next potential Wayland connections
|
||||||
|
|
@ -4779,6 +4761,27 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
|
||||||
if (gWaylandProxy) {
|
if (gWaylandProxy) {
|
||||||
gWaylandProxy->RestoreWaylandDisplay();
|
gWaylandProxy->RestoreWaylandDisplay();
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
|
if (!gdk_display_get_default()) {
|
||||||
|
Output(true,
|
||||||
|
"Error: we don't have any display, WAYLAND_DISPLAY='%s' "
|
||||||
|
"DISPLAY='%s'\n",
|
||||||
|
PR_GetEnv("WAYLAND_DISPLAY"), PR_GetEnv("DISPLAY"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
// Check that Wayland only and X11 only builds
|
||||||
|
// use appropriate displays.
|
||||||
|
# if defined(MOZ_WAYLAND) && !defined(MOZ_X11)
|
||||||
|
if (!GdkIsWaylandDisplay()) {
|
||||||
|
Output(true, "Wayland only build is missig Wayland display!\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# if !defined(MOZ_WAYLAND) && defined(MOZ_X11)
|
||||||
|
if (!GdkIsX11Display()) {
|
||||||
|
Output(true, "X11 only build is missig X11 display!\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue