Index: ash/wm/workspace/workspace_layout_manager.cc |
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc |
index c7e6c4c1e70a5a1a7605f06837d4aa000bb073c5..634986bb751ee1819ac4277aa5d2f3e9c6eb9804 100644 |
--- a/ash/wm/workspace/workspace_layout_manager.cc |
+++ b/ash/wm/workspace/workspace_layout_manager.cc |
@@ -150,11 +150,13 @@ void WorkspaceLayoutManager::OnKeyboardBoundsChanging( |
if (!window_state->HasRestoreBounds()) |
window_state->SaveCurrentBoundsForRestore(); |
- gfx::Rect window_bounds = ScreenUtil::ConvertRectToScreen( |
- window_, |
- window->GetTargetBounds()); |
+ gfx::Rect window_bounds = window->GetBoundsInScreen(); |
flackr
2014/08/26 18:13:51
GetBoundsInScreen will be incorrect if this happen
rsadam
2014/08/26 18:46:28
Done.
|
gfx::Rect intersect = gfx::IntersectRects(window_bounds, new_bounds); |
- int shift = std::min(intersect.height(), |
+ int vertical_displacement = intersect.height() + |
+ std::max(0, window_bounds.y() - new_bounds.y()); |
flackr
2014/08/26 18:13:52
This is somewhat confusing. Couldn't we just say w
rsadam
2014/08/26 18:46:28
Done.
|
+ |
+ // Prevent window from being pushed out of the work space. |
+ int shift = std::min(vertical_displacement, |
window->bounds().y() - work_area_in_parent_.y()); |
if (shift > 0) { |
gfx::Point origin(window->bounds().x(), window->bounds().y() - shift); |