Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: ash/root_window_controller.cc

Issue 149493008: Use active window if on current workspace for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only consider the currently active window on current root. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698