Chromium Code Reviews| Index: ash/common/wm/window_cycle_controller.cc |
| diff --git a/ash/common/wm/window_cycle_controller.cc b/ash/common/wm/window_cycle_controller.cc |
| index 6135f600aa34ceb59e4e0db89ed6bcd3abe0e9b7..bf2b5471ec6cf845f99be02b64617bbb7cdbb52e 100644 |
| --- a/ash/common/wm/window_cycle_controller.cc |
| +++ b/ash/common/wm/window_cycle_controller.cc |
| @@ -6,10 +6,12 @@ |
| #include "ash/common/metrics/task_switch_source.h" |
| #include "ash/common/session/session_state_delegate.h" |
| +#include "ash/common/shell_window_ids.h" |
| #include "ash/common/wm/mru_window_tracker.h" |
| #include "ash/common/wm/window_cycle_event_filter.h" |
| #include "ash/common/wm/window_cycle_list.h" |
| #include "ash/common/wm_shell.h" |
| +#include "ash/common/wm_window.h" |
| #include "base/metrics/histogram.h" |
| namespace ash { |
| @@ -52,6 +54,21 @@ void WindowCycleController::HandleCycleWindow(Direction direction) { |
| void WindowCycleController::StartCycling() { |
| MruWindowTracker::WindowList window_list = |
| WmShell::Get()->mru_window_tracker()->BuildMruWindowList(); |
| + // Exclude the AppList window, which will hide as soon as cycling starts |
| + // anyway. It doesn't make sense to count it as a "switchable" window, yet |
| + // a lot of code relies on the MRU list returning the app window. If we |
| + // don't manually do this, the window cycling UI won't crash or misbehave, but |
| + // there will be a flicker as the target window changes. |
|
Evan Stade
2016/08/12 22:51:57
this is really annoying and gross. See ash/common/
|
| + window_list.erase( |
| + std::remove_if(window_list.begin(), window_list.end(), |
| + [](WmWindow* window) { |
| + bool foo = window->GetRootWindow() |
| + ->GetChildByShellWindowId( |
| + kShellWindowId_AppListContainer) |
| + ->Contains(window); |
| + return foo; |
| + }), |
| + window_list.end()); |
| active_window_before_window_cycle_ = GetActiveWindow(window_list); |