Commit d52a9885 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Fix homecher with docked magnifier in tablet mode

HomeLauncherGestureHandler used to send the work area's y position as
the max y position of the AppListView in an attempt to modify the work
area. AppListView already accounts for work area changes. This bug went
unnoticed until HomeLauncherGestureHandler had to deal with the
workspace being shrunk from the top via the DockedMagnifier.

Now, send 0 instead of the work area y position to AppListView and let
AppListView handle the work area change.

Also translate based on the keyboard being shown/hidden to prevent
search results from being pushed off screen with docked magnifier
enabled.

TEST=manually tested with multiple display configurations

Bug: 936381
Change-Id: I4de62a0f239a72ba69256f5561c7bfb10035a870
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504434
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638220}
parent 6dbb276f
...@@ -458,9 +458,8 @@ void HomeLauncherGestureHandler::OnImplicitAnimationsCompleted() { ...@@ -458,9 +458,8 @@ void HomeLauncherGestureHandler::OnImplicitAnimationsCompleted() {
// Return the app list to its original opacity and transform without // Return the app list to its original opacity and transform without
// animation. // animation.
DCHECK(display_.is_valid());
app_list_controller_->presenter()->UpdateYPositionAndOpacityForHomeLauncher( app_list_controller_->presenter()->UpdateYPositionAndOpacityForHomeLauncher(
display_.work_area().y(), app_list_opacity, base::NullCallback()); 0, app_list_opacity, base::NullCallback());
if (!window1_) { if (!window1_) {
RemoveObserversAndStopTracking(); RemoveObserversAndStopTracking();
...@@ -550,8 +549,8 @@ void HomeLauncherGestureHandler::UpdateWindows(double progress, bool animate) { ...@@ -550,8 +549,8 @@ void HomeLauncherGestureHandler::UpdateWindows(double progress, bool animate) {
// Update full screen applist. // Update full screen applist.
DCHECK(display_.is_valid()); DCHECK(display_.is_valid());
const gfx::Rect work_area = display_.work_area(); const gfx::Rect work_area = display_.work_area();
const int y_position = const int y_position = gfx::Tween::IntValueBetween(
gfx::Tween::IntValueBetween(progress, work_area.bottom(), work_area.y()); progress, work_area.bottom(), display_.bounds().y());
const float opacity = gfx::Tween::FloatValueBetween(progress, 0.f, 1.f); const float opacity = gfx::Tween::FloatValueBetween(progress, 0.f, 1.f);
app_list_controller_->presenter()->UpdateYPositionAndOpacityForHomeLauncher( app_list_controller_->presenter()->UpdateYPositionAndOpacityForHomeLauncher(
y_position, opacity, y_position, opacity,
......
...@@ -1630,7 +1630,8 @@ void AppListView::OnScreenKeyboardShown(bool shown) { ...@@ -1630,7 +1630,8 @@ void AppListView::OnScreenKeyboardShown(bool shown) {
} else { } else {
// If the keyboard is closing or a folder isn't being shown, reset // If the keyboard is closing or a folder isn't being shown, reset
// the app list's position // the app list's position
OffsetYPositionOfAppList(0); const int work_area_offset = GetDisplayNearestView().work_area().y();
OffsetYPositionOfAppList(shown ? work_area_offset : -work_area_offset);
} }
} }
......
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