on xenial help sign in
Always go to a supported orientation
commit16c546c4ab4db6bc4f7a36f8eafbbd879721d9df authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateMon 5 Oct 2015, 16:15 (11 years ago) parent33ca088
2 files changed+8−2
qml/OrientedShell.qml+6 qml/Rotation/RotationStates.qml+2−2
qml/OrientedShell.qml+6
@@ -76,6 +76,12 @@ Rectangle {
7676 oskSettings.disableHeight = shell.usageScenario == "desktop"
7777 }
7878
79+ // we must rotate to a supported orientation regardless of shell's preference
80+ property bool orientationChangesEnabled:
81+ (orientation & supportedOrientations) === 0 ? true
82+ : shell.orientationChangesEnabled
83+
84+
7985 Binding {
8086 target: oskSettings
8187 property: "stayHidden"
qml/Rotation/RotationStates.qml+2−2
@@ -83,7 +83,7 @@ StateGroup {
8383 }
8484
8585 function tryUpdateState() {
86− if (d.transitioning || (!d.startingUp && !root.shell.orientationChangesEnabled)) {
86+ if (d.transitioning || (!d.startingUp && !root.orientedShell.orientationChangesEnabled)) {
8787 return;
8888 }
8989
@@ -95,7 +95,7 @@ StateGroup {
9595 }
9696
9797 property Connections shellConnections: Connections {
98− target: root.shell
98+ target: root.orientedShell
9999 onOrientationChangesEnabledChanged: {
100100 d.tryUpdateState();
101101 }