@@ -18,6 +18,7 @@ import QtQuick 2.4
1818import QtQuick.Window 2.2
1919import Unity.InputInfo 0.1
2020import Unity.Session 0.1
21+import Unity.Screens 0.1
2122import GSettings 1.0
2223import "Components"
2324import "Rotation"
@@ -78,6 +79,15 @@ Rectangle {
7879 deviceFilter: InputInfo.Keyboard
7980 }
8081
82+ InputDeviceModel {
83+ id: touchScreensModel
84+ deviceFilter: InputInfo.TouchScreen
85+ }
86+
87+ Screens {
88+ id: screens
89+ }
90+
8191 property int orientation
8292 onPhysicalOrientationChanged: {
8393 if (!orientationLocked) {
@@ -97,8 +107,7 @@ Rectangle {
97107 }
98108 // We need to manually update this on startup as the binding
99109 // below doesn't seem to have any effect at that stage
100− oskSettings.stayHidden = keyboardsModel.count > 0
101− oskSettings.disableHeight = shell.usageScenario == "desktop"
110+ oskSettings.disableHeight = !shell.oskEnabled || shell.usageScenario == "desktop"
102111 }
103112
104113 // we must rotate to a supported orientation regardless of shell's preference
@@ -106,17 +115,10 @@ Rectangle {
106115 (shell.orientation & supportedOrientations) === 0 ? true
107116 : shell.orientationChangesEnabled
108117
109−
110− Binding {
111− target: oskSettings
112− property: "stayHidden"
113− value: keyboardsModel.count > 0
114− }
115−
116118 Binding {
117119 target: oskSettings
118120 property: "disableHeight"
119− value: shell.usageScenario == "desktop"
121+ value: !shell.oskEnabled || shell.usageScenario == "desktop"
120122 }
121123
122124 readonly property int supportedOrientations: shell.supportedOrientations
@@ -189,6 +191,11 @@ Rectangle {
189191 nativeHeight: root.height
190192 mode: applicationArguments.mode
191193 hasMouse: miceModel.count + touchPadModel.count > 0
194+ // TODO: Factor in if the current screen is a touch screen and if the user wants to
195+ // have multiple keyboards around. For now we only enable one keyboard at a time
196+ // thus hiding it here if there is a physical one around or if we have a second
197+ // screen (the virtual touchpad & osk on the phone) attached.
198+ oskEnabled: keyboardsModel.count === 0 && screens.count === 1
192199
193200 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
194201 // what's the output device (eg: big TV, desktop monitor, phone display), etc.