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..0826c1d1361a316c176a92d79af208f268416d6b 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); |
+ const gfx::Rect shelf_bounds = shelf_->GetLauncherBounds(); |
sky
2011/12/14 06:23:05
I think it would be better to ask for the screen w
DaveMoore
2011/12/14 17:03:19
Done.
|
+ if (child_bounds.y() < 0) |
+ child_bounds.set_y(0); |
+ else if (child_bounds.y() + kTitleHeight > shelf_bounds.y()) |
+ child_bounds.set_y(shelf_bounds.y() - kTitleHeight); |
+ SetChildBoundsDirect(child, child_bounds); |
} |
void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window, |