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

Unified Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 506133002: Fixes moving fully occluded windows when the a11y keyboard shows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@window-resize
Patch Set: Created 6 years, 4 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 | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698