Index: ash/wm/panels/panel_window_resizer.cc |
diff --git a/ash/wm/panels/panel_window_resizer.cc b/ash/wm/panels/panel_window_resizer.cc |
index 1c054b4c36f20c00128ae0d763a53588d1e62589..e88cd1937e6d78ff5afba2fb585ac2ad885b5b6b 100644 |
--- a/ash/wm/panels/panel_window_resizer.cc |
+++ b/ash/wm/panels/panel_window_resizer.cc |
@@ -64,13 +64,11 @@ void PanelWindowResizer::Drag(const gfx::Point& location, int event_flags) { |
did_move_or_resize_ = true; |
StartedDragging(); |
} |
- gfx::Point location_in_screen = location; |
- wm::ConvertPointToScreen(GetTarget()->parent(), &location_in_screen); |
// Check if the destination has changed displays. |
gfx::Screen* screen = Shell::GetScreen(); |
const gfx::Display dst_display = |
- screen->GetDisplayNearestPoint(location_in_screen); |
+ screen->GetDisplayNearestPoint(last_location_); |
if (dst_display.id() != |
screen->GetDisplayNearestWindow(panel_container_->GetRootWindow()).id()) { |
// The panel is being dragged to a new display. If the previous container is |
@@ -198,9 +196,11 @@ void PanelWindowResizer::StartedDragging() { |
// Attach the panel while dragging placing it in front of other panels. |
GetTarget()->SetProperty(internal::kContinueDragAfterReparent, true); |
GetTarget()->SetProperty(internal::kPanelAttachedKey, true); |
- GetTarget()->SetDefaultParentByRootWindow( |
- GetTarget()->GetRootWindow(), |
- GetTarget()->GetBoundsInScreen()); |
+ gfx::Point start_location_in_screen(GetInitialLocation()); |
flackr
2013/06/19 15:16:49
Add comment that we use the start location to make
varkha
2013/06/19 15:49:22
Done.
|
+ wm::ConvertPointToScreen(GetTarget()->parent(), &start_location_in_screen); |
+ gfx::Rect near_start_location(start_location_in_screen, gfx::Size()); |
+ GetTarget()->SetDefaultParentByRootWindow(GetTarget()->GetRootWindow(), |
+ near_start_location); |
flackr
2013/06/19 15:16:49
nit: Construct gfx::Rect in place for the paramete
varkha
2013/06/19 15:49:22
No need with using the root coordinates.
|
} |
} |