Chromium Code Reviews| Index: components/exo/shell_surface.cc |
| diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc |
| index 592c5bf51808e765bc3e51f13bb9f99e9e5b494e..2357913be92c87461ad83f910e615d7a62e9e922 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_) { |
| @@ -1286,6 +1289,11 @@ void ShellSurface::UpdateWidgetBounds() { |
| if (initial_bounds_.IsEmpty()) |
| new_widget_bounds.set_origin(widget_->GetWindowBoundsInScreen().origin()); |
| + else { |
|
reveman
2016/11/02 14:24:19
nit: {} for the if-scope above too if needed for e
Dominik Laskowski
2016/11/03 19:56:53
Done.
|
| + 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 |
| // resize operation. |