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..997320b9fdb38f9a4068c33e82c026b1c44747ba 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); |
+ // We use root window coordinates to ensure that during the drag the panel |
+ // is reparented to a container in the root window that has that window. |
GetTarget()->SetDefaultParentByRootWindow( |
GetTarget()->GetRootWindow(), |
- GetTarget()->GetBoundsInScreen()); |
+ GetTarget()->GetRootWindow()->GetBoundsInScreen()); |
} |
} |