Merge lp:~mzanetti/unity8/fix-super-hides-launcher into lp:unity8

Proposed by Michael Zanetti
Status: Superseded
Proposed branch: lp:~mzanetti/unity8/fix-super-hides-launcher
Merge into: lp:unity8
Diff against target: 164 lines (+70/-14)
3 files modified
qml/Launcher/Launcher.qml (+2/-2)
qml/Launcher/LauncherPanel.qml (+24/-6)
tests/qmltests/Launcher/tst_Launcher.qml (+44/-6)
To merge this branch: bzr merge lp:~mzanetti/unity8/fix-super-hides-launcher
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Lukáš Tinkl (community) Approve
Review via email: mp+321085@code.launchpad.net

This proposal has been superseded by a proposal from 2017-03-28.

Commit message

Don't hide the launcher on super press if it's locked visible

Description of the change

 * 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
 * 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
Lukáš Tinkl (lukas-kde) wrote :

Tested, works correctly

* 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.

Waiting

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2892
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3556/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4716
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2868
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2868/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4744
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4567
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4567/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4567
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4567/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4567
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4567/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4567
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4567/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4567
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4567/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4567
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4567/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3556/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

The ^^ zesty failure is due to https://bileto.ubuntu.com/#/ticket/2605 being stuck in proposed

2893. By Michael Zanetti

merge new prereq

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Launcher/Launcher.qml'
2--- qml/Launcher/Launcher.qml 2017-03-21 10:54:59 +0000
3+++ qml/Launcher/Launcher.qml 2017-03-28 07:57:30 +0000
4@@ -75,7 +75,7 @@
5 } else {
6 superPressTimer.stop();
7 superLongPressTimer.stop();
8- switchToNextState("");
9+ switchToNextState(root.lockedVisible ? "visible" : "");
10 panel.shortcutHintsShown = false;
11 }
12 }
13@@ -88,7 +88,7 @@
14 superPressTimer.stop();
15 superLongPressTimer.stop();
16 } else {
17- switchToNextState("");
18+ switchToNextState(root.lockedVisible ? "visible" : "");
19 root.focus = false;
20 if (panel.highlightIndex == -1) {
21 root.showDashHome();
22
23=== modified file 'qml/Launcher/LauncherPanel.qml'
24--- qml/Launcher/LauncherPanel.qml 2017-03-16 10:46:15 +0000
25+++ qml/Launcher/LauncherPanel.qml 2017-03-28 07:57:30 +0000
26@@ -751,16 +751,18 @@
27 Keys.onPressed: {
28 switch (event.key) {
29 case Qt.Key_Down:
30- selectedIndex++;
31- if (selectedIndex >= popoverRepeater.count) {
32- selectedIndex = 0;
33+ var prevIndex = selectedIndex;
34+ selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
35+ while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
36+ selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
37 }
38 event.accepted = true;
39 break;
40 case Qt.Key_Up:
41- selectedIndex--;
42- if (selectedIndex < 0) {
43- selectedIndex = popoverRepeater.count - 1;
44+ var prevIndex = selectedIndex;
45+ selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
46+ while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
47+ selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
48 }
49 event.accepted = true;
50 break;
51@@ -806,6 +808,19 @@
52 width: parent.width
53 height: quickListColumn.height
54
55+ MouseArea {
56+ anchors.fill: parent
57+ hoverEnabled: true
58+ onPositionChanged: {
59+ var item = quickListColumn.childAt(mouseX, mouseY);
60+ if (item.clickable) {
61+ quickList.selectedIndex = item.index;
62+ } else {
63+ quickList.selectedIndex = -1;
64+ }
65+ }
66+ }
67+
68 Column {
69 id: quickListColumn
70 width: parent.width
71@@ -820,6 +835,9 @@
72 }
73
74 ListItem {
75+ readonly property bool clickable: model.clickable
76+ readonly property int index: model.index
77+
78 objectName: "quickListEntry" + index
79 selected: index === quickList.selectedIndex
80 height: label.implicitHeight + label.anchors.topMargin + label.anchors.bottomMargin
81
82=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
83--- tests/qmltests/Launcher/tst_Launcher.qml 2017-03-14 10:38:52 +0000
84+++ tests/qmltests/Launcher/tst_Launcher.qml 2017-03-28 07:57:30 +0000
85@@ -1254,14 +1254,14 @@
86 tryCompare(quickList, "selectedIndex", 0)
87
88 // Down should move down the quicklist
89+ // Because item 1 is not selectable
90 keyClick(Qt.Key_Down);
91- tryCompare(quickList, "selectedIndex", 1)
92+ tryCompare(quickList, "selectedIndex", 2)
93
94 // The quicklist should wrap around too
95 keyClick(Qt.Key_Down);
96 keyClick(Qt.Key_Down);
97 keyClick(Qt.Key_Down);
98- keyClick(Qt.Key_Down);
99 tryCompare(quickList, "selectedIndex", 0)
100
101 // Left gets us back to the launcher
102@@ -1286,14 +1286,14 @@
103
104 keyClick(Qt.Key_Down); // Down to launcher item 0
105 keyClick(Qt.Key_Down); // Down to launcher item 1
106- keyClick(Qt.Key_Right); // Into quicklist
107- keyClick(Qt.Key_Down); // Down to quicklist item 1
108- keyClick(Qt.Key_Down); // Down to quicklist item 2
109+ keyClick(Qt.Key_Right); // Into quicklist, item 0 is selected
110+ keyClick(Qt.Key_Down); // Down to quicklist item 2 (because 1 is not selectable)
111+ keyClick(Qt.Key_Down); // Down to quicklist item 3
112 keyClick(Qt.Key_Enter); // Trigger it
113
114 compare(signalSpy.count, 1, "Quicklist signal wasn't triggered")
115 compare(signalSpy.signalArguments[0][0], LauncherModel.get(1).appId)
116- compare(signalSpy.signalArguments[0][1], 2)
117+ compare(signalSpy.signalArguments[0][1], 3)
118 assertFocusOnIndex(-2);
119 }
120
121@@ -1542,5 +1542,43 @@
122 tryCompare(launcher, "maxPanelX", 0);
123 launcher.panelWidth = oldSize;
124 }
125+
126+ function test_doesntHideOnSuperWhenLockedVisible() {
127+ launcher.lockedVisible = true;
128+
129+ waitForRendering(launcher);
130+ launcher.superPressed = true;
131+ wait(400); // Longpress
132+ launcher.superPressed = false;
133+ waitForRendering(launcher);
134+
135+ verify(launcher.state, "visible");
136+ }
137+
138+ function test_mouseHoverSelectQuickList() {
139+ dragLauncherIntoView();
140+ var clickedItem = findChild(launcher, "launcherDelegate5")
141+ var quickList = findChild(launcher, "quickList")
142+
143+ // Initial state
144+ tryCompare(quickList, "state", "")
145+
146+ // Open quickList
147+ mouseClick(clickedItem, clickedItem.width / 2, clickedItem.height / 2, Qt.RightButton)
148+ verify(quickList, "state", "open")
149+ compare(quickList.selectedIndex, -1)
150+
151+ var qEntry = findChild(launcher, "quickListEntry0");
152+ mouseMove(qEntry, qEntry.width / 2 , qEntry.height / 2, 10);
153+ mouseMove(qEntry, qEntry.width / 2 + 1, qEntry.height / 2, 10);
154+
155+ tryCompare(quickList, "selectedIndex", 0)
156+
157+ qEntry = findChild(launcher, "quickListEntry1");
158+ mouseMove(qEntry, qEntry.width / 2 , qEntry.height / 2, 10);
159+ mouseMove(qEntry, qEntry.width / 2 + 1, qEntry.height / 2, 10);
160+
161+ tryCompare(quickList, "selectedIndex", -1)
162+ }
163 }
164 }

Subscribers

People subscribed via source and target branches