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
1=== modified file 'shell/launcher/LauncherList.qml'
2--- shell/launcher/LauncherList.qml 2012-04-18 07:18:14 +0000
3+++ shell/launcher/LauncherList.qml 2012-04-25 09:46:20 +0000
4@@ -199,7 +199,8 @@
5
6 /* Display the tooltip when hovering the item only when the list
7 is not moving */
8- onEntered: if (!list.moving && !list.autoScrolling && list.showMenus) showMenu()
9+ // FIXME index checking should not be needed but otherwise we hit https://bugs.launchpad.net/unity-2d/+bug/988239
10+ onEntered: if (!list.moving && !list.autoScrolling && list.showMenus && index != -1) showMenu()
11 onExited: {
12 /* When unfolded, leave enough time for the user to reach the
13 menu. Necessary because there is some void between the item
14@@ -255,7 +256,8 @@
15 Connections {
16 target: list
17 onMovementStarted: item.menu.hide()
18- onAutoScrollingChanged: if (list.autoScrolling) item.menu.hide()
19+ // FIXME index checking should not be needed but otherwise we hit https://bugs.launchpad.net/unity-2d/+bug/988239
20+ onAutoScrollingChanged: if (list.autoScrolling && index != -1) item.menu.hide()
21 }
22
23 Connections {
24
25=== modified file 'tests/manual-tests/launcher.txt'
26--- tests/manual-tests/launcher.txt 2012-04-24 15:48:07 +0000
27+++ tests/manual-tests/launcher.txt 2012-04-25 09:46:20 +0000
28@@ -152,3 +152,12 @@
29
30 Verify that the icon shows correctly in the launcher
31 ----
32+ * Have the launcher in always shown mode
33+ * Have the launcher with more items that it can hold in screen (i.e. it is scrollable)
34+ * 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)
35+ * Open a program that is not in the launcher (so it creates a new tile in the launcher)
36+ * Verify launcher autoscrolls down
37+ * Quit the program you just started
38+
39+Verify that the launcher autoscrolls up (and does not crash)
40+----

Subscribers

People subscribed via source and target branches