Merge lp:~mrasmus/unity/fix-686182 into lp:unity

Proposed by Matthew Rasmus
Status: Merged
Merged at revision: 699
Proposed branch: lp:~mrasmus/unity/fix-686182
Merge into: lp:unity
Diff against target: 50 lines (+18/-3)
2 files modified
src/BamfLauncherIcon.cpp (+7/-1)
src/Launcher.cpp (+11/-2)
To merge this branch: bzr merge lp:~mrasmus/unity/fix-686182
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Alex Launi (community) Needs Fixing
Review via email: mp+43141@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Launi (alexlauni) wrote :

A few things.

This breaks the flashing background animation while an application is loading. The background just immediately turns colored.

If an application crashes on startup, it gets marked as running. Granted that we should fix apps so they don't crash on startup, they still do. A good way to test this when you're fixing your patch is to edit /usr/bin/gwibber and add raise RuntimeException before gtk.Main() at the end of the file.

My advice would be to use LAUNCHER_ICON_QUICK_STARTING and do something similar.

Style guidelines say to put a space between method calls and parameters.
  !GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING)
not
  !GetQuirk(LAUNCHER_ICON_QUIRK_RUNNING)

And before we can merge we need you to sign the Canonical contributers agreement: http://www.canonical.com/contributors.

review: Needs Fixing
Revision history for this message
Matthew Rasmus (mrasmus) wrote :

Thanks for the advice! I think I've managed to fix the issues you raised, and I sent in my contributer agreement.

Revision history for this message
Jason Smith (jassmith) wrote :

Perfect :) Fixed a minor type in review and all looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/BamfLauncherIcon.cpp'
--- src/BamfLauncherIcon.cpp 2010-12-10 03:15:24 +0000
+++ src/BamfLauncherIcon.cpp 2010-12-10 22:15:11 +0000
@@ -297,9 +297,15 @@
297297
298 active = bamf_view_is_active (BAMF_VIEW (m_App));298 active = bamf_view_is_active (BAMF_VIEW (m_App));
299 running = bamf_view_is_running (BAMF_VIEW (m_App));299 running = bamf_view_is_running (BAMF_VIEW (m_App));
300300
301 if (!running)301 if (!running)
302 {
303 if (GetQurk (LAUNCHER_ICON_QUIRK_STARTING))
304 return;
305 SetQuirk (LAUNCHER_ICON_QUIRK_STARTING, true);
302 OpenInstance ();306 OpenInstance ();
307 return;
308 }
303 else if (active)309 else if (active)
304 Spread ();310 Spread ();
305 else311 else
306312
=== modified file 'src/Launcher.cpp'
--- src/Launcher.cpp 2010-12-10 15:32:43 +0000
+++ src/Launcher.cpp 2010-12-10 22:15:11 +0000
@@ -551,6 +551,12 @@
551 int starting_ms = TimeDelta (&current, &starting_time);551 int starting_ms = TimeDelta (&current, &starting_time);
552 double starting_progress = (double) CLAMP ((float) starting_ms / (float) (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f);552 double starting_progress = (double) CLAMP ((float) starting_ms / (float) (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f);
553553
554 if (starting_progress == 1.0f && !icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING))
555 {
556 icon->SetQuirk (LAUNCHER_ICON_QUIRK_STARTING, false);
557 icon->ResetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING);
558 }
559
554 return 1.0f - (0.5f + (float) (std::cos (M_PI * (float) (MAX_STARTING_BLINKS * 2) * starting_progress)) * 0.5f);560 return 1.0f - (0.5f + (float) (std::cos (M_PI * (float) (MAX_STARTING_BLINKS * 2) * starting_progress)) * 0.5f);
555}561}
556562
@@ -562,8 +568,11 @@
562 float running_progress = CLAMP ((float) running_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);568 float running_progress = CLAMP ((float) running_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
563569
564 // After we finish a fade in from running, we can reset the quirk570 // After we finish a fade in from running, we can reset the quirk
565 if (icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING) && running_progress == 1.0f)571 if (running_progress == 1.0f && icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING))
566 icon->ResetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING);572 {
573 icon->SetQuirk (LAUNCHER_ICON_QUIRK_STARTING, false);
574 icon->ResetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING);
575 }
567576
568 result = IconStartingPulseValue (icon, current) * BACKLIGHT_STRENGTH;577 result = IconStartingPulseValue (icon, current) * BACKLIGHT_STRENGTH;
569578