Index: ash/wm/toplevel_window_event_filter.cc |
diff --git a/ash/wm/toplevel_window_event_filter.cc b/ash/wm/toplevel_window_event_filter.cc |
index 8d0ee8d38a220e00acce834ab668794968431b25..3a328e4897452abb3a1b745770871da5ed4e77ea 100644 |
--- a/ash/wm/toplevel_window_event_filter.cc |
+++ b/ash/wm/toplevel_window_event_filter.cc |
@@ -14,6 +14,7 @@ |
#include "base/message_loop.h" |
#include "base/run_loop.h" |
#include "ui/aura/client/aura_constants.h" |
+#include "ui/aura/client/screen_position_client.h" |
#include "ui/aura/env.h" |
#include "ui/aura/event.h" |
#include "ui/aura/root_window.h" |
@@ -43,7 +44,7 @@ gfx::Point ConvertPointToParent(aura::Window* window, |
return result; |
} |
-} |
+} // namespace |
ToplevelWindowEventFilter::ToplevelWindowEventFilter(aura::Window* owner) |
: in_move_loop_(false), |
@@ -270,8 +271,20 @@ bool ToplevelWindowEventFilter::HandleDrag(aura::Window* target, |
if (!window_resizer_.get()) |
return false; |
- window_resizer_->Drag(ConvertPointToParent(target, event->location()), |
- event->flags()); |
+ |
+ gfx::Point location_in_root(event->location()); |
+ aura::Window::ConvertPointToWindow( |
+ target, target->GetRootWindow(), &location_in_root); |
+ |
+ // Get the root window where the cursor is currently on, then pass the cursor |
+ // location in the screen coordinates to |window_resizer_|. |
+ std::pair<aura::RootWindow*, gfx::Point> actual_location = |
+ Shell::GetInstance()->NormalizeLocationInDragEvent( |
+ target->GetRootWindow(), location_in_root); |
+ aura::client::GetScreenPositionClient(actual_location.first)-> |
+ ConvertPointToScreen(actual_location.first, &actual_location.second); |
+ |
+ window_resizer_->Drag(actual_location.second, event->flags()); |
return true; |
} |