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

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..ceffce9952c384bbabf1bc4870b96ee62c1af888 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -153,12 +153,13 @@ void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
gfx::Rect window_bounds = ScreenUtil::ConvertRectToScreen(
window_,
window->GetTargetBounds());
- gfx::Rect intersect = gfx::IntersectRects(window_bounds, new_bounds);
- int shift = std::min(intersect.height(),
- window->bounds().y() - work_area_in_parent_.y());
+ int vertical_displacement =
+ std::max(0, window_bounds.bottom() - new_bounds.y());
+ 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);
- SetChildBounds(window, gfx::Rect(origin, window->bounds().size()));
+ gfx::Point origin(window_bounds.x(), window_bounds.y() - shift);
+ SetChildBounds(window, gfx::Rect(origin, window_bounds.size()));
}
} else if (window_state->HasRestoreBounds()) {
// Keyboard hidden, restore original bounds if they exist.
« 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