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

Unified Diff: ash/common/wm/window_cycle_list.cc

Issue 2389323002: Start Alt+Tab on MRU instead of MRU+1 if all windows are minimized. (Closed)
Patch Set: Created 4 years, 2 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/common/wm/window_cycle_list.cc
diff --git a/ash/common/wm/window_cycle_list.cc b/ash/common/wm/window_cycle_list.cc
index ed646a8e4f0bb8e8752c10718d7597edacd480fe..a1327e3e00faef5109ef45a78b76ca8a903eaba8 100644
--- a/ash/common/wm/window_cycle_list.cc
+++ b/ash/common/wm/window_cycle_list.cc
@@ -518,8 +518,14 @@ void WindowCycleList::Step(WindowCycleController::Direction direction) {
DCHECK(static_cast<size_t>(current_index_) < windows_.size());
- if (!cycle_view_ && current_index_ == 0)
+ if (!cycle_view_ && current_index_ == 0) {
initial_direction_ = direction;
+ // Special case the situation where we're cycling forward but the MRU window
+ // is not active. This occurs when all windows are minimized. The starting
+ // window should be the first one rather than the second.
+ if (direction == WindowCycleController::FORWARD && !windows_[0]->IsActive())
+ current_index_ = -1;
varkha 2016/10/06 03:31:08 Optional nit: There logic is correct but still tak
Evan Stade 2016/10/06 15:40:33 I did write this in several different formats beca
+ }
// We're in a valid cycle, so step forward or backward.
current_index_ += direction == WindowCycleController::FORWARD ? 1 : -1;
« no previous file with comments | « no previous file | ash/wm/window_cycle_controller_unittest.cc » ('j') | ash/wm/window_cycle_controller_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698