| Index: athena/wm/window_manager_impl.cc
|
| diff --git a/athena/wm/window_manager_impl.cc b/athena/wm/window_manager_impl.cc
|
| index 2b539612ea6b4ccb29957c61bc33fcae2226d33a..e22543d019818b0880926de4b1cec57c79100460 100644
|
| --- a/athena/wm/window_manager_impl.cc
|
| +++ b/athena/wm/window_manager_impl.cc
|
| @@ -181,18 +181,34 @@ void WindowManagerImpl::SetInOverview(bool active) {
|
|
|
| bezel_controller_->set_left_right_delegate(
|
| active ? NULL : split_view_controller_.get());
|
| +
|
| + aura::Window::Windows window_list = window_list_provider_->GetWindowList();
|
| if (active) {
|
| FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeEnter());
|
|
|
| // Re-stack all windows in the order defined by window_list_provider_.
|
| - aura::Window::Windows window_list = window_list_provider_->GetWindowList();
|
| - aura::Window::Windows::iterator it;
|
| - for (it = window_list.begin(); it != window_list.end(); ++it)
|
| + for (aura::Window::Windows::iterator it = window_list.begin();
|
| + it != window_list.end();
|
| + ++it) {
|
| container_->StackChildAtTop(*it);
|
| +
|
| + if (wm::IsActiveWindow(*it))
|
| + wm::ActivateWindow(NULL);
|
| + }
|
| overview_ = WindowOverviewMode::Create(
|
| container_.get(), window_list_provider_.get(),
|
| split_view_controller_.get(), this);
|
| } else {
|
| + // Select the topmost window in |window_list| if no member of |window_list|
|
| + // is active upon exiting overview mode.
|
| + aura::client::ActivationClient* activation_client =
|
| + aura::client::GetActivationClient(container_->GetRootWindow());
|
| + aura::Window* active = activation_client->GetActiveWindow();
|
| + aura::Window::Windows::iterator it =
|
| + std::find(window_list.begin(), window_list.end(), active);
|
| + if (it == window_list.end())
|
| + OnSelectWindow(*window_list.rbegin());
|
| +
|
| overview_.reset();
|
| FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeExit());
|
| }
|
|
|