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
1=== modified file 'launcher/LauncherController.cpp'
2--- launcher/LauncherController.cpp 2013-02-09 15:16:41 +0000
3+++ launcher/LauncherController.cpp 2013-02-14 19:33:25 +0000
4@@ -216,7 +216,7 @@
5 launchers[i] = nux::ObjectPtr<Launcher>(CreateLauncher());
6 }
7
8- int monitor = (num_launchers == 1) ? primary : i;
9+ int monitor = (num_launchers == 1 && num_monitors > 1) ? primary : i;
10
11 if (launchers[i]->monitor() != monitor)
12 {
13
14=== modified file 'tests/test_launcher_controller.cpp'
15--- tests/test_launcher_controller.cpp 2013-02-09 15:16:41 +0000
16+++ tests/test_launcher_controller.cpp 2013-02-14 19:33:25 +0000
17@@ -346,6 +346,16 @@
18 }
19 }
20
21+TEST_F(TestLauncherController, MirroredMultimonitorSingleLauncherOnExternalMonitor)
22+{
23+ // See lp bug 991637
24+ lc.multiple_launchers = false;
25+ uscreen.SetPrimary(1);
26+
27+ ASSERT_EQ(lc.launchers().size(), 1);
28+ ASSERT_EQ(lc.launcher().monitor(), 0);
29+}
30+
31 TEST_F(TestLauncherController, MultimonitorSwitchToMultipleLaunchers)
32 {
33 lc.multiple_launchers = false;