Commit 00ae58a8 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Reset app list state on parent bounds change only if its bound change

We should not have to call AppListView::SetState with the current state
in ParentWindowBoundsChanged if the app list window bounds remained the
same. This avoids unnecessary work when display metrics change without
affecting app list window bounds (e.g. when work area is changed due
to a change in shelf height).

Change-Id: Ic9555d95ae4479a8310ecbe7a9ba6431d60c2503
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880450Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709501}
parent 78ba9045
...@@ -2117,9 +2117,14 @@ bool AppListView::CloseKeyboardIfVisible() { ...@@ -2117,9 +2117,14 @@ bool AppListView::CloseKeyboardIfVisible() {
} }
void AppListView::OnParentWindowBoundsChanged() { void AppListView::OnParentWindowBoundsChanged() {
const gfx::Rect new_target_bounds =
GetPreferredWidgetBoundsForState(app_list_state_);
aura::Window* window = GetWidget()->GetNativeView();
if (new_target_bounds == window->GetTargetBounds())
return;
// Set the widget size to fit the new display metrics. // Set the widget size to fit the new display metrics.
GetWidget()->GetNativeView()->SetBounds( GetWidget()->GetNativeView()->SetBounds(new_target_bounds);
GetPreferredWidgetBoundsForState(app_list_state_));
// Update the widget bounds to accomodate the new work // Update the widget bounds to accomodate the new work
// area. // area.
......
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