зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1856582 [Linux] Handle gtk_init failure better and explicitly quit r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189920
This commit is contained in:
Родитель
93630da8b8
Коммит
0dcdcf1967
|
@ -101,7 +101,13 @@ static bool IsX11EGLEnvvarEnabled() {
|
|||
|
||||
gfxPlatformGtk::gfxPlatformGtk() {
|
||||
if (!gfxPlatform::IsHeadless()) {
|
||||
gtk_init(nullptr, nullptr);
|
||||
if (!gtk_init_check(nullptr, nullptr)) {
|
||||
gfxCriticalNote << "Failed to init Gtk, missing display? DISPLAY="
|
||||
<< getenv("DISPLAY")
|
||||
<< " WAYLAND_DISPLAY=" << getenv("WAYLAND_DISPLAY")
|
||||
<< "\n";
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
mIsX11Display = gfxPlatform::IsHeadless() ? false : GdkIsX11Display();
|
||||
|
|
|
@ -170,8 +170,8 @@ typedef struct _drmDevice {
|
|||
|
||||
#ifdef MOZ_X11
|
||||
static int x_error_handler(Display*, XErrorEvent* ev) {
|
||||
record_value(
|
||||
"ERROR\nX error, error_code=%d, "
|
||||
record_error(
|
||||
"X error, error_code=%d, "
|
||||
"request_code=%d, minor_code=%d\n",
|
||||
ev->error_code, ev->request_code, ev->minor_code);
|
||||
record_flush();
|
||||
|
@ -924,7 +924,8 @@ void wayland_egltest() {
|
|||
// exist but fails with record_error if something actually went wrong
|
||||
struct wl_display* dpy = sWlDisplayConnect(nullptr);
|
||||
if (!dpy) {
|
||||
record_error("Could not connect to wayland socket");
|
||||
record_error("Could not connect to wayland display, WAYLAND_DISPLAY=%s",
|
||||
getenv("WAYLAND_DISPLAY"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,13 +79,8 @@ static void record_value(const char* format, ...) {
|
|||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]] static void record_error(const char* str) {
|
||||
record_value("ERROR\n%s\n", str);
|
||||
}
|
||||
|
||||
[[maybe_unused]] static void record_warning(const char* str) {
|
||||
record_value("WARNING\n%s\n", str);
|
||||
}
|
||||
#define record_error(str_, ...) record_value("ERROR\n" str_, ##__VA_ARGS__)
|
||||
#define record_warning(str_, ...) record_value("WARNING\n" str_, ##__VA_ARGS__)
|
||||
|
||||
static void record_flush() {
|
||||
if (!test_buf) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче