OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 work_area_ = ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_->parent()); | 206 work_area_ = ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_->parent()); |
207 BaseLayoutManager::AdjustAllWindowsBoundsForWorkAreaChange(reason); | 207 BaseLayoutManager::AdjustAllWindowsBoundsForWorkAreaChange(reason); |
208 } | 208 } |
209 | 209 |
210 void WorkspaceLayoutManager::AdjustWindowBoundsForWorkAreaChange( | 210 void WorkspaceLayoutManager::AdjustWindowBoundsForWorkAreaChange( |
211 Window* window, | 211 Window* window, |
212 AdjustWindowReason reason) { | 212 AdjustWindowReason reason) { |
213 if (!GetTrackedByWorkspace(window)) | 213 if (!GetTrackedByWorkspace(window)) |
214 return; | 214 return; |
215 | 215 |
216 // Use cross fade transition for the maximized window if the adjustment | 216 // Do not cross fade here: the window's layer hierarchy may be messed up for |
217 // happens due to the shelf's visibility change. Otherwise the background | 217 // the transition between mirroring and extended. See also: crbug.com/267698 |
218 // can be seen slightly between the bottom edge of resized-window and | 218 // TODO(oshima): Differentiate display change and shelf visibility change, and |
219 // the animating shelf. | 219 // bring back CrossFade animation. |
220 // TODO(mukai): this cause slight blur at the window frame because of the | |
221 // cross fade. I think this is better, but should reconsider if someone | |
222 // raises voice for this. | |
223 if (wm::IsWindowMaximized(window) && | 220 if (wm::IsWindowMaximized(window) && |
224 reason == ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED) { | 221 reason == ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED) { |
225 CrossFadeToBounds(window, ScreenAsh::GetMaximizedWindowBoundsInParent( | 222 SetChildBoundsDirect(window, ScreenAsh::GetMaximizedWindowBoundsInParent( |
226 window->parent()->parent())); | 223 window->parent()->parent())); |
227 return; | 224 return; |
228 } | 225 } |
229 | 226 |
230 if (SetMaximizedOrFullscreenBounds(window)) | 227 if (SetMaximizedOrFullscreenBounds(window)) |
231 return; | 228 return; |
232 | 229 |
233 gfx::Rect bounds = window->bounds(); | 230 gfx::Rect bounds = window->bounds(); |
234 switch (reason) { | 231 switch (reason) { |
235 case ADJUST_WINDOW_DISPLAY_SIZE_CHANGED: | 232 case ADJUST_WINDOW_DISPLAY_SIZE_CHANGED: |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 SetChildBoundsDirect( | 357 SetChildBoundsDirect( |
361 window, | 358 window, |
362 ScreenAsh::GetDisplayBoundsInParent(window->parent()->parent())); | 359 ScreenAsh::GetDisplayBoundsInParent(window->parent()->parent())); |
363 return true; | 360 return true; |
364 } | 361 } |
365 return false; | 362 return false; |
366 } | 363 } |
367 | 364 |
368 } // namespace internal | 365 } // namespace internal |
369 } // namespace ash | 366 } // namespace ash |
OLD | NEW |