Index: chrome/browser/ui/views/tabs/dragged_tab_controller.cc |
=================================================================== |
--- chrome/browser/ui/views/tabs/dragged_tab_controller.cc (revision 72124) |
+++ chrome/browser/ui/views/tabs/dragged_tab_controller.cc (working copy) |
@@ -537,6 +537,18 @@ |
// otherwise we may attempt to maximize on the wrong monitor. |
return cursor_point; |
} |
+ // If the cursor is outside the monitor area, move it inside. For example, |
+ // dropping a tab onto the task bar on Windows produces this situation. |
+ DockInfo dock_info_for_cursor = DockInfo::GetDockInfoAtPoint(cursor_point, |
+ std::set<gfx::NativeView>()); |
sky
2011/01/21 18:55:19
this should be indented by 4.
Using DockInfo to g
|
+ if (cursor_point.x() < dock_info_for_cursor.monitor_bounds().x()) |
+ cursor_point.set_x(dock_info_for_cursor.monitor_bounds().x()); |
+ else if (cursor_point.x() > dock_info_for_cursor.monitor_bounds().right()) |
+ cursor_point.set_x(dock_info_for_cursor.monitor_bounds().right()); |
+ if (cursor_point.y() < dock_info_for_cursor.monitor_bounds().y()) |
+ cursor_point.set_y(dock_info_for_cursor.monitor_bounds().y()); |
+ else if (cursor_point.y() > dock_info_for_cursor.monitor_bounds().bottom()) |
+ cursor_point.set_y(dock_info_for_cursor.monitor_bounds().bottom()); |
return gfx::Point(cursor_point.x() - window_create_point_.x(), |
cursor_point.y() - window_create_point_.y()); |
} |