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 4006b03d71a2b8b1e7b587b7c33114891b15ce24..7559522684eb3d6aee96741439ce155960903510 100644 |
--- a/ash/common/wm/window_cycle_list.cc |
+++ b/ash/common/wm/window_cycle_list.cc |
@@ -390,6 +390,10 @@ class WindowCycleView : public views::WidgetDelegateView { |
} |
} |
+ void OnMouseCaptureLost() override { |
+ WmShell::Get()->window_cycle_controller()->StopCycling(); |
+ } |
+ |
View* GetContentsView() override { return this; } |
View* GetInitiallyFocusedView() override { |
@@ -464,6 +468,7 @@ WindowCycleList::WindowCycleList(const WindowList& windows) |
current_index_(0), |
initial_direction_(WindowCycleController::FORWARD), |
cycle_view_(nullptr), |
+ cycle_ui_widget_(nullptr), |
screen_observer_(this) { |
if (!ShouldShowUi()) |
WmShell::Get()->mru_window_tracker()->SetIgnoreActivations(true); |
@@ -495,6 +500,9 @@ WindowCycleList::~WindowCycleList() { |
target_window->Show(); |
target_window->GetWindowState()->Activate(); |
} |
+ |
+ if (cycle_ui_widget_) |
+ cycle_ui_widget_->Close(); |
} |
void WindowCycleList::Step(WindowCycleController::Direction direction) { |
@@ -616,7 +624,9 @@ void WindowCycleList::InitWindowCycleView() { |
widget_rect.set_height(widget_height); |
widget->SetBounds(widget_rect); |
widget->Show(); |
- cycle_ui_widget_.reset(widget); |
+ widget->SetCapture(cycle_view_); |
+ widget->set_auto_release_capture(false); |
+ cycle_ui_widget_ = widget; |
} |
} // namespace ash |