on xenial help sign in
fix it, update tests
4d27450Michael Zanetti
qml/Components/InputMethod.qml+1−1
@@ -59,7 +59,7 @@ Item {
59 }
59 }
60
60
61 state: {
61 state: {
62− if (surfaceItem.surface && surfaceItem.surfaceState != Mir.MinimizedState) {
62+ if (surfaceItem.surface && surfaceItem.surfaceState != Mir.MinimizedState && root.enabled) {
63 return "shown";
63 return "shown";
64 } else {
64 } else {
65 return "hidden";
65 return "hidden";
qml/OrientedShell.qml+3−4
@@ -107,8 +107,7 @@ Rectangle {
107 }
107 }
108 // We need to manually update this on startup as the binding
108 // We need to manually update this on startup as the binding
109 // below doesn't seem to have any effect at that stage
109 // 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"
112 }
111 }
113
112
114 // we must rotate to a supported orientation regardless of shell's preference
113 // we must rotate to a supported orientation regardless of shell's preference
@@ -119,7 +118,7 @@ Rectangle {
119 Binding {
118 Binding {
120 target: oskSettings
119 target: oskSettings
121 property: "disableHeight"
120 property: "disableHeight"
122− value: shell.usageScenario == "desktop"
121+ value: !shell.oskEnabled || shell.usageScenario == "desktop"
123 }
122 }
124
123
125 readonly property int supportedOrientations: shell.supportedOrientations
124 readonly property int supportedOrientations: shell.supportedOrientations
@@ -196,7 +195,7 @@ Rectangle {
196 // have multiple keyboards around. For now we only enable one keyboard at a time
195 // have multiple keyboards around. For now we only enable one keyboard at a time
197 // thus hiding it here if there is a physical one around or if we have a second
196 // thus hiding it here if there is a physical one around or if we have a second
198 // screen (the virtual touchpad & osk on the phone) attached.
197 // 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
200
199
201 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
200 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
202 // what's the output device (eg: big TV, desktop monitor, phone display), etc.
201 // what's the output device (eg: big TV, desktop monitor, phone display), etc.
qml/Shell.qml+1−1
@@ -57,7 +57,7 @@ Item {
57 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"
57 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"
58 property string mode: "full-greeter"
58 property string mode: "full-greeter"
59 property bool cursorVisible: false
59 property bool cursorVisible: false
60− property alias oskVisible: inputMethod.visible
60+ property alias oskEnabled: inputMethod.enabled
61 function updateFocusedAppOrientation() {
61 function updateFocusedAppOrientation() {
62 applicationsDisplayLoader.item.updateFocusedAppOrientation();
62 applicationsDisplayLoader.item.updateFocusedAppOrientation();
63 }
63 }
tests/qmltests/tst_OrientedShell.qml+11−5
@@ -1002,25 +1002,31 @@ Rectangle {
1002
1002
1003 loadShell("mako")
1003 loadShell("mako")
1004 var shell = findChild(orientedShell, "shell");
1004 var shell = findChild(orientedShell, "shell");
1005+ var inputMethod = findChild(shell, "inputMethod");
1005
1006
1006 tryCompare(shell, "usageScenario", "phone");
1007 tryCompare(shell, "usageScenario", "phone");
1008+ tryCompare(inputMethod, "enabled", true);
1007− tryCompare(mockOskSettings, "stayHidden", false);
1009+ tryCompare(mockOskSettings, "disableHeight", false);
1008
1010
1009 MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
1011 MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
1010 tryCompare(shell, "usageScenario", "phone");
1012 tryCompare(shell, "usageScenario", "phone");
1013+ tryCompare(inputMethod, "enabled", false);
1011− tryCompare(mockOskSettings, "stayHidden", true);
1014+ tryCompare(mockOskSettings, "disableHeight", true);
1012
1015
1013 MockInputDeviceBackend.addMockDevice("/mouse0", InputInfo.Mouse);
1016 MockInputDeviceBackend.addMockDevice("/mouse0", InputInfo.Mouse);
1014 tryCompare(shell, "usageScenario", "desktop");
1017 tryCompare(shell, "usageScenario", "desktop");
1018+ tryCompare(inputMethod, "enabled", false);
1015− tryCompare(mockOskSettings, "stayHidden", true);
1019+ tryCompare(mockOskSettings, "disableHeight", true);
1016
1020
1017 MockInputDeviceBackend.removeDevice("/kbd0");
1021 MockInputDeviceBackend.removeDevice("/kbd0");
1018 tryCompare(shell, "usageScenario", "desktop");
1022 tryCompare(shell, "usageScenario", "desktop");
1019− tryCompare(mockOskSettings, "stayHidden", false);
1023+ tryCompare(inputMethod, "enabled", true);
1024+ tryCompare(mockOskSettings, "disableHeight", true); // Still in windowed mode
1020
1025
1021 MockInputDeviceBackend.removeDevice("/mouse0");
1026 MockInputDeviceBackend.removeDevice("/mouse0");
1022 tryCompare(shell, "usageScenario", "phone");
1027 tryCompare(shell, "usageScenario", "phone");
1028+ tryCompare(inputMethod, "enabled", true);
1023− tryCompare(mockOskSettings, "stayHidden", false);
1029+ tryCompare(mockOskSettings, "disableHeight", false);
1024
1030
1025 MockInputDeviceBackend.addMockDevice("/touchpad0", InputInfo.TouchPad);
1031 MockInputDeviceBackend.addMockDevice("/touchpad0", InputInfo.TouchPad);
1026 tryCompare(shell, "usageScenario", "desktop");
1032 tryCompare(shell, "usageScenario", "desktop");