| 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 e4e6c841e0208d8856a54a0cd53a6853d8c3128b..ed0a913f49c6117bce4d755adfe47585f3beb80f 100644
|
| --- a/ash/wm/workspace/workspace_layout_manager.cc
|
| +++ b/ash/wm/workspace/workspace_layout_manager.cc
|
| @@ -74,6 +74,11 @@ void ResetConstrainedWindowBoundsIfNecessary(const BoundsMap& bounds_map,
|
| ResetConstrainedWindowBoundsIfNecessary(bounds_map, window->children()[i]);
|
| }
|
|
|
| +bool IsMaximizedState(ui::WindowShowState state) {
|
| + return state == ui::SHOW_STATE_MAXIMIZED ||
|
| + state == ui::SHOW_STATE_FULLSCREEN;
|
| +}
|
| +
|
| } // namespace
|
|
|
| WorkspaceLayoutManager::WorkspaceLayoutManager(Workspace* workspace)
|
| @@ -176,8 +181,8 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
|
| window->GetProperty(aura::client::kShowStateKey);
|
| if (old_state != ui::SHOW_STATE_MINIMIZED &&
|
| GetRestoreBoundsInScreen(window) == NULL &&
|
| - WorkspaceManager::IsMaximizedState(new_state) &&
|
| - !WorkspaceManager::IsMaximizedState(old_state)) {
|
| + IsMaximizedState(new_state) &&
|
| + !IsMaximizedState(old_state)) {
|
| SetRestoreBoundsInParent(window, window->bounds());
|
| }
|
| // When restoring from a minimized state, we want to restore to the
|
| @@ -194,17 +199,18 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
|
| SetRestoreBoundsInScreen(window, window->GetBoundsInScreen());
|
| }
|
|
|
| - // If maximizing or restoring, clone the layer. WorkspaceManager will use it
|
| - // (and take ownership of it) when animating. Ideally we could use that of
|
| - // BaseLayoutManager, but that proves problematic. In particular when
|
| - // restoring we need to animate on top of the workspace animating in.
|
| + // If the new state requires |window| to be in a workspace, clone the layer.
|
| + // WorkspaceManager will use it (and take ownership of it) when animating.
|
| + // Ideally we could use that of BaseLayoutManager, but that proves
|
| + // problematic. In particular when restoring we need to animate on top of
|
| + // the workspace animating in.
|
| ui::Layer* cloned_layer = NULL;
|
| BoundsMap bounds_map;
|
| if (wm::IsActiveWindow(window) &&
|
| - ((WorkspaceManager::IsMaximizedState(new_state) &&
|
| + ((new_state == ui::SHOW_STATE_FULLSCREEN &&
|
| wm::IsWindowStateNormal(old_state)) ||
|
| - (!WorkspaceManager::IsMaximizedState(new_state) &&
|
| - WorkspaceManager::IsMaximizedState(old_state) &&
|
| + (new_state != ui::SHOW_STATE_FULLSCREEN &&
|
| + old_state == ui::SHOW_STATE_FULLSCREEN &&
|
| new_state != ui::SHOW_STATE_MINIMIZED))) {
|
| BuildWindowBoundsMap(window, &bounds_map);
|
| cloned_layer = views::corewm::RecreateWindowLayers(window, false);
|
| @@ -232,6 +238,11 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
|
| if (key == internal::kWindowTrackedByWorkspaceKey &&
|
| GetTrackedByWorkspace(window)) {
|
| workspace_manager()->OnTrackedByWorkspaceChanged(workspace_, window);
|
| + if (wm::IsWindowMaximized(window)) {
|
| + SetChildBoundsDirect(
|
| + window, ScreenAsh::GetMaximizedWindowBoundsInParent(
|
| + window->parent()->parent()));
|
| + }
|
| }
|
|
|
| if (key == aura::client::kAlwaysOnTopKey &&
|
|
|