Mir

Merge lp:mir/0.22 into lp:mir/ubuntu

Proposed by Andreas Pokorny on 2016-05-15
Status: Merged
Approved by: Kevin DuBois on 2016-05-17
Approved revision: 3485
Merged at revision: 1275
Proposed branch: lp:mir/0.22
Merge into: lp:mir/ubuntu
Diff against target: 213 lines (+157/-7)
4 files modified
CMakeLists.txt (+1/-1)
debian/changelog (+10/-0)
src/server/scene/mediating_display_changer.cpp (+5/-6)
tests/unit-tests/scene/test_mediating_display_changer.cpp (+141/-0)
To merge this branch: bzr merge lp:mir/0.22
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve on 2016-05-18
Kevin DuBois (community) 2016-05-15 Approve on 2016-05-17
PS Jenkins bot continuous-integration Pending
Review via email: mp+294726@code.launchpad.net

Commit message

Mir bugfix release 0.22.1

Description of the change

Mir release 0.22.1

To post a comment you must log in.
lp:mir/0.22 updated on 2016-05-16
3485. By Andreas Pokorny on 2016-05-16

Also include used flag

Cemil Azizoglu (cemil-azizoglu) wrote :

Ok

Kevin DuBois (kdub) wrote :

alright

review: Approve
Daniel van Vugt (vanvugt) wrote :

Sure

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-04-21 17:36:10 +0000
3+++ CMakeLists.txt 2016-05-16 07:47:48 +0000
4@@ -29,7 +29,7 @@
5
6 set(MIR_VERSION_MAJOR 0)
7 set(MIR_VERSION_MINOR 22)
8-set(MIR_VERSION_PATCH 0)
9+set(MIR_VERSION_PATCH 1)
10
11 add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
12 add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2016-04-22 22:38:16 +0000
16+++ debian/changelog 2016-05-16 07:47:48 +0000
17@@ -1,3 +1,13 @@
18+mir (0.22.1-0ubuntu1) UNRELEASED; urgency=medium
19+
20+ * New upstream release 0.22.1 (https://launchpad.net/mir/+milestone/0.22.1)
21+ - ABI summary:
22+ . No ABI changes in any libraries. Bugfix release only.
23+ - Bugs fixed:
24+ . [regression] Cursor stops at phantom edge on M10 and N7 (LP: 1580774)
25+
26+ -- Andreas Pokorny <andreas.pokorny@canonical.com> Sun, 15 May 2016 13:26:56 +0200
27+
28 mir (0.22.0+16.04.20160422.2-0ubuntu1) xenial; urgency=medium
29
30 [ Alberto Aguirre ]
31
32=== modified file 'src/server/scene/mediating_display_changer.cpp'
33--- src/server/scene/mediating_display_changer.cpp 2016-03-23 06:39:56 +0000
34+++ src/server/scene/mediating_display_changer.cpp 2016-05-16 07:47:48 +0000
35@@ -353,11 +353,10 @@
36 void ms::MediatingDisplayChanger::update_input_rectangles(mg::DisplayConfiguration const& config)
37 {
38 geometry::Rectangles rectangles;
39- config.for_each_output(
40- [&rectangles](mg::DisplayConfigurationOutput const& output)
41- {
42- if (output.power_mode == mir_power_mode_on && output.current_mode_index < output.modes.size())
43- rectangles.add(geometry::Rectangle(output.top_left, output.modes[output.current_mode_index].size));
44- });
45+ config.for_each_output([&rectangles](mg::DisplayConfigurationOutput const& output) {
46+ if (output.used && output.connected && output.power_mode == mir_power_mode_on &&
47+ output.current_mode_index < output.modes.size())
48+ rectangles.add(geometry::Rectangle(output.top_left, output.modes[output.current_mode_index].size));
49+ });
50 region->set_input_rectangles(rectangles);
51 }
52
53=== modified file 'tests/unit-tests/scene/test_mediating_display_changer.cpp'
54--- tests/unit-tests/scene/test_mediating_display_changer.cpp 2016-03-23 06:39:56 +0000
55+++ tests/unit-tests/scene/test_mediating_display_changer.cpp 2016-05-16 07:47:48 +0000
56@@ -45,12 +45,52 @@
57 namespace mf = mir::frontend;
58 namespace ms = mir::scene;
59 namespace mg = mir::graphics;
60+namespace geom = mir::geometry;
61
62 using namespace testing;
63
64 namespace
65 {
66
67+auto display_output(
68+ mg::DisplayConfigurationOutputId id, geom::Point pos, geom::Size size, bool connected, bool used, MirPowerMode mode)
69+ -> mg::DisplayConfigurationOutput
70+{
71+ return mg::DisplayConfigurationOutput{id,
72+ mg::DisplayConfigurationCardId{0},
73+ mg::DisplayConfigurationOutputType::lvds,
74+ std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888},
75+ {mg::DisplayConfigurationMode{size, 60}},
76+ 0,
77+ geom::Size{40, 40},
78+ connected,
79+ used,
80+ pos,
81+ 0,
82+ mir_pixel_format_abgr_8888,
83+ mode,
84+ mir_orientation_normal,
85+ 1.0f,
86+ mir_form_factor_phone
87+ };
88+}
89+
90+struct TestDisplayConfiguration : mtd::NullDisplayConfiguration
91+{
92+ std::vector<mg::DisplayConfigurationOutput> const outputs;
93+ TestDisplayConfiguration(std::vector<mg::DisplayConfigurationOutput> const& items)
94+ : outputs{items} {}
95+ void for_each_output(std::function<void(mg::DisplayConfigurationOutput const&)> fun) const override
96+ {
97+ for (auto const& output : outputs)
98+ fun(output);
99+ }
100+ std::unique_ptr<mg::DisplayConfiguration> clone() const override
101+ {
102+ return std::make_unique<TestDisplayConfiguration>(outputs);
103+ }
104+};
105+
106 class MockDisplayConfigurationPolicy : public mg::DisplayConfigurationPolicy
107 {
108 public:
109@@ -806,3 +846,104 @@
110 ASSERT_THAT(received_configuration, Not(Eq(nullptr)));
111 EXPECT_THAT(*received_configuration, mt::DisplayConfigMatches(std::cref(*new_config)));
112 }
113+
114+TEST_F(MediatingDisplayChangerTest, input_region_skipps_not_connected_displays)
115+{
116+ using namespace testing;
117+
118+ auto const connected = true;
119+ auto const disconnected = false;
120+ auto const used = true;
121+ mir::geometry::Rectangles expected_rectangles;
122+ expected_rectangles.add(geom::Rectangle{geom::Point{0,0}, geom::Size{100,100}});
123+
124+ TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0},
125+ geom::Point{0, 0},
126+ geom::Size{100, 100},
127+ connected,
128+ used,
129+ mir_power_mode_on),
130+ display_output(mg::DisplayConfigurationOutputId{1},
131+ geom::Point{100, 0},
132+ geom::Size{100, 100},
133+ disconnected,
134+ used,
135+ mir_power_mode_on)}};
136+
137+ EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles));
138+
139+ auto session = std::make_shared<mtd::StubSession>();
140+
141+ session_event_sink.handle_focus_change(session);
142+ changer->configure(session,
143+ mt::fake_shared(conf));
144+}
145+
146+TEST_F(MediatingDisplayChangerTest, input_region_accumulates_powered_and_connected_displays)
147+{
148+ using namespace testing;
149+
150+ auto const connected = true;
151+ auto const first_monitor = geom::Rectangle{geom::Point{0, 0}, geom::Size{ 40, 40 }};
152+ auto const second_monitor = geom::Rectangle{geom::Point{40, 0}, geom::Size{ 10, 10}};
153+ auto const used = true;
154+ mir::geometry::Rectangles expected_rectangles;
155+ expected_rectangles.add(first_monitor);
156+ expected_rectangles.add(second_monitor);
157+
158+ TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0},
159+ first_monitor.top_left,
160+ first_monitor.size,
161+ connected,
162+ used,
163+ mir_power_mode_on),
164+ display_output(mg::DisplayConfigurationOutputId{1},
165+ second_monitor.top_left,
166+ second_monitor.size,
167+ connected,
168+ used,
169+ mir_power_mode_on)}};
170+
171+ EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles));
172+
173+ auto session = std::make_shared<mtd::StubSession>();
174+
175+ session_event_sink.handle_focus_change(session);
176+ changer->configure(session,
177+ mt::fake_shared(conf));
178+}
179+
180+
181+TEST_F(MediatingDisplayChangerTest, input_region_accumulates_powered_connected_skips_unused_displays)
182+{
183+ using namespace testing;
184+
185+ auto const connected = true;
186+ auto const first_monitor = geom::Rectangle{geom::Point{0, 0}, geom::Size{ 40, 40 }};
187+ auto const second_monitor = geom::Rectangle{geom::Point{40, 0}, geom::Size{ 10, 10}};
188+ auto const not_used = false;
189+ auto const used = true;
190+ mir::geometry::Rectangles expected_rectangles;
191+ expected_rectangles.add(second_monitor);
192+
193+ TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0},
194+ first_monitor.top_left,
195+ first_monitor.size,
196+ connected,
197+ not_used,
198+ mir_power_mode_on),
199+ display_output(mg::DisplayConfigurationOutputId{1},
200+ second_monitor.top_left,
201+ second_monitor.size,
202+ connected,
203+ used,
204+ mir_power_mode_on)}};
205+
206+ EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles));
207+
208+ auto session = std::make_shared<mtd::StubSession>();
209+
210+ session_event_sink.handle_focus_change(session);
211+ changer->configure(session,
212+ mt::fake_shared(conf));
213+}

Subscribers

People subscribed via source and target branches

to all changes: