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

Proposed by Matthew Rasmus on 2010-12-08
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 on 2010-12-10
Alex Launi (community) 2010-12-08 Needs Fixing on 2010-12-09
Review via email: mp+43141@code.launchpad.net
To post a comment you must log in.
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
lp:~mrasmus/unity/fix-686182 updated on 2010-12-09
681. By Matthew Rasmus on 2010-12-09

My fix now plays more nicely with the starting animation, and will also not break if an application fails to launch properly.

682. By Matthew Rasmus on 2010-12-09

Merged with trunk..

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.

lp:~mrasmus/unity/fix-686182 updated on 2010-12-10
683. By Matthew Rasmus on 2010-12-10

The STARTING quirk gets set to false after an application has successfully launched instead of waiting for the running status to change...

684. By Matthew Rasmus on 2010-12-10

Merge with trunk

685. By Matthew Rasmus on 2010-12-10

Implemented DBO's suggestion in IRC

686. By Matthew Rasmus on 2010-12-10

More adjustment!!!

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
1=== modified file 'src/BamfLauncherIcon.cpp'
2--- src/BamfLauncherIcon.cpp 2010-12-10 03:15:24 +0000
3+++ src/BamfLauncherIcon.cpp 2010-12-10 22:15:11 +0000
4@@ -297,9 +297,15 @@
5
6 active = bamf_view_is_active (BAMF_VIEW (m_App));
7 running = bamf_view_is_running (BAMF_VIEW (m_App));
8-
9+
10 if (!running)
11+ {
12+ if (GetQurk (LAUNCHER_ICON_QUIRK_STARTING))
13+ return;
14+ SetQuirk (LAUNCHER_ICON_QUIRK_STARTING, true);
15 OpenInstance ();
16+ return;
17+ }
18 else if (active)
19 Spread ();
20 else
21
22=== modified file 'src/Launcher.cpp'
23--- src/Launcher.cpp 2010-12-10 15:32:43 +0000
24+++ src/Launcher.cpp 2010-12-10 22:15:11 +0000
25@@ -551,6 +551,12 @@
26 int starting_ms = TimeDelta (&current, &starting_time);
27 double starting_progress = (double) CLAMP ((float) starting_ms / (float) (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f);
28
29+ if (starting_progress == 1.0f && !icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING))
30+ {
31+ icon->SetQuirk (LAUNCHER_ICON_QUIRK_STARTING, false);
32+ icon->ResetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING);
33+ }
34+
35 return 1.0f - (0.5f + (float) (std::cos (M_PI * (float) (MAX_STARTING_BLINKS * 2) * starting_progress)) * 0.5f);
36 }
37
38@@ -562,8 +568,11 @@
39 float running_progress = CLAMP ((float) running_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
40
41 // After we finish a fade in from running, we can reset the quirk
42- if (icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING) && running_progress == 1.0f)
43- icon->ResetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING);
44+ if (running_progress == 1.0f && icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING))
45+ {
46+ icon->SetQuirk (LAUNCHER_ICON_QUIRK_STARTING, false);
47+ icon->ResetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING);
48+ }
49
50 result = IconStartingPulseValue (icon, current) * BACKLIGHT_STRENGTH;
51