Commit 6e843f40 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix fullscreen app list bounds issue

Changes:
Use the relative y of work area to display bounds to set fullscreen app
list bounds. This fixes the app list bounds in non-primary displays.

BUG=828207

Change-Id: I2bf2ebc49c617240ef9df869020c95996ef18e3f
Reviewed-on: https://chromium-review.googlesource.com/998517Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548568}
parent f7ab0df5
...@@ -1099,7 +1099,8 @@ void AppListView::StartAnimationForState(AppListViewState target_state) { ...@@ -1099,7 +1099,8 @@ void AppListView::StartAnimationForState(AppListViewState target_state) {
if (is_side_shelf_) if (is_side_shelf_)
return; return;
const int display_height = GetDisplayNearestView().size().height(); const display::Display display = GetDisplayNearestView();
const int display_height = display.size().height();
int target_state_y = 0; int target_state_y = 0;
switch (target_state) { switch (target_state) {
...@@ -1114,7 +1115,7 @@ void AppListView::StartAnimationForState(AppListViewState target_state) { ...@@ -1114,7 +1115,7 @@ void AppListView::StartAnimationForState(AppListViewState target_state) {
// The ChromeVox panel as well as the Docked Magnifier viewport affect the // The ChromeVox panel as well as the Docked Magnifier viewport affect the
// workarea of the display. We need to account for that when applist is in // workarea of the display. We need to account for that when applist is in
// fullscreen to avoid being shown below them. // fullscreen to avoid being shown below them.
target_state_y = GetDisplayNearestView().work_area().y(); target_state_y = display.work_area().y() - display.bounds().y();
break; break;
case AppListViewState::CLOSED: case AppListViewState::CLOSED:
...@@ -1142,7 +1143,7 @@ void AppListView::StartAnimationForState(AppListViewState target_state) { ...@@ -1142,7 +1143,7 @@ void AppListView::StartAnimationForState(AppListViewState target_state) {
} }
if (fullscreen_widget_->GetNativeView()->bounds().y() == if (fullscreen_widget_->GetNativeView()->bounds().y() ==
GetDisplayNearestView().work_area().bottom()) { display.work_area().bottom()) {
// If the animation start position is the bottom of the screen activate the // If the animation start position is the bottom of the screen activate the
// fade in animation. // fade in animation.
app_list_main_view_->contents_view()->FadeInOnOpen( app_list_main_view_->contents_view()->FadeInOnOpen(
......
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