Chromium Code Reviews| Index: ash/wm/workspace/workspace_window_resizer.cc |
| diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc |
| index e38113488934ca1d38925a631ba844e03bda44de..3eff37ecea03a0d0628902144d2f552f21aa28a5 100644 |
| --- a/ash/wm/workspace/workspace_window_resizer.cc |
| +++ b/ash/wm/workspace/workspace_window_resizer.cc |
| @@ -123,25 +123,11 @@ WorkspaceWindowResizer* WorkspaceWindowResizer::Create( |
| } |
| void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) { |
|
oshima
2012/09/18 23:10:15
can you specify the coordinates in name?
mazda
2012/09/18 23:44:57
Done.
|
| - std::pair<aura::RootWindow*, gfx::Point> actual_location = |
| - wm::GetRootWindowRelativeToWindow(window()->parent(), location); |
| - aura::RootWindow* current_root = actual_location.first; |
| - gfx::Point location_in_parent = actual_location.second; |
| - aura::Window::ConvertPointToTarget(current_root, |
| - window()->parent(), |
| - &location_in_parent); |
| - last_mouse_location_ = location_in_parent; |
| - |
| - // Do not use |location| below this point, use |location_in_parent| instead. |
| - // When the pointer is on |window()->GetRootWindow()|, |location| and |
| - // |location_in_parent| have the same value and both of them are in |
| - // |window()->parent()|'s coordinates, but once the pointer enters the |
| - // other root window, you will see an unexpected value on the former. See |
| - // comments in wm::GetRootWindowRelativeToWindow() for details. |
| + last_mouse_location_ = location; |
| int grid_size = event_flags & ui::EF_CONTROL_DOWN ? 0 : kScreenEdgeInset; |
| gfx::Rect bounds = // in |window()->parent()|'s coordinates. |
| - CalculateBoundsForDrag(details_, location_in_parent); |
| + CalculateBoundsForDrag(details_, location); |
| if (wm::IsWindowNormal(window())) |
| AdjustBoundsForMainWindow(&bounds, grid_size); |
| @@ -155,10 +141,13 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) { |
| did_move_or_resize_ = true; |
| } |
| - const bool in_original_root = (window()->GetRootWindow() == current_root); |
| + gfx::Point location_in_screen = location; |
| + wm::ConvertPointToScreen(window()->parent(), &location_in_screen); |
| + const bool in_original_root = |
| + wm::GetRootWindowAt(location_in_screen) == window()->GetRootWindow(); |
| // Hide a phantom window for snapping if the cursor is in another root window. |
| if (in_original_root) { |
| - UpdateSnapPhantomWindow(location_in_parent, bounds); |
| + UpdateSnapPhantomWindow(location, bounds); |
| } else { |
| snap_type_ = SNAP_NONE; |
| snap_phantom_window_controller_.reset(); |