| Index: components/exo/display.cc
|
| diff --git a/components/exo/display.cc b/components/exo/display.cc
|
| index df470b28122ce118cf389e2f6aa29f09d28e9c3c..3dffade70acf5dadc5ae5b45e90093de6f4e4534 100644
|
| --- a/components/exo/display.cc
|
| +++ b/components/exo/display.cc
|
| @@ -19,6 +19,7 @@
|
| #include "components/exo/sub_surface.h"
|
| #include "components/exo/surface.h"
|
| #include "ui/views/widget/widget.h"
|
| +#include "ui/wm/core/coordinate_conversion.h"
|
|
|
| #if defined(USE_OZONE)
|
| #include <GLES2/gl2extchromium.h>
|
| @@ -112,7 +113,7 @@ std::unique_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) {
|
| return nullptr;
|
| }
|
|
|
| - return base::MakeUnique<ShellSurface>(surface, nullptr, gfx::Rect(),
|
| + return base::MakeUnique<ShellSurface>(*this, surface, nullptr, gfx::Rect(),
|
| true /* activatable */,
|
| ash::kShellWindowId_DefaultContainer);
|
| }
|
| @@ -135,15 +136,16 @@ std::unique_ptr<ShellSurface> Display::CreatePopupShellSurface(
|
| }
|
|
|
| // Determine the initial bounds for popup. |position| is relative to the
|
| - // parent's main surface origin and initial bounds are relative to the
|
| - // container origin.
|
| - gfx::Rect initial_bounds(position, gfx::Size(1, 1));
|
| - aura::Window::ConvertRectToTarget(
|
| + // parent's main surface origin and initial bounds are in virtual coordinates.
|
| + gfx::Point origin = position;
|
| + wm::ConvertPointToScreen(
|
| ShellSurface::GetMainSurface(parent->GetWidget()->GetNativeWindow())
|
| ->window(),
|
| - parent->GetWidget()->GetNativeWindow()->parent(), &initial_bounds);
|
| + &origin);
|
| + ConvertFromScreenToVirtual(&origin);
|
| + gfx::Rect initial_bounds(origin, gfx::Size(1, 1));
|
|
|
| - return base::MakeUnique<ShellSurface>(surface, parent, initial_bounds,
|
| + return base::MakeUnique<ShellSurface>(*this, surface, parent, initial_bounds,
|
| false /* activatable */,
|
| ash::kShellWindowId_DefaultContainer);
|
| }
|
| @@ -159,8 +161,9 @@ std::unique_ptr<ShellSurface> Display::CreateRemoteShellSurface(
|
| return nullptr;
|
| }
|
|
|
| - return base::MakeUnique<ShellSurface>(surface, nullptr, gfx::Rect(1, 1),
|
| - true /* activatable */, container);
|
| + return base::MakeUnique<ShellSurface>(*this, surface, nullptr,
|
| + gfx::Rect(1, 1), true /* activatable */,
|
| + container);
|
| }
|
|
|
| std::unique_ptr<SubSurface> Display::CreateSubSurface(Surface* surface,
|
|
|