Index: components/view_manager/view_manager_app.cc |
diff --git a/components/view_manager/view_manager_app.cc b/components/view_manager/view_manager_app.cc |
index 69b3288d357e14fb4ffd4d5ac1df81667038c856..0fd9cdd05edf27f819e1b2a2246cc2b1cf33fa41 100644 |
--- a/components/view_manager/view_manager_app.cc |
+++ b/components/view_manager/view_manager_app.cc |
@@ -24,6 +24,11 @@ |
#include "ui/gl/gl_surface.h" |
#include "ui/gl/test/gl_surface_test_support.h" |
+#if defined(USE_X11) |
+#include <X11/Xlib.h> |
+#include "ui/platform_window/x11/x11_window.h" |
+#endif |
+ |
using mojo::ApplicationConnection; |
using mojo::ApplicationImpl; |
using mojo::Gpu; |
@@ -51,11 +56,14 @@ void ViewManagerApp::Initialize(ApplicationImpl* app) { |
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
is_headless_ = command_line->HasSwitch(mojo::kUseHeadlessConfig); |
if (!is_headless_) { |
+#if defined(USE_X11) |
+ if (command_line->HasSwitch(mojo::kUseX11TestConfig)) { |
+ XInitThreads(); |
+ ui::test::SetUseOverrideRedirectWindowByDefault(true); |
+ } |
+#endif |
+ gfx::GLSurface::InitializeOneOff(); |
event_source_ = ui::PlatformEventSource::CreateDefault(); |
- if (command_line->HasSwitch(mojo::kUseTestConfig)) |
- gfx::GLSurfaceTestSupport::InitializeOneOff(); |
- else |
- gfx::GLSurface::InitializeOneOff(); |
} |
#endif |