Chromium Code Reviews| Index: ash/wm/window_animations.cc |
| diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc |
| index 3d195aec4e2abc2d1ef504da1dfa2d2ca1cf9657..934cca528319639f8c3cd07a516b62cd441df173 100644 |
| --- a/ash/wm/window_animations.cc |
| +++ b/ash/wm/window_animations.cc |
| @@ -467,8 +467,8 @@ gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { |
| // position in the launcher and the major dimension are still reported |
| // correctly and the window can be animated to the launcher item's light |
| // bar. |
| + ShelfLayoutManager* layout_manager = ShelfLayoutManager::ForShelf(window); |
| if (item_rect.width() != 0 || item_rect.height() != 0) { |
| - ShelfLayoutManager* layout_manager = ShelfLayoutManager::ForShelf(window); |
| if (layout_manager->visibility_state() == SHELF_AUTO_HIDE) { |
| gfx::Rect shelf_bounds = shelf->shelf_widget()->GetWindowBoundsInScreen(); |
| switch (layout_manager->GetAlignment()) { |
| @@ -489,11 +489,23 @@ gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { |
| } |
| } |
| - // Assume the shelf is overflowed, zoom off to the bottom right of the |
| - // work area. |
| + // Assuming that there is no visible icon of that shelf item, we zoom back to |
| + // the location of the application launcher (which is fixed as first item of |
| + // the shelf). |
| gfx::Rect work_area = |
| Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
| - return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); |
| + switch (layout_manager->GetAlignment()) { |
| + case SHELF_ALIGNMENT_BOTTOM: |
| + return gfx::Rect(work_area.x(), work_area.bottom(), 0, 0); |
|
flackr
2014/05/28 18:34:00
I believe this is assuming an LTR language but wou
Mr4D (OOO till 08-26)
2014/05/28 21:50:41
Good catch. Addressed.
|
| + case SHELF_ALIGNMENT_TOP: |
| + // Fall through. |
| + case SHELF_ALIGNMENT_LEFT: |
| + return gfx::Rect(work_area.x(), work_area.y(), 0, 0); |
| + case SHELF_ALIGNMENT_RIGHT: |
| + return gfx::Rect(work_area.right(), work_area.y(), 0, 0); |
| + } |
|
flackr
2014/05/28 18:34:00
I think it would make more sense if GetScreenBound
Mr4D (OOO till 08-26)
2014/05/28 21:50:41
kuscher wanted to have all "unassociateable window
|
| + NOTREACHED(); |
| + return gfx::Rect(); |
| } |
| } // namespace ash |