on xenial help sign in
fixes for the automatic switching between usage modes

* evaluate usage mode when the screen size changes * switch to staged mode even if a mouse is attached when the screen is too small

commit4f31b7544a44ec4a914a0ea06a112c8385ddba10 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 29 Jul 2016, 17:30 (10 years ago) parent07e4e7b
1 file changed+10−3
qml/OrientedShell.qml+10−3
qml/OrientedShell.qml+10−3
@@ -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("Pointer input devices changed:", 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 {