Merge lp:~bilalakhtar/unity/fix-queuedraw-after-addlaunchericon into lp:unity

Proposed by Bilal Akhtar
Status: Rejected
Rejected by: Andrea Azzarone
Proposed branch: lp:~bilalakhtar/unity/fix-queuedraw-after-addlaunchericon
Merge into: lp:unity
Diff against target: 50 lines (+29/-0)
2 files modified
launcher/LauncherController.cpp (+3/-0)
tests/autopilot/unity/tests/launcher/test_icon_behavior.py (+26/-0)
To merge this branch: bzr merge lp:~bilalakhtar/unity/fix-queuedraw-after-addlaunchericon
Reviewer Review Type Date Requested Status
Sam Spilsbury (community) Needs Information
Unity Team Pending
Review via email: mp+120414@code.launchpad.net

Description of the change

Right now in Quantal, sometimes a SoftwareCenter launcher icon doesn't fly into the launcher when it should, and it waits for the next QueueDraw to happen. This doesn't happen all the time, and as such isn't reproducible easily. But even if it does happen, this branch should fix that.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Tests?

review: Needs Information
2591. By Bilal Akhtar

Merge from trunk
'

2592. By Bilal Akhtar

Add autopilot test

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

I added a test, thanks for the suggestion Sam!

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Isn't better to do this on OnLauncherAddRequestSpecial when animating?

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

Marco: No, because OnLauncherAddRequestSpecial isn't called until a QueueDraw is evoked. So if I remove this call, the call to OnLauncherAddRequestSpecial may not be made in some cases.

Revision history for this message
Michal Hruby (mhr3) wrote :

> Marco: No, because OnLauncherAddRequestSpecial isn't called until a QueueDraw
> is evoked. So if I remove this call, the call to OnLauncherAddRequestSpecial
> may not be made in some cases.

That really doesn't sound right, if that's the case, something is terribly broken.

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

@Michal: Yes, it doesn't sound right because it's a workaround to an Intel Atom driver bug (see bug #981168). Just move the OnLauncherAddRequestSpecial call to the same place where we're calling QueueDraw right now, and boom, the launcher is broken for all Intel Atom netbooks.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Mh, this doesn't seem right btw... I've reworked the way this part work on a my upcoming branch, let's see if that would work there.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

@Marco, @Bilal: is this branch still valid?

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

It's valid but it isn't necessary anymore. The "add icon to launcher"
behavior has changed a lot and no longer needs this change.

On Wed, Nov 28, 2012 at 7:29 PM, Andrea Azzarone <email address hidden>wrote:

> @Marco, @Bilal: is this branch still valid?
> --
>
> https://code.launchpad.net/~bilalakhtar/unity/fix-queuedraw-after-addlaunchericon/+merge/120414
> You are the owner of
> lp:~bilalakhtar/unity/fix-queuedraw-after-addlaunchericon.
>

Unmerged revisions

2592. By Bilal Akhtar

Add autopilot test

2591. By Bilal Akhtar

Merge from trunk
'

2590. By Bilal Akhtar

Fix queuedraw after Software Center sends AddLauncherItemFromPosition to fix icon addition

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherController.cpp'
2--- launcher/LauncherController.cpp 2012-08-21 17:50:55 +0000
3+++ launcher/LauncherController.cpp 2012-08-24 13:03:20 +0000
4@@ -1237,6 +1237,9 @@
5 icon.Str(), icon_x, icon_y, icon_size);
6
7 g_dbus_method_invocation_return_value(invocation, nullptr);
8+
9+ for (auto launcher : launchers)
10+ launcher->QueueDraw();
11 }
12 }
13
14
15=== modified file 'tests/autopilot/unity/tests/launcher/test_icon_behavior.py'
16--- tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2012-08-09 01:37:02 +0000
17+++ tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2012-08-24 13:03:20 +0000
18@@ -150,6 +150,32 @@
19 self.assertThat(calc_icon, NotEquals(None))
20 self.assertThat(calc_icon.visible, Eventually(Equals(True)))
21
22+ def test_software_center_add_icon(self):
23+ """ Test the ability to add a SoftwareCenterLauncherIcon """
24+ sleep(.5)
25+
26+ # Check if SC is pinned to the launcher already
27+ icon = self.launcher.model.get_icon(desktop_id="ubuntu-software-center.desktop")
28+ if icon != None:
29+ self.launcher_instance.unlock_from_launcher(icon)
30+ sleep(2.0)
31+
32+ self.launcher.add_launcher_item_from_position("Unity Test",
33+ "softwarecenter",
34+ 100,
35+ 100,
36+ 32,
37+ "/usr/share/applications/ubuntu-software-center.desktop",
38+ "")
39+
40+ sleep(2.0)
41+
42+ icon = self.launcher.model.get_icon(desktop_id="ubuntu-software-center.desktop")
43+
44+ # Check if the icon tooltip is NOT empty and NOT "waiting to install"
45+ self.assertThat(icon.tooltip_text == "Waiting to install", Equals(False))
46+ self.assertThat(len(icon.tooltip_text) == 0, Equals(False))
47+ sleep(.5)
48
49 class LauncherDragIconsBehavior(LauncherTestCase):
50 """Tests dragging icons around the Launcher."""