Commit 876e61a7 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

applist: Fix flash when swiping up app to show home launcher.

Test: manual
Bug: 880947
Change-Id: Id5005664eab5f6988fe8f8368c75a8755e833554
Reviewed-on: https://chromium-review.googlesource.com/1234359
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592675}
parent f571252a
......@@ -354,8 +354,9 @@ void HomeLauncherGestureHandler::OnImplicitAnimationsCompleted() {
DCHECK(last_event_location_);
float app_list_opacity = 1.f;
const bool last_event_top_half = IsLastEventInTopHalf(*last_event_location_);
if (Shell::Get()->window_selector_controller()->IsSelecting()) {
if (IsLastEventInTopHalf(*last_event_location_)) {
if (last_event_top_half) {
Shell::Get()->window_selector_controller()->ToggleOverview(
WindowSelector::EnterExitOverviewType::kSwipeFromShelf);
} else {
......@@ -377,15 +378,11 @@ void HomeLauncherGestureHandler::OnImplicitAnimationsCompleted() {
return;
}
// Update the backdrop first as the backdrop controller listens for some state
// changes like minimizing below which may also alter the backdrop.
aura::Window* backdrop_window = GetBackdropWindow(window_);
if (backdrop_window) {
backdrop_window->SetTransform(gfx::Transform());
backdrop_window->layer()->SetOpacity(1.f);
}
if (last_event_top_half) {
ScopedAnimationDisabler disable(window_);
wm::GetWindowState(window_)->Minimize();
window_->SetTransform(window_values_.initial_transform);
if (IsLastEventInTopHalf(*last_event_location_)) {
// Minimize the hidden windows so they can be used normally with alt+tab
// and overview. Minimize in reverse order to preserve mru ordering.
std::reverse(hidden_windows_.begin(), hidden_windows_.end());
......@@ -393,12 +390,6 @@ void HomeLauncherGestureHandler::OnImplicitAnimationsCompleted() {
ScopedAnimationDisabler disable(window);
wm::GetWindowState(window)->Minimize();
}
// Minimize |window_| without animation. Windows in |hidden_windows_| will
// rename hidden so we can see the home launcher.
ScopedAnimationDisabler disable(window_);
wm::GetWindowState(window_)->Minimize();
window_->SetTransform(window_values_.initial_transform);
} else {
// Reshow all windows previously hidden.
for (auto* window : hidden_windows_) {
......@@ -407,6 +398,14 @@ void HomeLauncherGestureHandler::OnImplicitAnimationsCompleted() {
}
}
// Update the backdrop last as the backdrop controller listens for some state
// changes like minimizing above which may also alter the backdrop.
aura::Window* backdrop_window = GetBackdropWindow(window_);
if (backdrop_window) {
backdrop_window->SetTransform(gfx::Transform());
backdrop_window->layer()->SetOpacity(1.f);
}
RemoveObserversAndStopTracking();
}
......
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