Bug 1297845 - Initialize gtk in GPU process. r=acomminos

MozReview-Commit-ID: EngQvL6h3EU
This commit is contained in:
Ryan Hunt
2016-08-30 01:05:00 -04:00
parent c7fd702977
commit 6af70d56d9

View File

@@ -19,6 +19,7 @@
#include "nsDebugImpl.h"
#include "mozilla/layers/LayerTreeOwnerTracker.h"
#include "ProcessUtils.h"
#include "prenv.h"
#include "VRManager.h"
#include "VRManagerParent.h"
#include "VsyncBridgeParent.h"
@@ -26,6 +27,9 @@
# include "DeviceManagerD3D9.h"
# include "mozilla/gfx/DeviceManagerDx.h"
#endif
#ifdef MOZ_WIDGET_GTK
# include <gtk/gtk.h>
#endif
namespace mozilla {
namespace gfx {
@@ -100,6 +104,26 @@ GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
}
#endif
#if defined(MOZ_WIDGET_GTK)
char* display_name = PR_GetEnv("DISPLAY");
if (display_name) {
int argc = 3;
char option_name[] = "--display";
char* argv[] = {
// argv0 is unused because g_set_prgname() was called in
// XRE_InitChildProcess().
nullptr,
option_name,
display_name,
nullptr
};
char** argvp = argv;
gtk_init(&argc, &argvp);
} else {
gtk_init(nullptr, nullptr);
}
#endif
// Send a message to the UI process that we're done.
GPUDeviceData data;
RecvGetDeviceStatus(&data);