diff options
Diffstat (limited to 'ash/wm/workspace/workspace_manager.cc')
-rw-r--r-- | ash/wm/workspace/workspace_manager.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc index d4eda81d..c50fc84 100644 --- a/ash/wm/workspace/workspace_manager.cc +++ b/ash/wm/workspace/workspace_manager.cc @@ -30,13 +30,17 @@ namespace { -// Returns a list of all the windows with layers in |result|. +// Returns a list of all the windows with layers in |result|. Optionally +// ignores the window |ignore_window|. void BuildWindowList(const std::vector<aura::Window*>& windows, + aura::Window* ignore_window, std::vector<aura::Window*>* result) { for (size_t i = 0; i < windows.size(); ++i) { + if (windows[i] == ignore_window) + continue; if (windows[i]->layer()) result->push_back(windows[i]); - BuildWindowList(windows[i]->transient_children(), result); + BuildWindowList(windows[i]->transient_children(), ignore_window, result); } } @@ -51,7 +55,7 @@ namespace internal { WorkspaceManager::WorkspaceManager(aura::Window* contents_view) : contents_view_(contents_view), active_workspace_(NULL), - ignored_window_(NULL), + maximize_restore_window_(NULL), grid_size_(0), shelf_(NULL) { DCHECK(contents_view); @@ -212,7 +216,7 @@ void WorkspaceManager::SetVisibilityOfWorkspaceWindows( AnimateChangeType change_type, bool value) { std::vector<aura::Window*> children; - BuildWindowList(workspace->windows(), &children); + BuildWindowList(workspace->windows(), maximize_restore_window_, &children); SetWindowLayerVisibility(children, change_type, value); } @@ -289,9 +293,7 @@ int WorkspaceManager::GetWorkspaceIndexContaining(aura::Window* window) const { void WorkspaceManager::SetWindowBounds(aura::Window* window, const gfx::Rect& bounds) { - ignored_window_ = window; window->SetBounds(bounds); - ignored_window_ = NULL; } void WorkspaceManager::OnTypeOfWorkspacedNeededChanged(aura::Window* window) { @@ -312,7 +314,9 @@ void WorkspaceManager::OnTypeOfWorkspacedNeededChanged(aura::Window* window) { new_workspace = CreateWorkspace(Workspace::TYPE_MANAGED); new_workspace->AddWindowAfter(window, NULL); } + maximize_restore_window_ = window; SetActiveWorkspace(new_workspace); + maximize_restore_window_ = NULL; // Delete at the end so that we don't attempt to switch to another // workspace in RemoveWorkspace(). CleanupWorkspace(current_workspace); |