Index: ui/aura_shell/toplevel_layout_manager.cc |
diff --git a/ui/aura_shell/toplevel_layout_manager.cc b/ui/aura_shell/toplevel_layout_manager.cc |
index 05d5f474c23de0cebb1c12be25236c296ed5cd6d..00b44aa0bce7d2717100a631369bb6827f26fcee 100644 |
--- a/ui/aura_shell/toplevel_layout_manager.cc |
+++ b/ui/aura_shell/toplevel_layout_manager.cc |
@@ -48,7 +48,14 @@ void ToplevelLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, |
void ToplevelLayoutManager::SetChildBounds(aura::Window* child, |
const gfx::Rect& requested_bounds) { |
- SetChildBoundsDirect(child, requested_bounds); |
+ const static int kTitleHeight = 12; |
+ gfx::Rect child_bounds(requested_bounds); |
+ gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestWindow(child); |
+ if (child_bounds.y() < 0) |
+ child_bounds.set_y(0); |
+ else if (child_bounds.y() + kTitleHeight > work_area.bottom()) |
+ child_bounds.set_y(work_area.bottom() - kTitleHeight); |
+ SetChildBoundsDirect(child, child_bounds); |
} |
void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window, |