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
=== modified file 'launcher/LauncherController.cpp'
--- launcher/LauncherController.cpp 2012-08-21 17:50:55 +0000
+++ launcher/LauncherController.cpp 2012-08-24 13:03:20 +0000
@@ -1237,6 +1237,9 @@
1237 icon.Str(), icon_x, icon_y, icon_size);1237 icon.Str(), icon_x, icon_y, icon_size);
12381238
1239 g_dbus_method_invocation_return_value(invocation, nullptr);1239 g_dbus_method_invocation_return_value(invocation, nullptr);
1240
1241 for (auto launcher : launchers)
1242 launcher->QueueDraw();
1240 }1243 }
1241}1244}
12421245
12431246
=== modified file 'tests/autopilot/unity/tests/launcher/test_icon_behavior.py'
--- tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2012-08-09 01:37:02 +0000
+++ tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2012-08-24 13:03:20 +0000
@@ -150,6 +150,32 @@
150 self.assertThat(calc_icon, NotEquals(None))150 self.assertThat(calc_icon, NotEquals(None))
151 self.assertThat(calc_icon.visible, Eventually(Equals(True)))151 self.assertThat(calc_icon.visible, Eventually(Equals(True)))
152152
153 def test_software_center_add_icon(self):
154 """ Test the ability to add a SoftwareCenterLauncherIcon """
155 sleep(.5)
156
157 # Check if SC is pinned to the launcher already
158 icon = self.launcher.model.get_icon(desktop_id="ubuntu-software-center.desktop")
159 if icon != None:
160 self.launcher_instance.unlock_from_launcher(icon)
161 sleep(2.0)
162
163 self.launcher.add_launcher_item_from_position("Unity Test",
164 "softwarecenter",
165 100,
166 100,
167 32,
168 "/usr/share/applications/ubuntu-software-center.desktop",
169 "")
170
171 sleep(2.0)
172
173 icon = self.launcher.model.get_icon(desktop_id="ubuntu-software-center.desktop")
174
175 # Check if the icon tooltip is NOT empty and NOT "waiting to install"
176 self.assertThat(icon.tooltip_text == "Waiting to install", Equals(False))
177 self.assertThat(len(icon.tooltip_text) == 0, Equals(False))
178 sleep(.5)
153179
154class LauncherDragIconsBehavior(LauncherTestCase):180class LauncherDragIconsBehavior(LauncherTestCase):
155 """Tests dragging icons around the Launcher."""181 """Tests dragging icons around the Launcher."""