Merge lp:~mzanetti/unity8/detect-touchpads into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 2055
Merged at revision: 2069
Proposed branch: lp:~mzanetti/unity8/detect-touchpads
Merge into: lp:unity8
Diff against target: 85 lines (+34/-2)
2 files modified
qml/OrientedShell.qml (+7/-2)
tests/qmltests/tst_OrientedShell.qml (+27/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/detect-touchpads
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Lukáš Tinkl (community) Approve
Daniel d'Andrada (community) Approve
Review via email: mp+278190@code.launchpad.net

Commit message

detect touchpads too, not only mice

Description of the change

Also I left this comment on the upstream api: https://codereview.qt-project.org/#/c/101049/10/src/imports/systeminfo/qdeclarativeinputdevicemodel_p.h

 * Are there any related MPs required for this MP to build/function as expected? Please list.

no

 * Did you perform an exploratory manual test run of your code change and any related functionality?

yes

 * Did you make sure that your branch does not contain spurious tags?

yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

n/a

 * If you changed the UI, has there been a design review?

n/a

To post a comment you must log in.
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes.

* Did CI run pass? If not, please explain why.
No results yet. But run the related qmltest locally and it passed.

* Did you make sure that the branch does not contain spurious tags?
Yes.

review: Approve
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

For the record, fixes the bug for me as well.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2055
http://jenkins.qa.ubuntu.com/job/unity8-ci/6762/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5302
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/177/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1475
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/177
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1369
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1370
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/176
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/176
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4207
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5322
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5322/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25352
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/49/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/177
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/177/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25354

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6762/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/OrientedShell.qml'
2--- qml/OrientedShell.qml 2015-11-06 10:00:29 +0000
3+++ qml/OrientedShell.qml 2015-11-20 18:23:15 +0000
4@@ -69,6 +69,11 @@
5 }
6
7 InputDeviceModel {
8+ id: touchPadModel
9+ deviceFilter: InputInfo.TouchPad
10+ }
11+
12+ InputDeviceModel {
13 id: keyboardsModel
14 deviceFilter: InputInfo.Keyboard
15 }
16@@ -183,7 +188,7 @@
17 nativeWidth: root.width
18 nativeHeight: root.height
19 mode: applicationArguments.mode
20- hasMouse: miceModel.count > deviceConfiguration.ignoredMice
21+ hasMouse: miceModel.count + touchPadModel.count > deviceConfiguration.ignoredMice
22
23 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
24 // what's the output device (eg: big TV, desktop monitor, phone display), etc.
25@@ -197,7 +202,7 @@
26 return "tablet";
27 }
28 } else { // automatic
29- if (miceModel.count > deviceConfiguration.ignoredMice) {
30+ if (miceModel.count + touchPadModel.count > deviceConfiguration.ignoredMice) {
31 return "desktop";
32 } else {
33 return deviceConfiguration.category;
34
35=== modified file 'tests/qmltests/tst_OrientedShell.qml'
36--- tests/qmltests/tst_OrientedShell.qml 2015-11-12 20:40:36 +0000
37+++ tests/qmltests/tst_OrientedShell.qml 2015-11-20 18:23:15 +0000
38@@ -60,6 +60,10 @@
39 deviceFilter: InputInfo.Mouse
40 }
41 InputDeviceModel {
42+ id: touchpadModel
43+ deviceFilter: InputInfo.TouchPad
44+ }
45+ InputDeviceModel {
46 id: keyboardsModel
47 deviceFilter: InputInfo.Keyboard
48 }
49@@ -350,6 +354,23 @@
50 }
51 Row {
52 Button {
53+ text: "Add touchpad"
54+ activeFocusOnPress: false
55+ onClicked: {
56+ MockInputDeviceBackend.addMockDevice("/touchpad" + touchpadModel.count, InputInfo.TouchPad)
57+ }
58+ }
59+ Button {
60+ text: "Remove touchpad"
61+ activeFocusOnPress: false
62+ onClicked: {
63+ MockInputDeviceBackend.removeDevice("/touchpad" + (touchpadModel.count - 1))
64+ }
65+ }
66+ }
67+
68+ Row {
69+ Button {
70 text: "Add kbd"
71 activeFocusOnPress: false
72 onClicked: {
73@@ -1000,6 +1021,12 @@
74 MockInputDeviceBackend.removeDevice("/mouse0");
75 tryCompare(shell, "usageScenario", "phone");
76 tryCompare(mockOskSettings, "stayHidden", false);
77+
78+ MockInputDeviceBackend.addMockDevice("/touchpad0", InputInfo.TouchPad);
79+ tryCompare(shell, "usageScenario", "desktop");
80+
81+ MockInputDeviceBackend.removeDevice("/touchpad0");
82+ tryCompare(shell, "usageScenario", "phone");
83 }
84
85 /*

Subscribers

People subscribed via source and target branches