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

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

Issue 2303043002: Retry c7e292ea58a76fe2 - Redirect all mouse input to Alt+Tab window (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « ash/common/wm/window_cycle_list.h ('k') | ash/wm/window_cycle_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..17591a081d7202d24f45f35ec35e6080ee716f7b 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) {
@@ -598,7 +606,6 @@ void WindowCycleList::InitWindowCycleView() {
views::Widget::InitParams params;
params.delegate = cycle_view_;
params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
- params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
params.accept_events = true;
params.name = "WindowCycleList (Alt+Tab)";
@@ -616,7 +623,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
« no previous file with comments | « ash/common/wm/window_cycle_list.h ('k') | ash/wm/window_cycle_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698