Merge lp:~3v1n0/unity/fix-783434 into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Jason Smith
Approved revision: no longer in the source branch.
Merged at revision: 1331
Proposed branch: lp:~3v1n0/unity/fix-783434
Merge into: lp:unity
Diff against target: 69 lines (+19/-11)
1 file modified
plugins/unityshell/src/BamfLauncherIcon.cpp (+19/-11)
To merge this branch: bzr merge lp:~3v1n0/unity/fix-783434
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Jason Smith (community) Approve
Review via email: mp+69713@code.launchpad.net

Description of the change

Fixing bug #783434 as requested by specs.

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

+1 This code needs more work but this is good progress

review: Approve
Revision history for this message
Neil J. Patel (njpatel) :
review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Yes, there's more in lp:~3v1n0/unity/fix-688117, but I've not asked for merge yet (also because due to compiz the fix won't cover all the cases).

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 2011-07-21 14:59:25 +0000
3+++ plugins/unityshell/src/BamfLauncherIcon.cpp 2011-07-28 20:32:25 +0000
4@@ -389,6 +389,7 @@
5 BamfView* view;
6 bool any_urgent = false;
7 bool any_on_current = false;
8+ bool any_mapped = false;
9
10 children = bamf_view_get_children(BAMF_VIEW(m_App));
11
12@@ -423,27 +424,33 @@
13
14 /* sort the list */
15 CompWindowList tmp;
16- CompWindowList::iterator it;
17- for (it = m_Screen->windows().begin(); it != m_Screen->windows().end(); it++)
18+ for (CompWindow* &win : m_Screen->windows())
19 {
20- if (std::find(windows.begin(), windows.end(), *it) != windows.end())
21- tmp.push_back(*it);
22+ if (std::find(windows.begin(), windows.end(), win) != windows.end())
23+ tmp.push_back(win);
24 }
25 windows = tmp;
26
27 /* filter based on workspace */
28- for (it = windows.begin(); it != windows.end(); it++)
29+ for (CompWindow* &win : windows)
30 {
31- if ((*it)->defaultViewport() == m_Screen->vp())
32+ if (win->defaultViewport() == m_Screen->vp())
33 {
34 any_on_current = true;
35+ }
36+
37+ if (!win->minimized())
38+ {
39+ any_mapped = true;
40+ }
41+
42+ if (any_on_current && any_mapped)
43 break;
44- }
45 }
46
47 if (any_urgent)
48 {
49- // we cant use the compiz tracking since it is currently broken
50+ // FIXME we cant use the compiz tracking since it is currently broken
51 /*for (it = windows.begin (); it != windows.end (); it++)
52 {
53 if ((*it)->state () & CompWindowStateDemandsAttentionMask)
54@@ -472,11 +479,12 @@
55 }
56 else if (any_on_current)
57 {
58- for (it = windows.begin(); it != windows.end(); it++)
59+ for (CompWindow* &win : windows)
60 {
61- if ((*it)->defaultViewport() == m_Screen->vp())
62+ if (win->defaultViewport() == m_Screen->vp() &&
63+ ((any_mapped && !win->minimized()) || !any_mapped))
64 {
65- (*it)->activate();
66+ win->activate();
67 }
68 }
69 }