| Index: components/exo/shell_surface.cc
|
| diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
|
| index 592c5bf51808e765bc3e51f13bb9f99e9e5b494e..92fb6e0772851f374ec0a5ad6072b55a8248ba85 100644
|
| --- a/components/exo/shell_surface.cc
|
| +++ b/components/exo/shell_surface.cc
|
| @@ -1227,8 +1227,11 @@ gfx::Point ShellSurface::GetSurfaceOrigin() const {
|
|
|
| // If initial bounds were specified then surface origin is always relative
|
| // to those bounds.
|
| - if (!initial_bounds_.IsEmpty())
|
| - return initial_bounds_.origin() - window_bounds.OffsetFromOrigin();
|
| + if (!initial_bounds_.IsEmpty()) {
|
| + gfx::Point origin = window_bounds.origin();
|
| + wm::ConvertPointToScreen(widget_->GetNativeWindow()->parent(), &origin);
|
| + return initial_bounds_.origin() - origin.OffsetFromOrigin();
|
| + }
|
|
|
| gfx::Rect visible_bounds = GetVisibleBounds();
|
| switch (resize_component_) {
|
| @@ -1283,8 +1286,12 @@ void ShellSurface::UpdateWidgetBounds() {
|
|
|
| // Avoid changing widget origin unless initial bounds were specified and
|
| // widget origin is always relative to it.
|
| - if (initial_bounds_.IsEmpty())
|
| + if (initial_bounds_.IsEmpty()) {
|
| new_widget_bounds.set_origin(widget_->GetWindowBoundsInScreen().origin());
|
| + } else {
|
| + new_widget_bounds.set_origin(initial_bounds_.origin() +
|
| + visible_bounds.OffsetFromOrigin());
|
| + }
|
|
|
| // Update widget origin using the surface origin if the current location of
|
| // surface is being anchored to one side of the widget as a result of a
|
|
|