Index: ash/root_window_controller.cc |
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
index 801f89dfc47b7c6496f35832133977ae30aefac7..4fea234cc6eb010a1e4115123d57f33f38b1f4d1 100644 |
--- a/ash/root_window_controller.cc |
+++ b/ash/root_window_controller.cc |
@@ -572,13 +572,18 @@ 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(); |
oshima
2014/02/21 19:49:46
can you add comment why these two path are necessa
flackr
2014/02/24 16:21:10
Done.
|
+ if (active_window && active_window->GetRootWindow() == root_window()) { |
+ topmost_window = active_window; |
+ } else { |
+ 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) { |