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
=== modified file 'shell/Shell.qml'
--- shell/Shell.qml 2012-02-09 10:08:51 +0000
+++ shell/Shell.qml 2012-02-10 11:23:19 +0000
@@ -52,7 +52,7 @@
52 value: !dashLoader.item.active52 value: !dashLoader.item.active
53 }53 }
5454
55 Behavior on x { NumberAnimation { duration: 125 } }55 Behavior on x { NumberAnimation { id: launcherLoaderXAnimation; duration: 125 } }
5656
57 Connections {57 Connections {
58 target: declarativeView58 target: declarativeView
@@ -123,24 +123,7 @@
123 target: declarativeView123 target: declarativeView
124124
125 InputShapeRectangle {125 InputShapeRectangle {
126 rectangle: {126 id: launcherInputShape
127 // FIXME: this results in a 1px wide white rectangle on the launcher edge, we should switch
128 // to cpp-based edge detection, and later XFixes barriers to get rid of that completely
129 var somewhatShown = Utils.isLeftToRight() ? -launcherLoader.x < launcherLoader.width : launcherLoader.x < shell.width
130 if (somewhatShown) {
131 return Qt.rect(launcherLoader.x,
132 launcherLoader.y,
133 launcherLoader.width,
134 launcherLoader.height)
135 } else {
136 // The outerEdgeMouseArea is one pixel bigger on each side so use it
137 // when the launcher is hidden to have that extra pixel in the border
138 return Qt.rect(launcherLoader.x + launcherLoader.outerEdgeMouseArea.x,
139 launcherLoader.y,
140 launcherLoader.outerEdgeMouseArea.width,
141 launcherLoader.height)
142 }
143 }
144 enabled: launcherLoader.status == Loader.Ready127 enabled: launcherLoader.status == Loader.Ready
145 }128 }
146129
@@ -163,6 +146,30 @@
163 }146 }
164 }147 }
165148
149 Binding {
150 target: launcherInputShape
151 property: "rectangle"
152 value: {
153 // FIXME: this results in a 1px wide white rectangle on the launcher edge, we should switch
154 // to cpp-based edge detection, and later XFixes barriers to get rid of that completely
155 var somewhatShown = Utils.isLeftToRight() ? -launcherLoader.x < launcherLoader.width : launcherLoader.x < shell.width
156 if (somewhatShown) {
157 return Qt.rect(launcherLoader.x,
158 launcherLoader.y,
159 launcherLoader.width,
160 launcherLoader.height)
161 } else {
162 // The outerEdgeMouseArea is one pixel bigger on each side so use it
163 // when the launcher is hidden to have that extra pixel in the border
164 return Qt.rect(launcherLoader.x + launcherLoader.outerEdgeMouseArea.x,
165 launcherLoader.y,
166 launcherLoader.outerEdgeMouseArea.width,
167 launcherLoader.height)
168 }
169 }
170 when: !launcherLoaderXAnimation.running
171 }
172
166 StrutManager {173 StrutManager {
167 id: strutManager174 id: strutManager
168 edge: Unity2dPanel.LeftEdge175 edge: Unity2dPanel.LeftEdge
169176
=== modified file 'shell/launcher/LauncherLoader.qml'
--- shell/launcher/LauncherLoader.qml 2012-02-08 16:18:21 +0000
+++ shell/launcher/LauncherLoader.qml 2012-02-10 11:23:19 +0000
@@ -54,7 +54,7 @@
54 target: declarativeView54 target: declarativeView
55 property: "monitoredArea"55 property: "monitoredArea"
56 value: Qt.rect(launcherLoader.x, launcherLoader.item.y, launcherLoader.item.width, launcherLoader.item.height)56 value: Qt.rect(launcherLoader.x, launcherLoader.item.y, launcherLoader.item.width, launcherLoader.item.height)
57 when: launcherBehavior.status == Loader.Ready57 when: launcherBehavior.status == Loader.Ready && !launcherLoaderXAnimation.running
58 }58 }
5959
60 Binding {60 Binding {

Subscribers

People subscribed via source and target branches