Merge lp:~azzar1/unity/fix-991637 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3154
Proposed branch: lp:~azzar1/unity/fix-991637
Merge into: lp:unity
Diff against target: 33 lines (+11/-1)
2 files modified
launcher/LauncherController.cpp (+1/-1)
tests/test_launcher_controller.cpp (+10/-0)
To merge this branch: bzr merge lp:~azzar1/unity/fix-991637
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Brandon Schaefer (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+148541@code.launchpad.net

Commit message

Fix lp bug 991637.

Description of the change

== Problem ==
unity launcher vanishes when switching to mirrored displays

== Test ==
Unit test added.

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

Awesome, LGTM.

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/LauncherController.cpp'
--- launcher/LauncherController.cpp 2013-02-09 15:16:41 +0000
+++ launcher/LauncherController.cpp 2013-02-14 19:33:25 +0000
@@ -216,7 +216,7 @@
216 launchers[i] = nux::ObjectPtr<Launcher>(CreateLauncher());216 launchers[i] = nux::ObjectPtr<Launcher>(CreateLauncher());
217 }217 }
218218
219 int monitor = (num_launchers == 1) ? primary : i;219 int monitor = (num_launchers == 1 && num_monitors > 1) ? primary : i;
220220
221 if (launchers[i]->monitor() != monitor)221 if (launchers[i]->monitor() != monitor)
222 {222 {
223223
=== modified file 'tests/test_launcher_controller.cpp'
--- tests/test_launcher_controller.cpp 2013-02-09 15:16:41 +0000
+++ tests/test_launcher_controller.cpp 2013-02-14 19:33:25 +0000
@@ -346,6 +346,16 @@
346 }346 }
347}347}
348348
349TEST_F(TestLauncherController, MirroredMultimonitorSingleLauncherOnExternalMonitor)
350{
351 // See lp bug 991637
352 lc.multiple_launchers = false;
353 uscreen.SetPrimary(1);
354
355 ASSERT_EQ(lc.launchers().size(), 1);
356 ASSERT_EQ(lc.launcher().monitor(), 0);
357}
358
349TEST_F(TestLauncherController, MultimonitorSwitchToMultipleLaunchers)359TEST_F(TestLauncherController, MultimonitorSwitchToMultipleLaunchers)
350{360{
351 lc.multiple_launchers = false;361 lc.multiple_launchers = false;