Merge lp:~aacid/unity-2d/unity-2d-shell-intellihide_fixes into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 910
Merged at revision: 913
Proposed branch: lp:~aacid/unity-2d/unity-2d-shell-intellihide_fixes
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 53 lines (+15/-11)
1 file modified
shell/launcher/IntelliHideBehavior.qml (+15/-11)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d-shell-intellihide_fixes
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Review via email: mp+88879@code.launchpad.net

Description of the change

Intellhide behaviour fixes

Launcher is shown after 500 msec of holding the mouse against the edge, hidden after 1000 msec of moving the mouse away and shown if there is no intersecting window

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

We'll have to wait for tests for this to land in trunk or implement them here.

review: Abstain
Revision history for this message
Albert Astals Cid (aacid) wrote :
Revision history for this message
Michał Sawicz (saviq) wrote :

The above assumes we're in intellihide mode, we need a comprehensive set of tests for all the different hiding modes.

Revision history for this message
Albert Astals Cid (aacid) wrote :

True, all the tests in that file only work for intellihide

Revision history for this message
Michał Sawicz (saviq) wrote :

I'm a bit wary of the "For some reason this requires a Binding, assigning directly to the property won't work in certain cases." comment, but I couldn't find anything wrong functionally.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/launcher/IntelliHideBehavior.qml'
2--- shell/launcher/IntelliHideBehavior.qml 2011-12-21 19:03:24 +0000
3+++ shell/launcher/IntelliHideBehavior.qml 2012-01-17 16:05:29 +0000
4@@ -5,14 +5,20 @@
5 BaseBehavior {
6 id: intellihide
7
8- property bool shownRegardlessOfFocus: true
9+ property bool shownBecauseOfMousePosition: false
10
11- shown: target !== undefined && (target.activeFocus || shownRegardlessOfFocus)
12+ shown: target !== undefined && (target.activeFocus || shownBecauseOfMousePosition || !windows.intersects)
13
14 Timer {
15 id: edgeHitTimer
16 interval: 500
17- onTriggered: shownRegardlessOfFocus = true
18+ onTriggered: shownBecauseOfMousePosition = true
19+ }
20+
21+ Timer {
22+ id: mouseLeaveTimer
23+ interval: 1000
24+ onTriggered: shownBecauseOfMousePosition = false
25 }
26
27 Connections {
28@@ -21,6 +27,12 @@
29 ignoreUnknownSignals: true
30 }
31
32+ Connections {
33+ target: (intellihide.target !== undefined) ? intellihide.target : null
34+ onContainsMouseChanged: mouseLeaveTimer.running = !target.containsMouse
35+ ignoreUnknownSignals: true
36+ }
37+
38 WindowsIntersectMonitor {
39 id: windows
40 monitoredArea: intellihide.target ? Qt.rect(0, intellihide.target.y,
41@@ -28,12 +40,4 @@
42 intellihide.target.height)
43 : Qt.rect(0, 0, 0, 0)
44 }
45-
46- /* For some reason this requires a Binding, assigning directly to the property
47- won't work in certain cases. */
48- Binding {
49- target: intellihide
50- property: "shownRegardlessOfFocus"
51- value: intellihide.target ? intellihide.target.containsMouse || !windows.intersects : true
52- }
53 }

Subscribers

People subscribed via source and target branches