on xenial help sign in
Always go to a supported orientation
16c546cDaniel d'Andrada
qml/OrientedShell.qml+6
@@ -76,6 +76,12 @@ Rectangle {
76 oskSettings.disableHeight = shell.usageScenario == "desktop"
76 oskSettings.disableHeight = shell.usageScenario == "desktop"
77 }
77 }
78
78
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+
79 Binding {
85 Binding {
80 target: oskSettings
86 target: oskSettings
81 property: "stayHidden"
87 property: "stayHidden"
qml/Rotation/RotationStates.qml+2−2
@@ -83,7 +83,7 @@ StateGroup {
83 }
83 }
84
84
85 function tryUpdateState() {
85 function tryUpdateState() {
86− if (d.transitioning || (!d.startingUp && !root.shell.orientationChangesEnabled)) {
86+ if (d.transitioning || (!d.startingUp && !root.orientedShell.orientationChangesEnabled)) {
87 return;
87 return;
88 }
88 }
89
89
@@ -95,7 +95,7 @@ StateGroup {
95 }
95 }
96
96
97 property Connections shellConnections: Connections {
97 property Connections shellConnections: Connections {
98− target: root.shell
98+ target: root.orientedShell
99 onOrientationChangesEnabledChanged: {
99 onOrientationChangesEnabledChanged: {
100 d.tryUpdateState();
100 d.tryUpdateState();
101 }
101 }