Commit f1ba9cd4 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

wm: Fix backdrop showing up when swiping down an ARC app.

I didn't find out the exact cause, but something about the ARC app was
updating the backdrop many times during the course of a swipe, and was
probably creating a new one which did not have an transform or opacity
changes. This happens for regular windows as well, so instead, pause
updates during a home launcher drag.

Test: manual
Bug: 1018125
Change-Id: I1d933921f8c17410fb6a8c81f96c94e93fc59955
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1884578Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711035}
parent 2b1c1d8b
......@@ -9,6 +9,8 @@
#include "ash/accessibility/accessibility_controller_impl.h"
#include "ash/accessibility/accessibility_delegate.h"
#include "ash/home_screen/home_launcher_gesture_handler.h"
#include "ash/home_screen/home_screen_controller.h"
#include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_animation_types.h"
......@@ -130,10 +132,17 @@ BackdropController::BackdropController(aura::Window* container)
shell->accessibility_controller()->AddObserver(this);
shell->wallpaper_controller()->AddObserver(this);
shell->tablet_mode_controller()->AddObserver(this);
shell->home_screen_controller()->home_launcher_gesture_handler()->AddObserver(
this);
}
BackdropController::~BackdropController() {
auto* shell = Shell::Get();
if (shell->home_screen_controller()) {
shell->home_screen_controller()
->home_launcher_gesture_handler()
->RemoveObserver(this);
}
// Shell destroys the TabletModeController before destroying all root windows.
if (shell->tablet_mode_controller())
shell->tablet_mode_controller()->RemoveObserver(this);
......@@ -272,6 +281,18 @@ void BackdropController::OnTabletModeEnded() {
UpdateBackdrop();
}
void BackdropController::OnHomeLauncherTargetPositionChanged(
bool showing,
int64_t display_id) {
pause_update_ = true;
}
void BackdropController::OnHomeLauncherAnimationComplete(bool shown,
int64_t display_id) {
pause_update_ = false;
UpdateBackdrop();
}
void BackdropController::UpdateBackdropInternal() {
// Skip the recursive updates.
if (pause_update_)
......
......@@ -9,6 +9,7 @@
#include "ash/accessibility/accessibility_observer.h"
#include "ash/ash_export.h"
#include "ash/home_screen/home_launcher_gesture_handler_observer.h"
#include "ash/public/cpp/tablet_mode_observer.h"
#include "ash/public/cpp/wallpaper_controller_observer.h"
#include "ash/public/cpp/window_properties.h"
......@@ -41,11 +42,13 @@ namespace ash {
// 3) In tablet mode:
// - Bottom-most snapped window in splitview,
// - Top-most activatable window if splitview is inactive.
class ASH_EXPORT BackdropController : public AccessibilityObserver,
public OverviewObserver,
public SplitViewObserver,
public WallpaperControllerObserver,
public TabletModeObserver {
class ASH_EXPORT BackdropController
: public AccessibilityObserver,
public OverviewObserver,
public SplitViewObserver,
public WallpaperControllerObserver,
public TabletModeObserver,
public HomeLauncherGestureHandlerObserver {
public:
explicit BackdropController(aura::Window* container);
~BackdropController() override;
......@@ -90,6 +93,11 @@ class ASH_EXPORT BackdropController : public AccessibilityObserver,
void OnTabletModeStarted() override;
void OnTabletModeEnded() override;
// HomeLauncherGestureHandlerObserver:
void OnHomeLauncherTargetPositionChanged(bool showing,
int64_t display_id) override;
void OnHomeLauncherAnimationComplete(bool shown, int64_t display_id) override;
private:
friend class WorkspaceControllerTestApi;
......
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