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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Florian Boucault
Approved revision: 1002
Merged at revision: 1002
Proposed branch: lp:~aacid/unity-2d/unity-2d-shell_disable_bindings_on_animation
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 82 lines (+27/-20)
2 files modified
shell/Shell.qml (+26/-19)
shell/launcher/LauncherLoader.qml (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d-shell_disable_bindings_on_animation
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+92442@code.launchpad.net

Description of the change

Disable some bindings to gain speed

Updating the monitoredArea and the inputShapedArea when the animation of the launcher
is happening is an overkill since they are quite expensive and the animation triggers them
a few times

To post a comment you must log in.

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-02-09 10:08:51 +0000
3+++ shell/Shell.qml 2012-02-10 11:23:19 +0000
4@@ -52,7 +52,7 @@
5 value: !dashLoader.item.active
6 }
7
8- Behavior on x { NumberAnimation { duration: 125 } }
9+ Behavior on x { NumberAnimation { id: launcherLoaderXAnimation; duration: 125 } }
10
11 Connections {
12 target: declarativeView
13@@ -123,24 +123,7 @@
14 target: declarativeView
15
16 InputShapeRectangle {
17- rectangle: {
18- // FIXME: this results in a 1px wide white rectangle on the launcher edge, we should switch
19- // to cpp-based edge detection, and later XFixes barriers to get rid of that completely
20- var somewhatShown = Utils.isLeftToRight() ? -launcherLoader.x < launcherLoader.width : launcherLoader.x < shell.width
21- if (somewhatShown) {
22- return Qt.rect(launcherLoader.x,
23- launcherLoader.y,
24- launcherLoader.width,
25- launcherLoader.height)
26- } else {
27- // The outerEdgeMouseArea is one pixel bigger on each side so use it
28- // when the launcher is hidden to have that extra pixel in the border
29- return Qt.rect(launcherLoader.x + launcherLoader.outerEdgeMouseArea.x,
30- launcherLoader.y,
31- launcherLoader.outerEdgeMouseArea.width,
32- launcherLoader.height)
33- }
34- }
35+ id: launcherInputShape
36 enabled: launcherLoader.status == Loader.Ready
37 }
38
39@@ -163,6 +146,30 @@
40 }
41 }
42
43+ Binding {
44+ target: launcherInputShape
45+ property: "rectangle"
46+ value: {
47+ // FIXME: this results in a 1px wide white rectangle on the launcher edge, we should switch
48+ // to cpp-based edge detection, and later XFixes barriers to get rid of that completely
49+ var somewhatShown = Utils.isLeftToRight() ? -launcherLoader.x < launcherLoader.width : launcherLoader.x < shell.width
50+ if (somewhatShown) {
51+ return Qt.rect(launcherLoader.x,
52+ launcherLoader.y,
53+ launcherLoader.width,
54+ launcherLoader.height)
55+ } else {
56+ // The outerEdgeMouseArea is one pixel bigger on each side so use it
57+ // when the launcher is hidden to have that extra pixel in the border
58+ return Qt.rect(launcherLoader.x + launcherLoader.outerEdgeMouseArea.x,
59+ launcherLoader.y,
60+ launcherLoader.outerEdgeMouseArea.width,
61+ launcherLoader.height)
62+ }
63+ }
64+ when: !launcherLoaderXAnimation.running
65+ }
66+
67 StrutManager {
68 id: strutManager
69 edge: Unity2dPanel.LeftEdge
70
71=== modified file 'shell/launcher/LauncherLoader.qml'
72--- shell/launcher/LauncherLoader.qml 2012-02-08 16:18:21 +0000
73+++ shell/launcher/LauncherLoader.qml 2012-02-10 11:23:19 +0000
74@@ -54,7 +54,7 @@
75 target: declarativeView
76 property: "monitoredArea"
77 value: Qt.rect(launcherLoader.x, launcherLoader.item.y, launcherLoader.item.width, launcherLoader.item.height)
78- when: launcherBehavior.status == Loader.Ready
79+ when: launcherBehavior.status == Loader.Ready && !launcherLoaderXAnimation.running
80 }
81
82 Binding {

Subscribers

People subscribed via source and target branches