@@ -79,26 +79,25 @@ Rectangle {
79 InputDeviceModel {
79 InputDeviceModel {
80 id: keyboardsModel
80 id: keyboardsModel
81 deviceFilter: InputInfo.Keyboard
81 deviceFilter: InputInfo.Keyboard
82− property int oldCount: 0
85+ id: touchScreensModel
86+ deviceFilter: InputInfo.TouchScreen
84− readonly property int physicalInputDevices: miceModel.count + keyboardsModel.count + touchPadModel.count
89+ readonly property int pointerInputDevices: miceModel.count + touchPadModel.count
85− onPhysicalInputDevicesChanged: {
90+ onPointerInputDevicesChanged: {
86− console.log("Input devices changed:", physicalInputDevices, "current mode:", root.unity8Settings.usageMode, "old device count", miceModel.oldCount + touchPadModel.oldCount + keyboardsModel.oldCount)
91+ console.log("Pointer input devices changed:", pointerInputDevices, "current mode:", root.unity8Settings.usageMode, "old device count", miceModel.oldCount + touchPadModel.oldCount)
87 if (root.unity8Settings.usageMode === "Windowed") {
92 if (root.unity8Settings.usageMode === "Windowed") {
88− if (physicalInputDevices === 0) {
93+ if (pointerInputDevices === 0) {
89− // All devices have been unplugged. Move to staged.
94+ // All pointer devices have been unplugged. Move to staged.
90 root.unity8Settings.usageMode = "Staged";
95 root.unity8Settings.usageMode = "Staged";
93 var longEdgeWidth = Math.max(root.width, root.height)
98 var longEdgeWidth = Math.max(root.width, root.height)
94− if (longEdgeWidth > units.gu(120)) {
99+ if (longEdgeWidth > units.gu(90)){
95− if (keyboardsModel.count + miceModel.count + touchPadModel.count > 0 &&
96− physicalInputDevices > miceModel.oldCount + touchPadModel.oldCount + keyboardsModel.oldCount) {
97− root.unity8Settings.usageMode = "Windowed"
99− } else if (longEdgeWidth > units.gu(90)){
100− if (miceModel.count + touchPadModel.count > 0 &&
101− miceModel.count + touchPadModel.count > miceModel.oldCount + touchPadModel.oldCount) {
100+ if (pointerInputDevices > 0 && pointerInputDevices > miceModel.oldCount + touchPadModel.oldCount) {
102 root.unity8Settings.usageMode = "Windowed";
101 root.unity8Settings.usageMode = "Windowed";
@@ -108,12 +107,6 @@ Rectangle {
109 miceModel.oldCount = miceModel.count;
108 miceModel.oldCount = miceModel.count;
110 touchPadModel.oldCount = touchPadModel.count;
109 touchPadModel.oldCount = touchPadModel.count;
111− keyboardsModel.oldCount = keyboardsModel.count;
115− id: touchScreensModel
116− deviceFilter: InputInfo.TouchScreen
119 Screens {
112 Screens {