on xenial help sign in
fix it, update tests
commit4d27450bf293df6124dcc8095e8aefb57d30159e authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 2 Dec 2015, 11:34 (11 years ago) parentdb6f235
4 files changed+16−11
qml/Components/InputMethod.qml+1−1 qml/OrientedShell.qml+3−4 qml/Shell.qml+1−1 tests/qmltests/tst_OrientedShell.qml+11−5
qml/Components/InputMethod.qml+1−1
@@ -59,7 +59,7 @@ Item {
5959 }
6060
6161 state: {
62− if (surfaceItem.surface && surfaceItem.surfaceState != Mir.MinimizedState) {
62+ if (surfaceItem.surface && surfaceItem.surfaceState != Mir.MinimizedState && root.enabled) {
6363 return "shown";
6464 } else {
6565 return "hidden";
qml/OrientedShell.qml+3−4
@@ -107,8 +107,7 @@ Rectangle {
107107 }
108108 // We need to manually update this on startup as the binding
109109 // below doesn't seem to have any effect at that stage
110− oskSettings.stayHidden = keyboardsModel.count > 0
111− oskSettings.disableHeight = shell.usageScenario == "desktop"
110+ oskSettings.disableHeight = !shell.oskEnabled || shell.usageScenario == "desktop"
112111 }
113112
114113 // we must rotate to a supported orientation regardless of shell's preference
@@ -119,7 +118,7 @@ Rectangle {
119118 Binding {
120119 target: oskSettings
121120 property: "disableHeight"
122− value: shell.usageScenario == "desktop"
121+ value: !shell.oskEnabled || shell.usageScenario == "desktop"
123122 }
124123
125124 readonly property int supportedOrientations: shell.supportedOrientations
@@ -196,7 +195,7 @@ Rectangle {
196195 // have multiple keyboards around. For now we only enable one keyboard at a time
197196 // thus hiding it here if there is a physical one around or if we have a second
198197 // screen (the virtual touchpad & osk on the phone) attached.
199− oskVisible: keyboardsModel.count === 0 && screens.count === 1
198+ oskEnabled: keyboardsModel.count === 0 && screens.count === 1
200199
201200 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
202201 // what's the output device (eg: big TV, desktop monitor, phone display), etc.
qml/Shell.qml+1−1
@@ -57,7 +57,7 @@ Item {
5757 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"
5858 property string mode: "full-greeter"
5959 property bool cursorVisible: false
60− property alias oskVisible: inputMethod.visible
60+ property alias oskEnabled: inputMethod.enabled
6161 function updateFocusedAppOrientation() {
6262 applicationsDisplayLoader.item.updateFocusedAppOrientation();
6363 }
tests/qmltests/tst_OrientedShell.qml+11−5
@@ -1002,25 +1002,31 @@ Rectangle {
10021002
10031003 loadShell("mako")
10041004 var shell = findChild(orientedShell, "shell");
1005+ var inputMethod = findChild(shell, "inputMethod");
10051006
10061007 tryCompare(shell, "usageScenario", "phone");
1007− tryCompare(mockOskSettings, "stayHidden", false);
1008+ tryCompare(inputMethod, "enabled", true);
1009+ tryCompare(mockOskSettings, "disableHeight", false);
10081010
10091011 MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
10101012 tryCompare(shell, "usageScenario", "phone");
1011− tryCompare(mockOskSettings, "stayHidden", true);
1013+ tryCompare(inputMethod, "enabled", false);
1014+ tryCompare(mockOskSettings, "disableHeight", true);
10121015
10131016 MockInputDeviceBackend.addMockDevice("/mouse0", InputInfo.Mouse);
10141017 tryCompare(shell, "usageScenario", "desktop");
1015− tryCompare(mockOskSettings, "stayHidden", true);
1018+ tryCompare(inputMethod, "enabled", false);
1019+ tryCompare(mockOskSettings, "disableHeight", true);
10161020
10171021 MockInputDeviceBackend.removeDevice("/kbd0");
10181022 tryCompare(shell, "usageScenario", "desktop");
1019− tryCompare(mockOskSettings, "stayHidden", false);
1023+ tryCompare(inputMethod, "enabled", true);
1024+ tryCompare(mockOskSettings, "disableHeight", true); // Still in windowed mode
10201025
10211026 MockInputDeviceBackend.removeDevice("/mouse0");
10221027 tryCompare(shell, "usageScenario", "phone");
1023− tryCompare(mockOskSettings, "stayHidden", false);
1028+ tryCompare(inputMethod, "enabled", true);
1029+ tryCompare(mockOskSettings, "disableHeight", false);
10241030
10251031 MockInputDeviceBackend.addMockDevice("/touchpad0", InputInfo.TouchPad);
10261032 tryCompare(shell, "usageScenario", "desktop");