@@ -32,6 +32,8 @@ Item {
3232 implicitWidth: units.gu(40)
3333 implicitHeight: units.gu(71)
3434
35+ onWidthChanged: calculateUsageMode();
36+
3537 DeviceConfiguration {
3638 id: deviceConfiguration
3739 name: applicationArguments.deviceName
@@ -103,10 +105,15 @@ Item {
103105 if (unity8Settings.usageMode === undefined)
104106 return; // gsettings isn't loaded yet, we'll try again in Component.onCompleted
105107
106− console.log("Pointer input devices changed:", pointerInputDevices, "current mode:", unity8Settings.usageMode, "old device count", miceModel.oldCount + touchPadModel.oldCount)
108+ console.log("Calculating new usage mode. Pointer devices:", pointerInputDevices, "current mode:", unity8Settings.usageMode, "old device count", miceModel.oldCount + touchPadModel.oldCount, "root width:", root.width / units.gu(1), "height:", root.height / units.gu(1))
107109 if (unity8Settings.usageMode === "Windowed") {
108− if (pointerInputDevices === 0) {
109− // All pointer devices have been unplugged. Move to staged.
110+ if (Math.min(root.width, root.height) > units.gu(60)) {
111+ if (pointerInputDevices === 0) {
112+ // All pointer devices have been unplugged. Move to staged.
113+ unity8Settings.usageMode = "Staged";
114+ }
115+ } else {
116+ // The display is not large enough, use staged.
110117 unity8Settings.usageMode = "Staged";
111118 }
112119 } else {