Merge lp:~3v1n0/unity/app-icon-ensure-on-running-5.0 into lp:unity/5.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2409
Proposed branch: lp:~3v1n0/unity/app-icon-ensure-on-running-5.0
Merge into: lp:unity/5.0
Diff against target: 86 lines (+26/-13)
1 file modified
plugins/unityshell/src/BamfLauncherIcon.cpp (+26/-13)
To merge this branch: bzr merge lp:~3v1n0/unity/app-icon-ensure-on-running-5.0
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Review via email: mp+129477@code.launchpad.net

Commit message

BamfLauncherIcon: ensure the icon and name values when the running state changes

This avoids to get "?" icons

Description of the change

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp'
2--- plugins/unityshell/src/BamfLauncherIcon.cpp 2012-09-21 18:13:12 +0000
3+++ plugins/unityshell/src/BamfLauncherIcon.cpp 2012-10-12 16:55:28 +0000
4@@ -80,7 +80,7 @@
5 glib::SignalBase* sig;
6
7 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-added",
8- [&] (BamfView*, BamfView*) {
9+ [this] (BamfView*, BamfView*) {
10 EnsureWindowState();
11 UpdateMenus();
12 UpdateIconGeometries(GetCenters());
13@@ -88,48 +88,61 @@
14 _gsignals.Add(sig);
15
16 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-removed",
17- [&] (BamfView*, BamfView*) { EnsureWindowState(); });
18+ [this] (BamfView*, BamfView*) { EnsureWindowState(); });
19 _gsignals.Add(sig);
20
21 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "urgent-changed",
22- [&] (BamfView*, gboolean urgent) {
23+ [this] (BamfView*, gboolean urgent) {
24 SetQuirk(QUIRK_URGENT, urgent);
25 });
26 _gsignals.Add(sig);
27
28 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "active-changed",
29- [&] (BamfView*, gboolean active) {
30+ [this] (BamfView*, gboolean active) {
31 SetQuirk(QUIRK_ACTIVE, active);
32 });
33 _gsignals.Add(sig);
34
35 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "running-changed",
36- [&] (BamfView*, gboolean running) {
37+ [this] (BamfView* view, gboolean running) {
38 SetQuirk(QUIRK_RUNNING, running);
39
40 if (running)
41 {
42+ if (_remove_timeout_id)
43+ {
44+ g_source_remove(_remove_timeout_id);
45+ _remove_timeout_id = 0;
46+ }
47+
48+ /* It can happen that these values are not set
49+ * during initialization if the view is closed
50+ * very early, so we need to make sure that they
51+ * are updated as soon as the view is re-opened. */
52+ if (tooltip_text().empty())
53+ tooltip_text = BamfName();
54+
55+ if (icon_name == DEFAULT_ICON)
56+ {
57+ glib::String icon(bamf_view_get_icon(view));
58+ icon_name = (icon ? icon.Str() : DEFAULT_ICON);
59+ }
60+
61 EnsureWindowState();
62 UpdateIconGeometries(GetCenters());
63-
64- if (_remove_timeout_id)
65- {
66- g_source_remove(_remove_timeout_id);
67- _remove_timeout_id = 0;
68- }
69 }
70 });
71 _gsignals.Add(sig);
72
73 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "user-visible-changed",
74- [&] (BamfView*, gboolean visible) {
75+ [this] (BamfView*, gboolean visible) {
76 if (!IsSticky())
77 SetQuirk(QUIRK_VISIBLE, visible);
78 });
79 _gsignals.Add(sig);
80
81 sig = new glib::Signal<void, BamfView*>(bamf_view, "closed",
82- [&] (BamfView*) {
83+ [this] (BamfView*) {
84 if (!IsSticky())
85 {
86 /* Use a timeout to remove the icon, this avoids

Subscribers

People subscribed via source and target branches