Merge lp:~mzanetti/unity8/disable-spread-while-locked-stable into lp:unity8/stable

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Sawicz
Approved revision: 2680
Merged at revision: 2680
Proposed branch: lp:~mzanetti/unity8/disable-spread-while-locked-stable
Merge into: lp:unity8/stable
Diff against target: 110 lines (+54/-4)
3 files modified
qml/Shell.qml (+0/-2)
qml/Stage/Stage.qml (+8/-2)
tests/qmltests/tst_Shell.qml (+46/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/disable-spread-while-locked-stable
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) Approve
Review via email: mp+310768@code.launchpad.net

Commit message

Hotfix for not allowing to go to spread when locked

To post a comment you must log in.
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Change looks and works fine; tested on my krillin with mouse edge push, alt-tab and Meta+W keyboard shortcut

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

Not yet, will wait with the top approval

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2016-11-07 19:19:20 +0000
+++ qml/Shell.qml 2016-11-14 12:12:08 +0000
@@ -311,8 +311,6 @@
311 keepDashRunning: launcher.shown || launcher.dashSwipe311 keepDashRunning: launcher.shown || launcher.dashSwipe
312 altTabPressed: physicalKeysMapper.altTabPressed312 altTabPressed: physicalKeysMapper.altTabPressed
313 oskEnabled: shell.oskEnabled313 oskEnabled: shell.oskEnabled
314
315 // TODO: This is not implemented yet in the new stage...
316 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))314 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
317 }315 }
318 }316 }
319317
=== modified file 'qml/Stage/Stage.qml'
--- qml/Stage/Stage.qml 2016-11-09 14:58:26 +0000
+++ qml/Stage/Stage.qml 2016-11-14 12:12:08 +0000
@@ -92,7 +92,9 @@
9292
93 onAltTabPressedChanged: {93 onAltTabPressedChanged: {
94 if (altTabPressed) {94 if (altTabPressed) {
95 altTabDelayTimer.start();95 if (root.spreadEnabled) {
96 altTabDelayTimer.start();
97 }
96 } else {98 } else {
97 // Alt Tab has been released, did we already go to spread?99 // Alt Tab has been released, did we already go to spread?
98 if (priv.goneToSpread) {100 if (priv.goneToSpread) {
@@ -127,7 +129,9 @@
127 function updateFocusedAppOrientation() { /* TODO */ }129 function updateFocusedAppOrientation() { /* TODO */ }
128 function updateFocusedAppOrientationAnimated() { /* TODO */}130 function updateFocusedAppOrientationAnimated() { /* TODO */}
129 function pushRightEdge(amount) {131 function pushRightEdge(amount) {
130 edgeBarrier.push(amount);132 if (root.spreadEnabled) {
133 edgeBarrier.push(amount);
134 }
131 }135 }
132136
133 function closeSpread() {137 function closeSpread() {
@@ -168,6 +172,7 @@
168 GlobalShortcut {172 GlobalShortcut {
169 id: showSpreadShortcut173 id: showSpreadShortcut
170 shortcut: Qt.MetaModifier|Qt.Key_W174 shortcut: Qt.MetaModifier|Qt.Key_W
175 active: root.spreadEnabled
171 onTriggered: priv.goneToSpread = true176 onTriggered: priv.goneToSpread = true
172 }177 }
173178
@@ -1788,6 +1793,7 @@
1788 direction: Direction.Leftwards1793 direction: Direction.Leftwards
1789 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }1794 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
1790 width: root.dragAreaWidth1795 width: root.dragAreaWidth
1796 enabled: root.spreadEnabled
17911797
1792 property var gesturePoints: []1798 property var gesturePoints: []
1793 property bool cancelled: false1799 property bool cancelled: false
17941800
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2016-10-03 11:15:27 +0000
+++ tests/qmltests/tst_Shell.qml 2016-11-14 12:12:08 +0000
@@ -2761,5 +2761,51 @@
2761 wait(3000);2761 wait(3000);
2762 tryCompare(cursor, "opacity", 0);2762 tryCompare(cursor, "opacity", 0);
2763 }2763 }
2764
2765 function test_spreadDisabled_data() {
2766 return [
2767 { tag: "enabled", spreadEnabled: true },
2768 { tag: "disabled", spreadEnabled: false }
2769 ]
2770 }
2771 function test_spreadDisabled(data) {
2772 loadShell("phone");
2773 swipeAwayGreeter();
2774 var stage = findChild(shell, "stage");
2775 stage.spreadEnabled = data.spreadEnabled;
2776
2777 // Try swiping
2778 touchFlick(shell, shell.width - 2, shell.height / 2, units.gu(1), shell.height / 2);
2779 tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2780
2781 stage.closeSpread();
2782 tryCompare(stage, "state", "staged");
2783
2784 // Try by edge push
2785 mouseMove(stage, stage.width - 1, units.gu(10));
2786 for (var i = 0; i < units.gu(10); i++) {
2787 stage.pushRightEdge(1);
2788 }
2789 mouseMove(stage, stage.width - units.gu(5), units.gu(10));
2790 tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2791
2792 stage.closeSpread();
2793 tryCompare(stage, "state", "staged");
2794
2795 // Try by alt+tab
2796 keyPress(Qt.Key_Alt);
2797 keyClick(Qt.Key_Tab);
2798 tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2799 keyRelease(Qt.Key_Alt);
2800
2801 stage.closeSpread();
2802 tryCompare(stage, "state", "staged");
2803
2804 // Try by Super+W
2805 keyPress(Qt.Key_W, Qt.MetaModifier)
2806 tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2807 keyRelease(Qt.Key_W, Qt.MetaModifier)
2808
2809 }
2764 }2810 }
2765}2811}

Subscribers

People subscribed via source and target branches

to all changes: