| Index: ash/root_window_controller.cc
|
| diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
|
| index 51bd3ade55cca0943059cff0cb2f192a27d0d888..4d521cfe0f91c387576915a4ee862a5f96adcda2 100644
|
| --- a/ash/root_window_controller.cc
|
| +++ b/ash/root_window_controller.cc
|
| @@ -570,16 +570,27 @@ void RootWindowController::UpdateShelfVisibility() {
|
| }
|
|
|
| const aura::Window* RootWindowController::GetWindowForFullscreenMode() const {
|
| - const aura::Window::Windows& windows =
|
| - GetContainer(kShellWindowId_DefaultContainer)->children();
|
| const aura::Window* topmost_window = NULL;
|
| - for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin();
|
| - iter != windows.rend(); ++iter) {
|
| - if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL ||
|
| - (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) &&
|
| - (*iter)->layer()->GetTargetVisibility()) {
|
| - topmost_window = *iter;
|
| - break;
|
| + const aura::Window* active_window = wm::GetActiveWindow();
|
| + if (active_window && active_window->GetRootWindow() == root_window()) {
|
| + // Use the active window when it is on the current root window to determine
|
| + // the fullscreen state to allow temporarily using a panel or docked window
|
| + // (which are always above the default container) while a fullscreen
|
| + // window is open.
|
| + topmost_window = active_window;
|
| + } else {
|
| + // Otherwise, use the topmost window on the root window's default container
|
| + // when there is no active window on this root window.
|
| + const aura::Window::Windows& windows =
|
| + GetContainer(kShellWindowId_DefaultContainer)->children();
|
| + for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin();
|
| + iter != windows.rend(); ++iter) {
|
| + if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL ||
|
| + (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) &&
|
| + (*iter)->layer()->GetTargetVisibility()) {
|
| + topmost_window = *iter;
|
| + break;
|
| + }
|
| }
|
| }
|
| while (topmost_window) {
|
|
|