Chromium Code Reviews| 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; |