Commit 257a3c19 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

overview: Fix crash when double tap launcher button in overview mode.

Do not allow to show launcher if overview is still animating.

Test: manual
Bug: 905527
Change-Id: I1bc188600d038d4f2df20c224910ae10a8b61e59
Reviewed-on: https://chromium-review.googlesource.com/c/1338235Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608661}
parent 84f4f5e0
......@@ -567,6 +567,14 @@ bool HomeLauncherGestureHandler::IsAnimating() {
return true;
}
if (Shell::Get()->window_selector_controller()->IsSelecting() &&
Shell::Get()
->window_selector_controller()
->window_selector()
->IsWindowGridAnimating()) {
return true;
}
return false;
}
......
......@@ -232,14 +232,16 @@ class ASH_EXPORT WindowGrid : public aura::WindowObserver,
const gfx::Rect bounds() const { return bounds_; }
views::Widget* drop_target_widget_for_testing() {
return drop_target_widget_.get();
}
bool should_animate_when_exiting() const {
return should_animate_when_exiting_;
}
views::Widget* shield_widget() { return shield_widget_.get(); }
views::Widget* drop_target_widget_for_testing() {
return drop_target_widget_.get();
}
private:
class ShieldView;
friend class WindowSelectorTest;
......
......@@ -756,6 +756,19 @@ void WindowSelector::OnStartingAnimationComplete(bool canceled) {
}
}
bool WindowSelector::IsWindowGridAnimating() {
for (auto& grid : grid_list_) {
if (grid->shield_widget()
->GetNativeWindow()
->layer()
->GetAnimator()
->is_animating()) {
return true;
}
}
return false;
}
void WindowSelector::OnDisplayRemoved(const display::Display& display) {
// TODO(flackr): Keep window selection active on remaining displays.
CancelSelection();
......
......@@ -220,6 +220,10 @@ class ASH_EXPORT WindowSelector : public display::DisplayObserver,
// Called when the overview mode starting animation completes.
void OnStartingAnimationComplete(bool canceled);
// Returns true if any of the grids in |grid_list_| shield widgets are still
// animating.
bool IsWindowGridAnimating();
WindowSelectorDelegate* delegate() { return delegate_; }
SplitViewDragIndicators* split_view_drag_indicators() {
......
......@@ -610,7 +610,6 @@ void WindowSelectorItem::UpdateYPositionAndOpacity(
for (auto& layer_and_offset : animation_layers_and_offsets) {
ui::Layer* layer = layer_and_offset.first;
layer->GetAnimator()->StopAnimating();
std::unique_ptr<ui::ScopedLayerAnimationSettings> settings;
if (!callback.is_null()) {
settings = std::make_unique<ui::ScopedLayerAnimationSettings>(
......
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