Commit b5e85221 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix home launcher freeze issue

Changes:
Make sure to stock tracking when a window with modal dialog is shown in
HomeLauncherGestureHandler::OnPressEvent().

Bug: 897894
Change-Id: I73267f5f71b6cdab909183d30318dd6166a75e1e
Reviewed-on: https://chromium-review.googlesource.com/c/1300215
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602951}
parent c4ab78c0
......@@ -209,8 +209,16 @@ bool HomeLauncherGestureHandler::OnScrollEvent(const gfx::Point& location,
bool HomeLauncherGestureHandler::OnReleaseEvent(const gfx::Point& location,
bool* out_dragged_down) {
if (!IsDragInProgress())
if (!IsDragInProgress()) {
if (window_) {
// |window_| may not be nullptr when this release event is triggered by
// opening |window_| with modal dialog in OnPressEvent(). In that case,
// just leave the |window_| in show state and stop tracking.
RemoveObserversAndStopTracking();
return true;
}
return false;
}
last_event_location_ = base::make_optional(location);
if (out_dragged_down) {
......@@ -657,6 +665,13 @@ bool HomeLauncherGestureHandler::SetUpWindows(Mode mode, aura::Window* window) {
if (mode == Mode::kSlideDownToHide) {
ScopedAnimationDisabler disable(window_);
window_->Show();
// When |window_| has a modal dialog child, window_->Show() above would
// cancel the current gesture and trigger OnReleaseEvent() to reset
// |window_|.
if (!window_)
return false;
wm::ActivateWindow(window_);
window_->layer()->SetOpacity(1.f);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment