| Index: ui/ozone/platform/x11/ozone_platform_x11.cc
|
| diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
|
| index 742bda3f490723de86a77e7bb936e9db2c444152..b301951fc1de0a619e7385b1bb68e01e3a0c2ebe 100644
|
| --- a/ui/ozone/platform/x11/ozone_platform_x11.cc
|
| +++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
|
| @@ -95,7 +95,8 @@ class OzonePlatformX11 : public OzonePlatform {
|
|
|
| void InitializeUI() override {
|
| window_manager_.reset(new X11WindowManagerOzone);
|
| - event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay()));
|
| + if (!event_source_)
|
| + event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay()));
|
| overlay_manager_.reset(new StubOverlayManager());
|
| input_controller_ = CreateStubInputController();
|
| cursor_factory_ozone_.reset(new X11CursorFactoryOzone());
|
| @@ -103,6 +104,8 @@ class OzonePlatformX11 : public OzonePlatform {
|
| }
|
|
|
| void InitializeGPU() override {
|
| + if (!event_source_)
|
| + event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay()));
|
| surface_factory_ozone_.reset(new X11SurfaceFactory());
|
| gpu_platform_support_.reset(CreateStubGpuPlatformSupport());
|
| }
|
| @@ -110,7 +113,6 @@ class OzonePlatformX11 : public OzonePlatform {
|
| private:
|
| // Objects in the Browser process.
|
| std::unique_ptr<X11WindowManagerOzone> window_manager_;
|
| - std::unique_ptr<X11EventSourceLibevent> event_source_;
|
| std::unique_ptr<OverlayManagerOzone> overlay_manager_;
|
| std::unique_ptr<InputController> input_controller_;
|
| std::unique_ptr<X11CursorFactoryOzone> cursor_factory_ozone_;
|
| @@ -120,6 +122,9 @@ class OzonePlatformX11 : public OzonePlatform {
|
| std::unique_ptr<X11SurfaceFactory> surface_factory_ozone_;
|
| std::unique_ptr<GpuPlatformSupport> gpu_platform_support_;
|
|
|
| + // Objects in both Browser and GPU process.
|
| + std::unique_ptr<X11EventSourceLibevent> event_source_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11);
|
| };
|
|
|
|
|