Merge lp:~aacid/unity-2d/sticky_edges into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 1031
Merged at revision: 1036
Proposed branch: lp:~aacid/unity-2d/sticky_edges
Merge into: lp:unity-2d
Diff against target: 63 lines (+31/-2)
2 files modified
shell/Shell.qml (+19/-2)
tests/manual-tests/other.txt (+12/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/sticky_edges
Reviewer Review Type Date Requested Status
Paweł Stołowski Pending
Review via email: mp+100462@code.launchpad.net

Commit message

Obey the sticky edges setting for creating pointer barriers

Description of the change

Obey the sticky edges setting for creating pointer barriers

To post a comment you must log in.
lp:~aacid/unity-2d/sticky_edges updated
1030. By Albert Astals Cid

Merge lp:unity-2d

1031. By Albert Astals Cid

Add manual tests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/Shell.qml'
2--- shell/Shell.qml 2012-04-02 09:11:31 +0000
3+++ shell/Shell.qml 2012-04-03 10:01:20 +0000
4@@ -273,15 +273,20 @@
5
6 PointerBarrier {
7 property int x: declarativeView.globalPosition.x + (Utils.isLeftToRight() ? 0 : shell.width)
8+ property bool enableTrigger: launcherLoader.launcherInHideMode && launcherLoader.loadLauncher
9+ // This enableSticky logic has a 'bug' int RTL where the right most screen will still have enableSticky
10+ // set to true, but it won't cause any issue other than consuming a few bytes of mememory and calculating the
11+ // rightmost x is probably more expensive and error prone than just enabling the extra barrier
12+ property bool enableSticky: unity2dConfiguration.stickyEdges && declarativeView.screen.geometry.x > 0
13
14 id: leftBarrier
15 triggerDirection: Utils.isLeftToRight() ? PointerBarrier.TriggerFromRight : PointerBarrier.TriggerFromLeft
16- triggerZoneEnabled: !launcherLoader.visibilityController.shown
17+ triggerZoneEnabled: enableTrigger && !launcherLoader.visibilityController.shown
18 p1: Qt.point(x, declarativeView.screen.geometry.y)
19 p2: Qt.point(x, declarativeView.screen.geometry.y + declarativeView.screen.geometry.height)
20 triggerZoneP1: Qt.point(x, declarativeView.globalPosition.y)
21 triggerZoneP2: Qt.point(x, declarativeView.globalPosition.y + launcherLoader.height)
22- threshold: launcherLoader.launcherInHideMode && launcherLoader.loadLauncher ? launcher2dConfiguration.edgeStopVelocity : -1
23+ threshold: (enableSticky || enableTrigger) ? launcher2dConfiguration.edgeStopVelocity : -1
24 maxVelocityMultiplier: launcher2dConfiguration.edgeResponsiveness
25 decayRate: launcher2dConfiguration.edgeDecayrate
26 triggerPressure: launcher2dConfiguration.edgeRevealPressure
27@@ -289,4 +294,16 @@
28
29 onTriggered: launcherLoader.item.barrierTriggered()
30 }
31+
32+ PointerBarrier {
33+ property bool enableSticky: unity2dConfiguration.stickyEdges && declarativeView.screen.geometry.y > 0
34+
35+ id: topBarrier
36+ p1: Qt.point(declarativeView.screen.geometry.x, declarativeView.screen.geometry.y)
37+ p2: Qt.point(declarativeView.screen.geometry.x + declarativeView.screen.geometry.width, declarativeView.screen.geometry.y)
38+ threshold: enableSticky ? launcher2dConfiguration.edgeStopVelocity : -1
39+ maxVelocityMultiplier: launcher2dConfiguration.edgeResponsiveness
40+ decayRate: launcher2dConfiguration.edgeDecayrate
41+ breakPressure: launcher2dConfiguration.edgeOvercomePressure
42+ }
43 }
44
45=== modified file 'tests/manual-tests/other.txt'
46--- tests/manual-tests/other.txt 2012-01-18 15:48:54 +0000
47+++ tests/manual-tests/other.txt 2012-04-03 10:01:20 +0000
48@@ -2,3 +2,15 @@
49 * Logout of a Unity-2d session
50
51 -> Logout is "fast", with "fast" meaning it is not 30 seconds (gnome-session timeout) nor 10 (Qt clipboard manager timeout on app shutdown)
52+
53+----
54+ * Have 2 screens stacked vertically
55+ * Enable sticky edges
56+
57+-> Verify that there is a mouse barrier between the two screens
58+
59+----
60+ * Have 2 screens stacked vertically
61+ * Disable sticky edges
62+
63+-> Verify that there is no mouse barrier between the two screens

Subscribers

People subscribed via source and target branches