Chromium Code Reviews| Index: ash/wm/workspace/workspace_layout_manager2.cc |
| diff --git a/ash/wm/workspace/workspace_layout_manager2.cc b/ash/wm/workspace/workspace_layout_manager2.cc |
| index 45a58025444673b769e2510a2e94f30eb27bd2e4..8f966f77a5fada505b325b2535062afde0e26939 100644 |
| --- a/ash/wm/workspace/workspace_layout_manager2.cc |
| +++ b/ash/wm/workspace/workspace_layout_manager2.cc |
| @@ -53,6 +53,20 @@ void ResetBoundsIfNecessary(const BoundsMap& bounds_map, aura::Window* window) { |
| ResetBoundsIfNecessary(bounds_map, window->children()[i]); |
| } |
| +// Resets |window|s bounds from |bounds_map| if |window| is marked as a |
| +// constrained window. Recusively invokes this for all children. |
| +// TODO(sky): this should key off window type. |
| +void ResetConstrainedWindowBoundsIfNecessary(const BoundsMap& bounds_map, |
| + aura::Window* window) { |
| + if (window->GetProperty(aura::client::kConstrainedWindowKey)) { |
| + BoundsMap::const_iterator i = bounds_map.find(window); |
|
Mr4D (OOO till 08-26)
2012/09/26 04:25:08
It is a bit confusing to have to 'i' variables in
sky
2012/09/26 04:51:15
They have totally different scopes. It's no differ
|
| + if (i != bounds_map.end()) |
| + window->SetBounds(i->second); |
| + } |
| + for (size_t i = 0; i < window->children().size(); ++i) |
| + ResetConstrainedWindowBoundsIfNecessary(bounds_map, window->children()[i]); |
| +} |
| + |
| } // namespace |
| WorkspaceLayoutManager2::WorkspaceLayoutManager2(Workspace2* workspace) |
| @@ -176,6 +190,9 @@ void WorkspaceLayoutManager2::OnWindowPropertyChanged(Window* window, |
| new_state != ui::SHOW_STATE_MINIMIZED))) { |
| BuildWindowBoundsMap(window, &bounds_map); |
| cloned_layer = wm::RecreateWindowLayers(window, false); |
| + // Constrained windows don't get their bounds reset when we update the |
| + // window bounds. Leaving them empty is unexpected, so we reset them now. |
| + ResetConstrainedWindowBoundsIfNecessary(bounds_map, window); |
| } |
| UpdateBoundsFromShowState(window); |