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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 1083
Merged at revision: 1081
Proposed branch: lp:~aacid/unity-2d/do_not_crash_autoscrolling
Merge into: lp:unity-2d
Diff against target: 40 lines (+13/-2)
2 files modified
shell/launcher/LauncherList.qml (+4/-2)
tests/manual-tests/launcher.txt (+9/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/do_not_crash_autoscrolling
Reviewer Review Type Date Requested Status
Gerry Boland Pending
Review via email: mp+103432@code.launchpad.net

Commit message

[launcher] Do not try to access item if index is -1

This fixes a crash when the mouse is on the autoscrolling area of the launcher and an application disappears
This seems like a Qt bug to me, it seems as if the property changes trigger in a way that the item delegate is half destructed and accessing it makes things explode

Description of the change

Do not try to access item if index is -1

This fixes a crash when the mouse is on the autoscrolling area of the launcher and an application disappears
This seems like a Qt bug to me, it seems as if the property changes trigger in a way that the item delegate is half destructed and accessing it makes things explode

To post a comment you must log in.
1082. By Albert Astals Cid

test

1083. By Albert Astals Cid

add comment so people don't remove the bugfix/workaround

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'shell/launcher/LauncherList.qml'
--- shell/launcher/LauncherList.qml 2012-04-18 07:18:14 +0000
+++ shell/launcher/LauncherList.qml 2012-04-25 09:46:20 +0000
@@ -199,7 +199,8 @@
199199
200 /* Display the tooltip when hovering the item only when the list200 /* Display the tooltip when hovering the item only when the list
201 is not moving */201 is not moving */
202 onEntered: if (!list.moving && !list.autoScrolling && list.showMenus) showMenu()202 // FIXME index checking should not be needed but otherwise we hit https://bugs.launchpad.net/unity-2d/+bug/988239
203 onEntered: if (!list.moving && !list.autoScrolling && list.showMenus && index != -1) showMenu()
203 onExited: {204 onExited: {
204 /* When unfolded, leave enough time for the user to reach the205 /* When unfolded, leave enough time for the user to reach the
205 menu. Necessary because there is some void between the item206 menu. Necessary because there is some void between the item
@@ -255,7 +256,8 @@
255 Connections {256 Connections {
256 target: list257 target: list
257 onMovementStarted: item.menu.hide()258 onMovementStarted: item.menu.hide()
258 onAutoScrollingChanged: if (list.autoScrolling) item.menu.hide()259 // FIXME index checking should not be needed but otherwise we hit https://bugs.launchpad.net/unity-2d/+bug/988239
260 onAutoScrollingChanged: if (list.autoScrolling && index != -1) item.menu.hide()
259 }261 }
260262
261 Connections {263 Connections {
262264
=== modified file 'tests/manual-tests/launcher.txt'
--- tests/manual-tests/launcher.txt 2012-04-24 15:48:07 +0000
+++ tests/manual-tests/launcher.txt 2012-04-25 09:46:20 +0000
@@ -152,3 +152,12 @@
152152
153Verify that the icon shows correctly in the launcher153Verify that the icon shows correctly in the launcher
154----154----
155 * Have the launcher in always shown mode
156 * Have the launcher with more items that it can hold in screen (i.e. it is scrollable)
157 * Put the mouse in the area of the launcher that makes it autoscroll down (and don't move it for the rest of the test)
158 * Open a program that is not in the launcher (so it creates a new tile in the launcher)
159 * Verify launcher autoscrolls down
160 * Quit the program you just started
161
162Verify that the launcher autoscrolls up (and does not crash)
163----

Subscribers

People subscribed via source and target branches