| 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 2b8ccc9ddf1efc592056e199d1d62a28d136cbfc..686290e54064664a3af0ddb3f256598b5223de62 100644
|
| --- a/ash/common/wm/window_cycle_controller.cc
|
| +++ b/ash/common/wm/window_cycle_controller.cc
|
| @@ -9,6 +9,7 @@
|
| #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/window_state.h"
|
| #include "ash/common/wm_shell.h"
|
| #include "ash/common/wm_window.h"
|
| #include "ash/public/cpp/shell_window_ids.h"
|
| @@ -54,18 +55,24 @@ 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 remove it, the window cycling UI won't crash or misbehave,
|
| - // but there will be a flicker as the target window changes.
|
| + // Exclude windows:
|
| + // - non user positionable windows, such as extension popups.
|
| + // - windows being dragged
|
| + // - 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 remove it, the window cycling UI won't crash or misbehave,
|
| + // but there will be a flicker as the target window changes. Also exclude
|
| + // unselectable windows such as extension popups.
|
| + auto window_is_ineligible = [](WmWindow* window) {
|
| + wm::WindowState* state = window->GetWindowState();
|
| + return !state->IsUserPositionable() || state->is_dragged() ||
|
| + window->GetRootWindow()
|
| + ->GetChildByShellWindowId(kShellWindowId_AppListContainer)
|
| + ->Contains(window);
|
| + };
|
| window_list.erase(std::remove_if(window_list.begin(), window_list.end(),
|
| - [](WmWindow* window) {
|
| - return window->GetRootWindow()
|
| - ->GetChildByShellWindowId(
|
| - kShellWindowId_AppListContainer)
|
| - ->Contains(window);
|
| - }),
|
| + window_is_ineligible),
|
| window_list.end());
|
|
|
| active_window_before_window_cycle_ = GetActiveWindow(window_list);
|
|
|