Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2712)

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 175473003: Fixed incorrect resize of docked windows when locking screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 1639fc80e812edf80949959d4ab208069256afb2..b39140812c060e9f3801684e8278e5fe7a278b93 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698