Merge lp:~zsombi/ubuntu-ui-toolkit/patchMouseAttachSimulation into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 1742
Merged at revision: 1741
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/patchMouseAttachSimulation
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 71 lines (+15/-13)
2 files modified
src/Ubuntu/Components/plugin/quickutils.cpp (+1/-1)
tests/unit_x11/tst_components/tst_bottomedgehint.qml (+14/-12)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/patchMouseAttachSimulation
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Cris Dywan Approve
Zoltan Balogh Approve
Review via email: mp+279739@code.launchpad.net

Commit message

Set mouseAttached to false to revert regression in UITK gallery.

Description of the change

Set mouseAttached to false to revert regression in UITK gallery.

To post a comment you must log in.
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve
Revision history for this message
Cris Dywan (kalikiana) wrote :

Makes sense.

But we badly need the real fix, which is to implement the device-based toggle.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
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 'src/Ubuntu/Components/plugin/quickutils.cpp'
2--- src/Ubuntu/Components/plugin/quickutils.cpp 2015-11-23 15:29:40 +0000
3+++ src/Ubuntu/Components/plugin/quickutils.cpp 2015-12-07 10:05:25 +0000
4@@ -33,7 +33,7 @@
5 QuickUtils::QuickUtils(QObject *parent) :
6 QObject(parent),
7 m_rootView(0),
8- m_mouseAttached(true)
9+ m_mouseAttached(false)
10 {
11 QGuiApplication::instance()->installEventFilter(this);
12 m_omitIM << "ibus" << "none" << "compose";
13
14=== modified file 'tests/unit_x11/tst_components/tst_bottomedgehint.qml'
15--- tests/unit_x11/tst_components/tst_bottomedgehint.qml 2015-11-19 10:33:41 +0000
16+++ tests/unit_x11/tst_components/tst_bottomedgehint.qml 2015-12-07 10:05:25 +0000
17@@ -133,15 +133,18 @@
18
19 function test_clicking_data() {
20 return [
21- {tag: "when Locked", status: BottomEdgeHint.Locked, xfail: false},
22- {tag: "when Active", status: BottomEdgeHint.Active, xfail: hasMouseAttached},
23- {tag: "when Inactive", status: BottomEdgeHint.Inactive, xfail: true},
24- {tag: "when Hidden", status: BottomEdgeHint.Hidden, xfail: true},
25+ {tag: "when Locked", status: BottomEdgeHint.Locked, statusFail: false, xfail: false},
26+ {tag: "when Active", status: BottomEdgeHint.Active, statusFail: hasMouseAttached, xfail: false},
27+ {tag: "when Inactive", status: BottomEdgeHint.Inactive, statusFail: hasMouseAttached, xfail: !hasMouseAttached},
28+ {tag: "when Hidden", status: BottomEdgeHint.Hidden, statusFail: hasMouseAttached, xfail: !hasMouseAttached},
29 ];
30 }
31 function test_clicking(data) {
32 bottomEdgeHint.status = data.status;
33- compare(bottomEdgeHint.status, data.status);
34+ // states cannot be set when mouse attached
35+ if (!data.statusFail) {
36+ compare(bottomEdgeHint.status, data.status);
37+ }
38 mouseClick(bottomEdgeHint, centerOf(bottomEdgeHint).x, centerOf(bottomEdgeHint).y);
39 if (data.xfail) {
40 expectFailContinue(data.tag, "No click is expected");
41@@ -151,8 +154,8 @@
42
43 function test_alter_deprecated_state_data() {
44 return [
45- {tag: "Hidden", status: BottomEdgeHint.Hidden},
46- {tag: "Visible", status: BottomEdgeHint.Inactive},
47+ {tag: "Hidden", status: hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Hidden},
48+ {tag: "Visible", status: hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Inactive},
49 ];
50 }
51 function test_alter_deprecated_state(data) {
52@@ -206,15 +209,14 @@
53 // FIXME: must be executed before the test_hiding as flick with mouse affects
54 // the touch drag on ListView for some unknown reason
55 function test_0_touch_gesture() {
56- if (hasMouseAttached) {
57- skip("", "The test requires touch environment");
58- }
59 bottomEdgeHint.text = "Touch Activated";
60 var gestureStartPoint = Qt.point(centerOf(bottomEdgeHint).x, bottomEdgeHint.height - 1);
61 TestExtras.touchDrag(0, bottomEdgeHint, gestureStartPoint, Qt.point(0, -units.gu(8)), 6);
62- tryCompare(bottomEdgeHint, "status", BottomEdgeHint.Active, 400);
63+ var expectedStatus = hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Active;
64+ tryCompare(bottomEdgeHint, "status", expectedStatus, 400);
65 // then wait till we get back to Idle
66- tryCompare(bottomEdgeHint, "status", BottomEdgeHint.Inactive, 1000);
67+ expectedStatus = hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Inactive;
68+ tryCompare(bottomEdgeHint, "status", expectedStatus, 1000);
69 }
70
71 function test_custom_trigger_on_clicked() {

Subscribers

People subscribed via source and target branches