diff options
author | abodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-22 08:35:09 +0000 |
---|---|---|
committer | abodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-22 08:35:09 +0000 |
commit | 3f1b39eab10d8dcfb8764356627afb72f9565676 (patch) | |
tree | d5f07a0f9992c136fc061a08038633e6ec8fcb07 /ash/shelf | |
parent | a9438d37ac11f96430eb64ddcf8e963817ac64de (diff) | |
download | chromium_src-3f1b39eab10d8dcfb8764356627afb72f9565676.zip chromium_src-3f1b39eab10d8dcfb8764356627afb72f9565676.tar.gz chromium_src-3f1b39eab10d8dcfb8764356627afb72f9565676.tar.bz2 |
Fixed incorrect resize of docked windows when locking screen.
Switches updating of state_.is_screen_locked to push rather than pull.
is_screen_locked is set when the lock animation starts and unset when
OnLockStateChanged is called with locked unset.
If is_screen_locked is set avoid generating notifications about inset
changes.
BUG=338377
Review URL: https://codereview.chromium.org/175473003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf')
-rw-r--r-- | ash/shelf/shelf_layout_manager.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index b1fcb8f..799c79e 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc @@ -556,6 +556,7 @@ void ShelfLayoutManager::SetChildBounds(aura::Window* child, void ShelfLayoutManager::OnLockStateChanged(bool locked) { // Force the shelf to layout for alignment (bottom if locked, restore // the previous alignment otherwise). + state_.is_screen_locked = locked; shelf_->SetAlignment(locked ? SHELF_ALIGNMENT_BOTTOM : alignment_); UpdateVisibilityState(); LayoutShelf(); @@ -590,8 +591,6 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) { State state; state.visibility_state = visibility_state; state.auto_hide_state = CalculateAutoHideState(visibility_state); - state.is_screen_locked = - Shell::GetInstance()->session_state_delegate()->IsScreenLocked(); state.window_state = workspace_controller_ ? workspace_controller_->GetWindowState() : WORKSPACE_WINDOW_STATE_DEFAULT; @@ -721,8 +720,10 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity( ScreenUtil::ConvertRectToScreen( shelf_->status_area_widget()->GetNativeView()->parent(), status_bounds)); - Shell::GetInstance()->SetDisplayWorkAreaInsets( - root_window_, target_bounds.work_area_insets); + if (!state_.is_screen_locked) { + Shell::GetInstance()->SetDisplayWorkAreaInsets( + root_window_, target_bounds.work_area_insets); + } } void ShelfLayoutManager::StopAnimating() { @@ -1147,6 +1148,9 @@ void ShelfLayoutManager::OnDockBoundsChanging( void ShelfLayoutManager::OnLockStateEvent(LockStateObserver::EventType event) { if (event == EVENT_LOCK_ANIMATION_STARTED) { + // Enter the screen locked state as the animation starts to prevent + // layout changes as the screen locks. + state_.is_screen_locked = true; // Hide the status area widget (using auto hide animation). base::AutoReset<ShelfVisibilityState> state(&state_.visibility_state, SHELF_HIDDEN); |