Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: chrome/browser/ui/views/tabs/dragged_tab_controller.cc

Issue 6380007: Don't allow new windows to be created outside the monitor's work area.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698