Merge lp:~unity-team/unity/unity.fix-916228 into lp:unity

Proposed by Jason Smith
Status: Merged
Approved by: Jason Smith
Approved revision: no longer in the source branch.
Merged at revision: 1905
Proposed branch: lp:~unity-team/unity/unity.fix-916228
Merge into: lp:unity
Diff against target: 54 lines (+14/-1)
3 files modified
plugins/unityshell/src/LauncherController.cpp (+8/-1)
plugins/unityshell/src/PointerBarrier.cpp (+5/-0)
plugins/unityshell/src/PointerBarrier.h (+1/-0)
To merge this branch: bzr merge lp:~unity-team/unity/unity.fix-916228
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Tim Penhey (community) Approve
Review via email: mp+91738@code.launchpad.net

Description of the change

Fix duplicate launchers

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Looks good.

review: Approve
Revision history for this message
Jay Taoko (jaytaoko) wrote :

Tested and works fine!

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/LauncherController.cpp'
2--- plugins/unityshell/src/LauncherController.cpp 2012-02-04 03:45:20 +0000
3+++ plugins/unityshell/src/LauncherController.cpp 2012-02-06 23:22:19 +0000
4@@ -273,7 +273,8 @@
5 {
6 unsigned int num_monitors = monitors.size();
7
8- for (unsigned int i = 0; i < num_monitors; i++)
9+ unsigned int i;
10+ for (i = 0; i < num_monitors; i++)
11 {
12 if (i >= launchers.size())
13 launchers.push_back(nux::ObjectPtr<Launcher> (CreateLauncher(i)));
14@@ -281,6 +282,12 @@
15 launchers[i]->Resize();
16 }
17
18+ for (; i < launchers.size(); ++i)
19+ {
20+ auto launcher = launchers[i];
21+ if (launcher.IsValid())
22+ launcher->GetParent()->UnReference();
23+ }
24 launchers.resize(num_monitors);
25 }
26
27
28=== modified file 'plugins/unityshell/src/PointerBarrier.cpp'
29--- plugins/unityshell/src/PointerBarrier.cpp 2012-02-01 00:06:29 +0000
30+++ plugins/unityshell/src/PointerBarrier.cpp 2012-02-06 23:22:19 +0000
31@@ -48,6 +48,11 @@
32 max_velocity_multiplier = 1.0f;
33 }
34
35+PointerBarrierWrapper::~PointerBarrierWrapper()
36+{
37+ DestroyBarrier();
38+}
39+
40 void PointerBarrierWrapper::ConstructBarrier()
41 {
42 if (active)
43
44=== modified file 'plugins/unityshell/src/PointerBarrier.h'
45--- plugins/unityshell/src/PointerBarrier.h 2012-02-01 00:06:29 +0000
46+++ plugins/unityshell/src/PointerBarrier.h 2012-02-06 23:22:19 +0000
47@@ -60,6 +60,7 @@
48 nux::Property<float> max_velocity_multiplier;
49
50 PointerBarrierWrapper();
51+ ~PointerBarrierWrapper();
52
53 void ConstructBarrier();
54 void DestroyBarrier();