summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 23:21:56 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 23:21:56 +0000
commit3683adf58bcf7041346f00014c8f12405ae5ef9f (patch)
tree38eed840412df9f2af2d40283a40ff9175587c7b
parent128cb993ff3bea633db73624683d838a5e2981c6 (diff)
downloadchromium_src-3683adf58bcf7041346f00014c8f12405ae5ef9f.zip
chromium_src-3683adf58bcf7041346f00014c8f12405ae5ef9f.tar.gz
chromium_src-3683adf58bcf7041346f00014c8f12405ae5ef9f.tar.bz2
cros: Fix window rotation animation
If a user presses Ctrl-Alt-Shift-F3 repeated their windows can get stuck in a partially rotated state. The rotation animation chooses its target rotation and transform based on the values at the start of the animation. By default, if we trigger a new animation it immediately computes a new target based on the current values. Instead, queue the animations so we're sure things are back to neutral before starting a new one. BUG=154875 TEST=manual, hit Ctrl-Alt-Shift-F3 repeatedly and ensure windows end up in normal position Review URL: https://chromiumcodereview.appspot.com/11066085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160975 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/accelerators/accelerator_controller.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index bc742c7..7476342 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -185,6 +185,12 @@ bool HandleRotateWindows() {
for (size_t i = 0; i < controllers.size(); ++i) {
aura::Window* target = controllers[i]->GetContainer(
internal::kShellWindowId_DefaultContainer);
+ // The rotation animation bases its target transform on the current
+ // rotation and position. Since there could be an animation in progress
+ // right now, queue this animation so when it starts it picks up a neutral
+ // rotation and position. Use replace so we only enqueue one at a time.
+ target->layer()->GetAnimator()->
+ set_preemption_strategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
scoped_ptr<ui::LayerAnimationSequence> screen_rotation(
new ui::LayerAnimationSequence(new ash::ScreenRotation(360)));
target->layer()->GetAnimator()->StartAnimation(