Merge lp:~dandrader/unity8/indicatorsBarEatsAllInput into lp:unity8

Proposed by Daniel d'Andrada on 2015-01-26
Status: Merged
Approved by: Albert Astals Cid on 2015-02-05
Approved revision: 1572
Merged at revision: 1597
Proposed branch: lp:~dandrader/unity8/indicatorsBarEatsAllInput
Merge into: lp:unity8
Diff against target: 101 lines (+38/-5)
2 files modified
qml/Panel/Panel.qml (+5/-3)
tests/qmltests/Panel/tst_Panel.qml (+33/-2)
To merge this branch: bzr merge lp:~dandrader/unity8/indicatorsBarEatsAllInput
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-02-11
Albert Astals Cid (community) 2015-01-26 Approve on 2015-02-04
Review via email: mp+247585@code.launchpad.net

Commit Message

Make indicators bar eat all events

So that they don't hit items behind it inadvertently.

Description of the Change

This shows up with tablets. Causes the TabletStage to get the touches and behave weirdly.

* 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?
Not applicable

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

To post a comment you must log in.
Francis Ginther (fginther) wrote :

The jenkins node for the amd64 and i386 builds failed, I've restarted a new ci run.

Albert Astals Cid (aacid) wrote :

Could you add a reason to the commit so when reading it i'd understand why the indicator bar should eat all the events?

review: Needs Fixing
Daniel d'Andrada (dandrader) wrote :

> Could you add a reason to the commit so when reading it i'd understand why the
> indicator bar should eat all the events?

Done.
Would you also have to spare time to review it? :)

Albert Astals Cid (aacid) wrote :

There's still like a few pixels that if i click on them the swapping to the dahs will happen, maybe it's the pixels of the divider line?

What i do is start doing taps on the bar and then go down bit by bit, and like 75% of the times i can touch somewhere that will make it switch (seems to happen only with the indicators are open)

review: Needs Fixing
Albert Astals Cid (aacid) wrote :

Actually what i found is just a different bug that i just logged at https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1417967

Albert Astals Cid (aacid) 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.
Some builder failed due to gcc being broken, will retrigger and top approve later

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

review: Approve
Albert Astals Cid (aacid) wrote :

Only known failing tests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Panel/Panel.qml'
2--- qml/Panel/Panel.qml 2014-11-24 13:15:52 +0000
3+++ qml/Panel/Panel.qml 2015-01-26 13:53:47 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2013-2014 Canonical, Ltd.
7+ * Copyright (C) 2013-2015 Canonical, Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11@@ -90,6 +90,9 @@
12 right: indicators.left
13 }
14 saturation: 1 - indicators.unitProgress
15+
16+ // Don't let input event pass trough
17+ MouseArea { anchors.fill: parent }
18 }
19
20 Image {
21@@ -110,8 +113,7 @@
22 right: indicators.left
23 }
24 height: indicators.minimizedPanelHeight
25- enabled: callHint.visible
26- onClicked: callHint.showLiveCall()
27+ onClicked: { if (callHint.visible) { callHint.showLiveCall(); } }
28 }
29
30 IndicatorsMenu {
31
32=== modified file 'tests/qmltests/Panel/tst_Panel.qml'
33--- tests/qmltests/Panel/tst_Panel.qml 2014-11-25 12:53:03 +0000
34+++ tests/qmltests/Panel/tst_Panel.qml 2015-01-26 13:53:47 +0000
35@@ -1,5 +1,5 @@
36 /*
37- * Copyright 2013-2014 Canonical Ltd.
38+ * Copyright 2013-2015 Canonical Ltd.
39 *
40 * This program is free software; you can redistribute it and/or modify
41 * it under the terms of the GNU General Public License as published by
42@@ -41,7 +41,12 @@
43 Layout.fillHeight: true
44
45 id: itemArea
46- color: "blue"
47+ color: backgroundMouseArea.pressed ? "red" : "blue"
48+
49+ MouseArea {
50+ id: backgroundMouseArea
51+ anchors.fill: parent
52+ }
53
54 Panel {
55 id: panel
56@@ -128,6 +133,12 @@
57 name: "Panel"
58 when: windowShown
59
60+ SignalSpy {
61+ id: backgroundPressedSpy
62+ target: backgroundMouseArea
63+ signalName: "pressedChanged"
64+ }
65+
66 function init() {
67 panel.fullscreenMode = false;
68 callManager.foregroundCall = null;
69@@ -140,6 +151,9 @@
70 // (switches between normal and fullscreen modes are animated)
71 var indicatorArea = findChild(panel, "indicatorArea");
72 tryCompare(indicatorArea, "y", 0);
73+
74+ backgroundPressedSpy.clear();
75+ compare(backgroundPressedSpy.valid, true);
76 }
77
78 function get_indicator_item(index) {
79@@ -299,5 +313,22 @@
80
81 touchRelease(panel, mappedPosition.x, panel.minimizedPanelHeight / 2);
82 }
83+
84+ /* Checks that no input reaches items behind the indicator bar.
85+ Ie., the indicator bar should eat all input events that hit it.
86+ */
87+ function test_indicatorBarEatsAllEvents() {
88+ // Perform several taps throughout the length of the indicator bar to ensure
89+ // that it doesn't have a "weak spot" from where taps pass through.
90+ var numTaps = 5;
91+ var stepLength = (panel.width / (numTaps + 1));
92+ var tapY = panel.indicators.minimizedPanelHeight / 2;
93+ for (var i = 1; i <= numTaps; ++i) {
94+ tap(panel, stepLength * i, tapY);
95+ tryCompare(panel.indicators, "fullyClosed", true);
96+ }
97+
98+ compare(backgroundPressedSpy.count, 0);
99+ }
100 }
101 }

Subscribers

People subscribed via source and target branches