Bug 1297845 - Initialize gtk in GPU process. r=acomminos
MozReview-Commit-ID: EngQvL6h3EU
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user