on xenial help sign in
Fix missing screenshot when orientation changes while shell rotation ongoing

- Device orientation changes - Shell starts rotating - Device orientation changes again - Shell finishes rotation - A new shell rotation starts to match that new device orientation On that second rotation, the screenshot would be missing. That's because UpdateShellTransformations was using requestedOrientationAngle directly, which is wrong for all but the ImmediateRotationAction. This is a regression caused by revision 2378 "Ensure shell transformations use bindings as OrientedShell can get resized" (LP: #1587796)

commita53d87523f37d151361dac44b569fbfcb13d4777 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateMon 27 Jun 2016, 18:43 (10 years ago) parentfde5775a72da1d
4 files changed+7−7
qml/Rotation/HalfLoopRotationAnimation.qml+1−1 qml/Rotation/ImmediateRotationAction.qml+1−1 qml/Rotation/NinetyRotationAnimation.qml+1−1 qml/Rotation/UpdateShellTransformations.qml+4−4
qml/Rotation/HalfLoopRotationAnimation.qml+1−1
@@ -42,6 +42,6 @@ SequentialAnimation {
4242 from: root.fromAngle; to: root.toAngle
4343 duration: rotationDuration; easing.type: rotationEasing
4444 }
45− UpdateShellTransformations { info: root.info; shell: root.shell }
45+ UpdateShellTransformations { shell: root.shell; rotationAngle: root.toAngle }
4646 ScriptAction { script: { info.transitioning = false; } }
4747}
qml/Rotation/ImmediateRotationAction.qml+1−1
@@ -25,7 +25,7 @@ SequentialAnimation {
2525 root.info.transitioning = true;
2626 } }
2727
28− UpdateShellTransformations { info: root.info; shell: root.shell }
28+ UpdateShellTransformations { shell: root.shell; rotationAngle: root.info.requestedOrientationAngle }
2929
3030 ScriptAction { script: {
3131 root.shell.updateFocusedAppOrientation();
qml/Rotation/NinetyRotationAnimation.qml+1−1
@@ -78,7 +78,7 @@ SequentialAnimation {
7878 duration: rotationDuration; easing.type: rotationEasing
7979 }
8080 }
81− UpdateShellTransformations { info: root.info; shell: root.shell }
81+ UpdateShellTransformations { shell: root.shell; rotationAngle: root.toAngle }
8282 ScriptAction { script: {
8383 shellSnapshot.visible = false;
8484 shellSnapshot.discard();
qml/Rotation/UpdateShellTransformations.qml+4−4
@@ -17,16 +17,16 @@
1717import QtQuick 2.4
1818
1919ScriptAction {
20− property var info
2120 property var shell
21+ property int rotationAngle
2222
2323 script: {
24− shell.orientationAngle = info.requestedOrientationAngle;
25− shell.transformRotationAngle = info.requestedOrientationAngle;
24+ shell.orientationAngle = rotationAngle;
25+ shell.transformRotationAngle = rotationAngle;
2626
2727 // They must all be bindings as orientedShell's size can change
2828
29− if (info.requestedOrientationAngle === 90 || info.requestedOrientationAngle === 270) {
29+ if (rotationAngle === 90 || rotationAngle === 270) {
3030 shell.width = Qt.binding(function() { return orientedShell.height; });
3131 shell.height = Qt.binding(function() { return orientedShell.width; });
3232 } else {