Merge lp:~andreas-pokorny/mir/remove-input-region into lp:mir
- remove-input-region
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4068 |
Proposed branch: | lp:~andreas-pokorny/mir/remove-input-region |
Merge into: | lp:mir |
Prerequisite: | lp:~andreas-pokorny/mir/map-touchscreen-to-output |
Diff against target: |
800 lines (+0/-510) 17 files modified
src/include/server/mir/default_server_configuration.h (+0/-3) src/include/server/mir/input/input_region.h (+0/-65) src/server/input/CMakeLists.txt (+0/-1) src/server/input/basic_seat.h (+0/-1) src/server/input/default_configuration.cpp (+0/-10) src/server/input/display_input_region.cpp (+0/-51) src/server/input/display_input_region.h (+0/-51) src/server/input/seat_input_device_tracker.h (+0/-1) src/server/scene/default_configuration.cpp (+0/-1) src/server/scene/mediating_display_changer.cpp (+0/-15) src/server/scene/mediating_display_changer.h (+0/-8) src/server/symbols.map (+0/-1) tests/include/mir/test/doubles/mock_input_region.h (+0/-49) tests/unit-tests/input/CMakeLists.txt (+0/-1) tests/unit-tests/input/test_default_input_device_hub.cpp (+0/-1) tests/unit-tests/input/test_display_input_region.cpp (+0/-87) tests/unit-tests/scene/test_mediating_display_changer.cpp (+0/-164) |
To merge this branch: | bzr merge lp:~andreas-pokorny/mir/remove-input-region |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Mir CI Bot | continuous-integration | Approve | |
Chris Halse Rogers | Approve | ||
Kevin DuBois (community) | Approve | ||
Review via email: mp+316713@code.launchpad.net |
Commit message
mirserver: remove InputRegion
The functionality has been moved to the input platforms and BasicSeat.
Description of the change
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4013
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4014
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4015
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4016
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Chris Halse Rogers (raof) wrote : | # |
That's a pleasing sea of red.
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4017
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
It seems the changeover already occurred, but please see bug 1669444 which might be related.
Preview Diff
1 | === modified file 'src/include/server/mir/default_server_configuration.h' |
2 | --- src/include/server/mir/default_server_configuration.h 2017-02-16 05:44:15 +0000 |
3 | +++ src/include/server/mir/default_server_configuration.h 2017-02-22 08:39:26 +0000 |
4 | @@ -138,7 +138,6 @@ |
5 | class EventFilterChainDispatcher; |
6 | class CursorListener; |
7 | class TouchVisualizer; |
8 | -class InputRegion; |
9 | class CursorImages; |
10 | class Seat; |
11 | class KeyMapper; |
12 | @@ -324,7 +323,6 @@ |
13 | virtual std::shared_ptr<input::Scene> the_input_scene(); |
14 | virtual std::shared_ptr<input::CursorListener> the_cursor_listener(); |
15 | virtual std::shared_ptr<input::TouchVisualizer> the_touch_visualizer(); |
16 | - virtual std::shared_ptr<input::InputRegion> the_input_region(); |
17 | virtual std::shared_ptr<input::Seat> the_seat(); |
18 | virtual std::shared_ptr<input::KeyMapper> the_key_mapper(); |
19 | |
20 | @@ -388,7 +386,6 @@ |
21 | CachedPtr<input::DefaultInputDeviceHub> default_input_device_hub; |
22 | CachedPtr<dispatch::MultiplexingDispatchable> input_reading_multiplexer; |
23 | CachedPtr<input::InputDispatcher> input_dispatcher; |
24 | - CachedPtr<input::InputRegion> input_region; |
25 | CachedPtr<shell::InputTargeter> input_targeter; |
26 | CachedPtr<input::CursorListener> cursor_listener; |
27 | CachedPtr<input::TouchVisualizer> touch_visualizer; |
28 | |
29 | === removed file 'src/include/server/mir/input/input_region.h' |
30 | --- src/include/server/mir/input/input_region.h 2017-01-18 02:29:37 +0000 |
31 | +++ src/include/server/mir/input/input_region.h 1970-01-01 00:00:00 +0000 |
32 | @@ -1,65 +0,0 @@ |
33 | -/* |
34 | - * Copyright © 2013 Canonical Ltd. |
35 | - * |
36 | - * This program is free software: you can redistribute it and/or modify it |
37 | - * under the terms of the GNU General Public License version 3, |
38 | - * as published by the Free Software Foundation. |
39 | - * |
40 | - * This program is distributed in the hope that it will be useful, |
41 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
42 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
43 | - * GNU General Public License for more details. |
44 | - * |
45 | - * You should have received a copy of the GNU General Public License |
46 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
47 | - * |
48 | - * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
49 | - */ |
50 | - |
51 | -#ifndef MIR_INPUT_INPUT_REGION_H_ |
52 | -#define MIR_INPUT_INPUT_REGION_H_ |
53 | - |
54 | -namespace mir |
55 | -{ |
56 | -namespace geometry |
57 | -{ |
58 | -struct Rectangle; |
59 | -struct Rectangles; |
60 | -struct Point; |
61 | -} |
62 | -namespace input |
63 | -{ |
64 | - |
65 | -/** |
66 | - * Interface to the region of valid input coordinates. |
67 | - */ |
68 | -class InputRegion |
69 | -{ |
70 | -public: |
71 | - virtual ~InputRegion() = default; |
72 | - |
73 | - /** The bounding rectangle of the input region */ |
74 | - virtual geometry::Rectangle bounding_rectangle() = 0; |
75 | - |
76 | - /** |
77 | - * Confines a point to the input region. |
78 | - * |
79 | - * If the point is within input region it remains unchanged, |
80 | - * otherwise it is replaced by the region point that is closest to |
81 | - * it. |
82 | - * |
83 | - * @param [in,out] point the point to confine |
84 | - */ |
85 | - virtual void confine(geometry::Point& point) = 0; |
86 | - virtual void set_input_rectangles(geometry::Rectangles const& rectangles) = 0; |
87 | - |
88 | -protected: |
89 | - InputRegion() = default; |
90 | - InputRegion(InputRegion const&) = delete; |
91 | - InputRegion& operator=(InputRegion const&) = delete; |
92 | -}; |
93 | - |
94 | -} |
95 | -} |
96 | - |
97 | -#endif /* MIR_INPUT_INPUT_REGION_H_ */ |
98 | |
99 | === modified file 'src/server/input/CMakeLists.txt' |
100 | --- src/server/input/CMakeLists.txt 2017-02-15 14:45:41 +0000 |
101 | +++ src/server/input/CMakeLists.txt 2017-02-22 08:39:26 +0000 |
102 | @@ -12,7 +12,6 @@ |
103 | default_event_builder.cpp |
104 | default_input_device_hub.cpp |
105 | default_input_manager.cpp |
106 | - display_input_region.cpp |
107 | event_filter_chain_dispatcher.cpp |
108 | input_modifier_utils.cpp |
109 | input_probe.cpp |
110 | |
111 | === modified file 'src/server/input/basic_seat.h' |
112 | --- src/server/input/basic_seat.h 2017-02-22 08:39:25 +0000 |
113 | +++ src/server/input/basic_seat.h 2017-02-22 08:39:26 +0000 |
114 | @@ -41,7 +41,6 @@ |
115 | { |
116 | class TouchVisualizer; |
117 | class CursorListener; |
118 | -class InputRegion; |
119 | class InputDispatcher; |
120 | class KeyMapper; |
121 | class SeatObserver; |
122 | |
123 | === modified file 'src/server/input/default_configuration.cpp' |
124 | --- src/server/input/default_configuration.cpp 2017-02-22 08:39:25 +0000 |
125 | +++ src/server/input/default_configuration.cpp 2017-02-22 08:39:26 +0000 |
126 | @@ -19,7 +19,6 @@ |
127 | #include "mir/default_server_configuration.h" |
128 | |
129 | #include "key_repeat_dispatcher.h" |
130 | -#include "display_input_region.h" |
131 | #include "event_filter_chain_dispatcher.h" |
132 | #include "config_changer.h" |
133 | #include "cursor_controller.h" |
134 | @@ -96,15 +95,6 @@ |
135 | |
136 | } |
137 | |
138 | -std::shared_ptr<mi::InputRegion> mir::DefaultServerConfiguration::the_input_region() |
139 | -{ |
140 | - return input_region( |
141 | - []() |
142 | - { |
143 | - return std::make_shared<mi::DisplayInputRegion>(); |
144 | - }); |
145 | -} |
146 | - |
147 | std::shared_ptr<mi::CompositeEventFilter> |
148 | mir::DefaultServerConfiguration::the_composite_event_filter() |
149 | { |
150 | |
151 | === removed file 'src/server/input/display_input_region.cpp' |
152 | --- src/server/input/display_input_region.cpp 2017-01-18 02:29:37 +0000 |
153 | +++ src/server/input/display_input_region.cpp 1970-01-01 00:00:00 +0000 |
154 | @@ -1,51 +0,0 @@ |
155 | -/* |
156 | - * Copyright © 2013 Canonical Ltd. |
157 | - * |
158 | - * This program is free software: you can redistribute it and/or modify it |
159 | - * under the terms of the GNU General Public License version 3, |
160 | - * as published by the Free Software Foundation. |
161 | - * |
162 | - * This program is distributed in the hope that it will be useful, |
163 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
164 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
165 | - * GNU General Public License for more details. |
166 | - * |
167 | - * You should have received a copy of the GNU General Public License |
168 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
169 | - * |
170 | - * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
171 | - */ |
172 | - |
173 | -#include "display_input_region.h" |
174 | -#include "mir/graphics/display_configuration.h" |
175 | - |
176 | -#include "mir/geometry/rectangle.h" |
177 | -#include "mir/geometry/rectangles.h" |
178 | - |
179 | -namespace mi = mir::input; |
180 | -namespace mg = mir::graphics; |
181 | -namespace geom = mir::geometry; |
182 | - |
183 | -void mi::DisplayInputRegion::set_input_rectangles(geometry::Rectangles const& config) |
184 | -{ |
185 | - std::unique_lock<std::mutex> lock(rectangle_guard); |
186 | - rectangles = config; |
187 | -} |
188 | - |
189 | -geom::Rectangle mi::DisplayInputRegion::bounding_rectangle() |
190 | -{ |
191 | - //TODO: This region is mainly used for scaling touchscreen coordinates, so the caller |
192 | - // probably wants the full list of rectangles. Additional work is needed |
193 | - // to group a touchscreen with a display. So for now, just return the view area |
194 | - // of the first display, as that matches the most common systems (laptops with touchscreens, |
195 | - // phone/tablets with touchscreens). |
196 | - if (rectangles.size() != 0) |
197 | - return *rectangles.begin(); |
198 | - else |
199 | - return geom::Rectangle{}; |
200 | -} |
201 | - |
202 | -void mi::DisplayInputRegion::confine(geom::Point& point) |
203 | -{ |
204 | - rectangles.confine(point); |
205 | -} |
206 | |
207 | === removed file 'src/server/input/display_input_region.h' |
208 | --- src/server/input/display_input_region.h 2017-01-18 02:29:37 +0000 |
209 | +++ src/server/input/display_input_region.h 1970-01-01 00:00:00 +0000 |
210 | @@ -1,51 +0,0 @@ |
211 | -/* |
212 | - * Copyright © 2013 Canonical Ltd. |
213 | - * |
214 | - * This program is free software: you can redistribute it and/or modify it |
215 | - * under the terms of the GNU General Public License version 3, |
216 | - * as published by the Free Software Foundation. |
217 | - * |
218 | - * This program is distributed in the hope that it will be useful, |
219 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
220 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
221 | - * GNU General Public License for more details. |
222 | - * |
223 | - * You should have received a copy of the GNU General Public License |
224 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
225 | - * |
226 | - * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
227 | - */ |
228 | - |
229 | -#ifndef MIR_INPUT_DISPLAY_INPUT_REGION_H_ |
230 | -#define MIR_INPUT_DISPLAY_INPUT_REGION_H_ |
231 | - |
232 | -#include "mir/input/input_region.h" |
233 | -#include "mir/geometry/rectangles.h" |
234 | - |
235 | -#include <memory> |
236 | -#include <mutex> |
237 | - |
238 | -namespace mir |
239 | -{ |
240 | -namespace input |
241 | -{ |
242 | - |
243 | -class DisplayInputRegion : public InputRegion |
244 | -{ |
245 | -public: |
246 | - DisplayInputRegion() = default; |
247 | - |
248 | - geometry::Rectangle bounding_rectangle() override; |
249 | - void confine(geometry::Point& point) override; |
250 | - void set_input_rectangles(geometry::Rectangles const& rectangles) override; |
251 | - |
252 | -private: |
253 | - std::mutex rectangle_guard; |
254 | - geometry::Rectangles rectangles; |
255 | -}; |
256 | - |
257 | -} |
258 | -} |
259 | - |
260 | -#endif /* MIR_INPUT_DISPLAY_INPUT_REGION_H_ */ |
261 | - |
262 | |
263 | === modified file 'src/server/input/seat_input_device_tracker.h' |
264 | --- src/server/input/seat_input_device_tracker.h 2017-02-22 08:39:25 +0000 |
265 | +++ src/server/input/seat_input_device_tracker.h 2017-02-22 08:39:26 +0000 |
266 | @@ -41,7 +41,6 @@ |
267 | namespace input |
268 | { |
269 | class CursorListener; |
270 | -class InputRegion; |
271 | class InputDispatcher; |
272 | class KeyMapper; |
273 | class SeatObserver; |
274 | |
275 | === modified file 'src/server/scene/default_configuration.cpp' |
276 | --- src/server/scene/default_configuration.cpp 2017-02-15 14:45:41 +0000 |
277 | +++ src/server/scene/default_configuration.cpp 2017-02-22 08:39:26 +0000 |
278 | @@ -140,7 +140,6 @@ |
279 | the_session_event_handler_register(), |
280 | the_server_action_queue(), |
281 | the_display_configuration_observer(), |
282 | - the_input_region(), |
283 | the_main_loop()); |
284 | }); |
285 | |
286 | |
287 | === modified file 'src/server/scene/mediating_display_changer.cpp' |
288 | --- src/server/scene/mediating_display_changer.cpp 2017-01-30 05:18:36 +0000 |
289 | +++ src/server/scene/mediating_display_changer.cpp 2017-02-22 08:39:26 +0000 |
290 | @@ -38,7 +38,6 @@ |
291 | namespace ms = mir::scene; |
292 | namespace mg = mir::graphics; |
293 | namespace mc = mir::compositor; |
294 | -namespace mi = mir::input; |
295 | namespace mt = mir::time; |
296 | |
297 | namespace |
298 | @@ -132,7 +131,6 @@ |
299 | std::shared_ptr<SessionEventHandlerRegister> const& session_event_handler_register, |
300 | std::shared_ptr<ServerActionQueue> const& server_action_queue, |
301 | std::shared_ptr<mg::DisplayConfigurationObserver> const& observer, |
302 | - std::shared_ptr<mi::InputRegion> const& region, |
303 | std::shared_ptr<mt::AlarmFactory> const& alarm_factory) |
304 | : display{display}, |
305 | compositor{compositor}, |
306 | @@ -143,7 +141,6 @@ |
307 | observer{observer}, |
308 | base_configuration_{display->configuration()}, |
309 | base_configuration_applied{true}, |
310 | - region{region}, |
311 | alarm_factory{alarm_factory} |
312 | { |
313 | session_event_handler_register->register_focus_change_handler( |
314 | @@ -181,7 +178,6 @@ |
315 | }); |
316 | |
317 | observer->initial_configuration(base_configuration_); |
318 | - update_input_rectangles(*base_configuration_); |
319 | } |
320 | |
321 | void ms::MediatingDisplayChanger::configure( |
322 | @@ -461,7 +457,6 @@ |
323 | } |
324 | |
325 | observer->configuration_applied(conf); |
326 | - update_input_rectangles(*conf); |
327 | base_configuration_applied = false; |
328 | } |
329 | catch (std::exception const& e) |
330 | @@ -573,13 +568,3 @@ |
331 | }); |
332 | } |
333 | |
334 | -void ms::MediatingDisplayChanger::update_input_rectangles(mg::DisplayConfiguration const& config) |
335 | -{ |
336 | - geometry::Rectangles rectangles; |
337 | - config.for_each_output([&rectangles](mg::DisplayConfigurationOutput const& output) { |
338 | - if (output.used && output.connected && output.power_mode == mir_power_mode_on && |
339 | - output.current_mode_index < output.modes.size()) |
340 | - rectangles.add(geometry::Rectangle(output.top_left, output.modes[output.current_mode_index].size)); |
341 | - }); |
342 | - region->set_input_rectangles(rectangles); |
343 | -} |
344 | |
345 | === modified file 'src/server/scene/mediating_display_changer.h' |
346 | --- src/server/scene/mediating_display_changer.h 2017-01-18 02:29:37 +0000 |
347 | +++ src/server/scene/mediating_display_changer.h 2017-02-22 08:39:26 +0000 |
348 | @@ -22,7 +22,6 @@ |
349 | #include "mir/frontend/display_changer.h" |
350 | #include "mir/display_changer.h" |
351 | #include "mir/shell/display_configuration_controller.h" |
352 | -#include "mir/input/input_region.h" |
353 | |
354 | #include <mutex> |
355 | #include <map> |
356 | @@ -45,10 +44,6 @@ |
357 | class DisplayConfigurationObserver; |
358 | } |
359 | namespace compositor { class Compositor; } |
360 | -namespace input |
361 | -{ |
362 | -class InputRegion; |
363 | -} |
364 | namespace scene |
365 | { |
366 | class SessionEventHandlerRegister; |
367 | @@ -68,7 +63,6 @@ |
368 | std::shared_ptr<SessionEventHandlerRegister> const& session_event_handler_register, |
369 | std::shared_ptr<ServerActionQueue> const& server_action_queue, |
370 | std::shared_ptr<graphics::DisplayConfigurationObserver> const& observer, |
371 | - std::shared_ptr<input::InputRegion> const& region, |
372 | std::shared_ptr<time::AlarmFactory> const& alarm_factory); |
373 | |
374 | /* From mir::frontend::DisplayChanger */ |
375 | @@ -106,7 +100,6 @@ |
376 | void apply_base_config(); |
377 | void send_config_to_all_sessions( |
378 | std::shared_ptr<graphics::DisplayConfiguration> const& conf); |
379 | - void update_input_rectangles(graphics::DisplayConfiguration const& conf); |
380 | |
381 | std::shared_ptr<graphics::Display> const display; |
382 | std::shared_ptr<compositor::Compositor> const compositor; |
383 | @@ -122,7 +115,6 @@ |
384 | std::weak_ptr<frontend::Session> focused_session; |
385 | std::shared_ptr<graphics::DisplayConfiguration> base_configuration_; |
386 | bool base_configuration_applied; |
387 | - std::shared_ptr<input::InputRegion> const region; |
388 | std::shared_ptr<time::AlarmFactory> const alarm_factory; |
389 | std::unique_ptr<time::Alarm> preview_configuration_timeout; |
390 | std::weak_ptr<frontend::Session> currently_previewing_session; |
391 | |
392 | === modified file 'src/server/symbols.map' |
393 | --- src/server/symbols.map 2017-02-16 05:44:15 +0000 |
394 | +++ src/server/symbols.map 2017-02-22 08:39:26 +0000 |
395 | @@ -748,7 +748,6 @@ |
396 | mir::DefaultServerConfiguration::the_new_input_dispatcher*; |
397 | mir::DefaultServerConfiguration::the_input_manager*; |
398 | mir::DefaultServerConfiguration::the_input_reading_multiplexer*; |
399 | - mir::DefaultServerConfiguration::the_input_region*; |
400 | mir::DefaultServerConfiguration::the_input_registrar*; |
401 | mir::DefaultServerConfiguration::the_input_report*; |
402 | mir::DefaultServerConfiguration::the_input_scene*; |
403 | |
404 | === removed file 'tests/include/mir/test/doubles/mock_input_region.h' |
405 | --- tests/include/mir/test/doubles/mock_input_region.h 2017-01-18 02:29:37 +0000 |
406 | +++ tests/include/mir/test/doubles/mock_input_region.h 1970-01-01 00:00:00 +0000 |
407 | @@ -1,49 +0,0 @@ |
408 | -/* |
409 | - * Copyright © 2013 Canonical Ltd. |
410 | - * |
411 | - * This program is free software: you can redistribute it and/or modify it |
412 | - * under the terms of the GNU General Public License version 3, |
413 | - * as published by the Free Software Foundation. |
414 | - * |
415 | - * This program is distributed in the hope that it will be useful, |
416 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
417 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
418 | - * GNU General Public License for more details. |
419 | - * |
420 | - * You should have received a copy of the GNU General Public License |
421 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
422 | - * |
423 | - * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
424 | - */ |
425 | - |
426 | -#ifndef MIR_TEST_DOUBLES_MOCK_INPUT_REGION_H_ |
427 | -#define MIR_TEST_DOUBLES_MOCK_INPUT_REGION_H_ |
428 | - |
429 | -#include "mir/input/input_region.h" |
430 | -#include "mir/geometry/point.h" |
431 | -#include "mir/geometry/rectangle.h" |
432 | - |
433 | -#include <gmock/gmock.h> |
434 | - |
435 | -namespace mir |
436 | -{ |
437 | -namespace test |
438 | -{ |
439 | -namespace doubles |
440 | -{ |
441 | - |
442 | -class MockInputRegion : public input::InputRegion |
443 | -{ |
444 | -public: |
445 | - MOCK_METHOD0(bounding_rectangle, geometry::Rectangle()); |
446 | - MOCK_METHOD1(set_input_rectangles, void(geometry::Rectangles const&)); |
447 | - MOCK_METHOD1(confine, void(geometry::Point&)); |
448 | -}; |
449 | - |
450 | -} |
451 | -} |
452 | -} |
453 | - |
454 | -#endif /* MIR_TEST_DOUBLES_MOCK_INPUT_REGION_H_ */ |
455 | - |
456 | - |
457 | |
458 | === modified file 'tests/unit-tests/input/CMakeLists.txt' |
459 | --- tests/unit-tests/input/CMakeLists.txt 2017-02-15 14:45:41 +0000 |
460 | +++ tests/unit-tests/input/CMakeLists.txt 2017-02-22 08:39:26 +0000 |
461 | @@ -2,7 +2,6 @@ |
462 | |
463 | list(APPEND UNIT_TEST_SOURCES |
464 | ${CMAKE_CURRENT_SOURCE_DIR}/test_event_filter_chain_dispatcher.cpp |
465 | - ${CMAKE_CURRENT_SOURCE_DIR}/test_display_input_region.cpp |
466 | ${CMAKE_CURRENT_SOURCE_DIR}/test_cursor_controller.cpp |
467 | ${CMAKE_CURRENT_SOURCE_DIR}/test_xcursor_loader.cpp |
468 | ${CMAKE_CURRENT_SOURCE_DIR}/test_touchspot_controller.cpp |
469 | |
470 | === modified file 'tests/unit-tests/input/test_default_input_device_hub.cpp' |
471 | --- tests/unit-tests/input/test_default_input_device_hub.cpp 2017-02-15 07:38:33 +0000 |
472 | +++ tests/unit-tests/input/test_default_input_device_hub.cpp 2017-02-22 08:39:26 +0000 |
473 | @@ -21,7 +21,6 @@ |
474 | #include "mir/test/doubles/mock_input_device.h" |
475 | #include "mir/test/doubles/mock_input_device_observer.h" |
476 | #include "mir/test/doubles/mock_input_dispatcher.h" |
477 | -#include "mir/test/doubles/mock_input_region.h" |
478 | #include "mir/test/doubles/mock_input_seat.h" |
479 | #include "mir/test/doubles/mock_event_sink.h" |
480 | #include "mir/test/doubles/mock_key_mapper.h" |
481 | |
482 | === removed file 'tests/unit-tests/input/test_display_input_region.cpp' |
483 | --- tests/unit-tests/input/test_display_input_region.cpp 2017-01-18 02:29:37 +0000 |
484 | +++ tests/unit-tests/input/test_display_input_region.cpp 1970-01-01 00:00:00 +0000 |
485 | @@ -1,87 +0,0 @@ |
486 | -/* |
487 | - * Copyright © 2013 Canonical Ltd. |
488 | - * |
489 | - * This program is free software: you can redistribute it and/or modify |
490 | - * it under the terms of the GNU General Public License version 3 as |
491 | - * published by the Free Software Foundation. |
492 | - * |
493 | - * This program is distributed in the hope that it will be useful, |
494 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
495 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
496 | - * GNU General Public License for more details. |
497 | - * |
498 | - * You should have received a copy of the GNU General Public License |
499 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
500 | - * |
501 | - * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
502 | - */ |
503 | - |
504 | -#include "src/server/input/display_input_region.h" |
505 | - |
506 | -#include <tuple> |
507 | - |
508 | -#include <gtest/gtest.h> |
509 | - |
510 | -namespace mi = mir::input; |
511 | -namespace geom = mir::geometry; |
512 | - |
513 | -namespace |
514 | -{ |
515 | -geom::Rectangles const rects{ |
516 | - geom::Rectangle{{0,0}, {800,600}}, |
517 | - geom::Rectangle{{0,600}, {100,100}}, |
518 | - geom::Rectangle{{800,0}, {100,100}} |
519 | -}; |
520 | -} |
521 | - |
522 | -TEST(DisplayInputRegionTest, returns_correct_bounding_rectangle) |
523 | -{ |
524 | - geom::Rectangle const expected_bounding_rect{geom::Point{0,0}, geom::Size{800,600}}; |
525 | - |
526 | - mi::DisplayInputRegion input_region; |
527 | - input_region.set_input_rectangles(rects); |
528 | - |
529 | - auto rect = input_region.bounding_rectangle(); |
530 | - EXPECT_EQ(expected_bounding_rect, rect); |
531 | -} |
532 | - |
533 | -TEST(DisplayInputRegionTest, confines_point_to_closest_valid_position) |
534 | -{ |
535 | - mi::DisplayInputRegion input_region; |
536 | - input_region.set_input_rectangles(rects); |
537 | - |
538 | - std::vector<std::tuple<geom::Point,geom::Point>> point_tuples{ |
539 | - std::make_tuple(geom::Point{0,0}, geom::Point{0,0}), |
540 | - std::make_tuple(geom::Point{900,50}, geom::Point{899,50}), |
541 | - std::make_tuple(geom::Point{850,100}, geom::Point{850,99}), |
542 | - std::make_tuple(geom::Point{801,100}, geom::Point{801,99}), |
543 | - std::make_tuple(geom::Point{800,101}, geom::Point{799,101}), |
544 | - std::make_tuple(geom::Point{800,600}, geom::Point{799,599}), |
545 | - std::make_tuple(geom::Point{-1,700}, geom::Point{0,699}), |
546 | - std::make_tuple(geom::Point{-1,-1}, geom::Point{0,0}), |
547 | - std::make_tuple(geom::Point{-1,50}, geom::Point{0,50}), |
548 | - std::make_tuple(geom::Point{799,-1}, geom::Point{799,0}), |
549 | - std::make_tuple(geom::Point{800,-1}, geom::Point{800,0}) |
550 | - }; |
551 | - |
552 | - for (auto const& t : point_tuples) |
553 | - { |
554 | - geom::Point confined_point{std::get<0>(t)}; |
555 | - geom::Point const expected_point{std::get<1>(t)}; |
556 | - input_region.confine(confined_point); |
557 | - EXPECT_EQ(expected_point, confined_point); |
558 | - } |
559 | - |
560 | -} |
561 | - |
562 | -TEST(DisplayInputRegionTest, returns_empty_bounding_rectangle_when_there_are_no_outputs) |
563 | -{ |
564 | - geom::Rectangles const empty_rects{}; |
565 | - geom::Rectangle const empty_rect{}; |
566 | - |
567 | - mi::DisplayInputRegion input_region; |
568 | - input_region.set_input_rectangles(empty_rects); |
569 | - |
570 | - auto const bounding_rect = input_region.bounding_rectangle(); |
571 | - EXPECT_EQ(empty_rect, bounding_rect); |
572 | -} |
573 | |
574 | === modified file 'tests/unit-tests/scene/test_mediating_display_changer.cpp' |
575 | --- tests/unit-tests/scene/test_mediating_display_changer.cpp 2017-01-19 09:38:52 +0000 |
576 | +++ tests/unit-tests/scene/test_mediating_display_changer.cpp 2017-02-22 08:39:26 +0000 |
577 | @@ -29,7 +29,6 @@ |
578 | #include "mir/test/doubles/null_display_configuration.h" |
579 | #include "mir/test/doubles/stub_display_configuration.h" |
580 | #include "mir/test/doubles/mock_scene_session.h" |
581 | -#include "mir/test/doubles/mock_input_region.h" |
582 | #include "mir/test/doubles/stub_session.h" |
583 | #include "mir/test/doubles/stub_session_container.h" |
584 | #include "mir/test/fake_shared.h" |
585 | @@ -54,33 +53,6 @@ |
586 | namespace |
587 | { |
588 | |
589 | -auto display_output( |
590 | - mg::DisplayConfigurationOutputId id, geom::Point pos, geom::Size size, bool connected, bool used, MirPowerMode mode) |
591 | - -> mg::DisplayConfigurationOutput |
592 | -{ |
593 | - return mg::DisplayConfigurationOutput{id, |
594 | - mg::DisplayConfigurationCardId{0}, |
595 | - mg::DisplayConfigurationOutputType::lvds, |
596 | - std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888}, |
597 | - {mg::DisplayConfigurationMode{size, 60}}, |
598 | - 0, |
599 | - geom::Size{40, 40}, |
600 | - connected, |
601 | - used, |
602 | - pos, |
603 | - 0, |
604 | - mir_pixel_format_abgr_8888, |
605 | - mode, |
606 | - mir_orientation_normal, |
607 | - 1.0f, |
608 | - mir_form_factor_phone, |
609 | - mir_subpixel_arrangement_unknown, |
610 | - {}, |
611 | - mir_output_gamma_unsupported, |
612 | - {} |
613 | - }; |
614 | -} |
615 | - |
616 | struct TestDisplayConfiguration : mtd::NullDisplayConfiguration |
617 | { |
618 | std::vector<mg::DisplayConfigurationOutput> const outputs; |
619 | @@ -176,7 +148,6 @@ |
620 | mt::fake_shared(session_event_sink), |
621 | mt::fake_shared(server_action_queue), |
622 | mt::fake_shared(display_configuration_report), |
623 | - mt::fake_shared(mock_input_region), |
624 | mt::fake_shared(alarm_factory)); |
625 | } |
626 | |
627 | @@ -188,7 +159,6 @@ |
628 | mtd::StubDisplayConfig base_config; |
629 | StubServerActionQueue server_action_queue; |
630 | StubDisplayConfigurationObserver display_configuration_report; |
631 | - testing::NiceMock<mtd::MockInputRegion> mock_input_region; |
632 | mtd::FakeAlarmFactory alarm_factory; |
633 | std::shared_ptr<ms::MediatingDisplayChanger> changer; |
634 | }; |
635 | @@ -726,7 +696,6 @@ |
636 | mt::fake_shared(session_event_sink), |
637 | mt::fake_shared(mock_server_action_queue), |
638 | mt::fake_shared(display_configuration_report), |
639 | - mt::fake_shared(mock_input_region), |
640 | mt::fake_shared(alarm_factory)); |
641 | |
642 | void const* owner{nullptr}; |
643 | @@ -781,7 +750,6 @@ |
644 | mt::fake_shared(session_event_sink), |
645 | mt::fake_shared(mock_server_action_queue), |
646 | mt::fake_shared(display_configuration_report), |
647 | - mt::fake_shared(mock_input_region), |
648 | mt::fake_shared(alarm_factory)); |
649 | |
650 | EXPECT_CALL(mock_server_action_queue, enqueue(_, _)); |
651 | @@ -911,7 +879,6 @@ |
652 | mt::fake_shared(session_event_sink), |
653 | mt::fake_shared(server_action_queue), |
654 | mt::fake_shared(display_configuration_observer), |
655 | - mt::fake_shared(mock_input_region), |
656 | mt::fake_shared(alarm_factory)); |
657 | |
658 | mtd::NullDisplayConfiguration conf; |
659 | @@ -921,37 +888,6 @@ |
660 | changer->set_base_configuration(mt::fake_shared(conf)); |
661 | } |
662 | |
663 | -TEST_F(MediatingDisplayChangerTest, input_region_receives_display_configuration_on_start) |
664 | -{ |
665 | - using namespace testing; |
666 | - EXPECT_CALL(mock_input_region, set_input_rectangles(_)); |
667 | - |
668 | - ms::MediatingDisplayChanger display_changer( |
669 | - mt::fake_shared(mock_display), |
670 | - mt::fake_shared(mock_compositor), |
671 | - mt::fake_shared(mock_conf_policy), |
672 | - mt::fake_shared(stub_session_container), |
673 | - mt::fake_shared(session_event_sink), |
674 | - mt::fake_shared(server_action_queue), |
675 | - mt::fake_shared(display_configuration_report), |
676 | - mt::fake_shared(mock_input_region), |
677 | - mt::fake_shared(alarm_factory)); |
678 | -} |
679 | - |
680 | -TEST_F(MediatingDisplayChangerTest, notifies_input_region_on_new_configuration) |
681 | -{ |
682 | - using namespace testing; |
683 | - mtd::NullDisplayConfiguration conf; |
684 | - mir::geometry::Rectangles expected_rectangles; |
685 | - EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); |
686 | - |
687 | - auto session = std::make_shared<mtd::StubSession>(); |
688 | - |
689 | - session_event_sink.handle_focus_change(session); |
690 | - changer->configure(session, |
691 | - mt::fake_shared(conf)); |
692 | -} |
693 | - |
694 | TEST_F(MediatingDisplayChangerTest, notifies_session_on_preview_base_configuration) |
695 | { |
696 | using namespace testing; |
697 | @@ -1122,103 +1058,3 @@ |
698 | EXPECT_THAT(*received_configuration, mt::DisplayConfigMatches(std::cref(*new_config))); |
699 | } |
700 | |
701 | -TEST_F(MediatingDisplayChangerTest, input_region_skipps_not_connected_displays) |
702 | -{ |
703 | - using namespace testing; |
704 | - |
705 | - auto const connected = true; |
706 | - auto const disconnected = false; |
707 | - auto const used = true; |
708 | - mir::geometry::Rectangles expected_rectangles; |
709 | - expected_rectangles.add(geom::Rectangle{geom::Point{0,0}, geom::Size{100,100}}); |
710 | - |
711 | - TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0}, |
712 | - geom::Point{0, 0}, |
713 | - geom::Size{100, 100}, |
714 | - connected, |
715 | - used, |
716 | - mir_power_mode_on), |
717 | - display_output(mg::DisplayConfigurationOutputId{1}, |
718 | - geom::Point{100, 0}, |
719 | - geom::Size{100, 100}, |
720 | - disconnected, |
721 | - used, |
722 | - mir_power_mode_on)}}; |
723 | - |
724 | - EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); |
725 | - |
726 | - auto session = std::make_shared<mtd::StubSession>(); |
727 | - |
728 | - session_event_sink.handle_focus_change(session); |
729 | - changer->configure(session, |
730 | - mt::fake_shared(conf)); |
731 | -} |
732 | - |
733 | -TEST_F(MediatingDisplayChangerTest, input_region_accumulates_powered_and_connected_displays) |
734 | -{ |
735 | - using namespace testing; |
736 | - |
737 | - auto const connected = true; |
738 | - auto const first_monitor = geom::Rectangle{geom::Point{0, 0}, geom::Size{ 40, 40 }}; |
739 | - auto const second_monitor = geom::Rectangle{geom::Point{40, 0}, geom::Size{ 10, 10}}; |
740 | - auto const used = true; |
741 | - mir::geometry::Rectangles expected_rectangles; |
742 | - expected_rectangles.add(first_monitor); |
743 | - expected_rectangles.add(second_monitor); |
744 | - |
745 | - TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0}, |
746 | - first_monitor.top_left, |
747 | - first_monitor.size, |
748 | - connected, |
749 | - used, |
750 | - mir_power_mode_on), |
751 | - display_output(mg::DisplayConfigurationOutputId{1}, |
752 | - second_monitor.top_left, |
753 | - second_monitor.size, |
754 | - connected, |
755 | - used, |
756 | - mir_power_mode_on)}}; |
757 | - |
758 | - EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); |
759 | - |
760 | - auto session = std::make_shared<mtd::StubSession>(); |
761 | - |
762 | - session_event_sink.handle_focus_change(session); |
763 | - changer->configure(session, |
764 | - mt::fake_shared(conf)); |
765 | -} |
766 | - |
767 | - |
768 | -TEST_F(MediatingDisplayChangerTest, input_region_accumulates_powered_connected_skips_unused_displays) |
769 | -{ |
770 | - using namespace testing; |
771 | - |
772 | - auto const connected = true; |
773 | - auto const first_monitor = geom::Rectangle{geom::Point{0, 0}, geom::Size{ 40, 40 }}; |
774 | - auto const second_monitor = geom::Rectangle{geom::Point{40, 0}, geom::Size{ 10, 10}}; |
775 | - auto const not_used = false; |
776 | - auto const used = true; |
777 | - mir::geometry::Rectangles expected_rectangles; |
778 | - expected_rectangles.add(second_monitor); |
779 | - |
780 | - TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0}, |
781 | - first_monitor.top_left, |
782 | - first_monitor.size, |
783 | - connected, |
784 | - not_used, |
785 | - mir_power_mode_on), |
786 | - display_output(mg::DisplayConfigurationOutputId{1}, |
787 | - second_monitor.top_left, |
788 | - second_monitor.size, |
789 | - connected, |
790 | - used, |
791 | - mir_power_mode_on)}}; |
792 | - |
793 | - EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); |
794 | - |
795 | - auto session = std::make_shared<mtd::StubSession>(); |
796 | - |
797 | - session_event_sink.handle_focus_change(session); |
798 | - changer->configure(session, |
799 | - mt::fake_shared(conf)); |
800 | -} |
FAILED: Continuous integration, rev:4010 /mir-jenkins. ubuntu. com/job/ mir-ci/ 2955/ /mir-jenkins. ubuntu. com/job/ build-mir/ 3916/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/4002/ console /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 3992/console /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 3992/console /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/3992/ console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/3943/ console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3943/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/3943/ console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 3943/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 3943/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3943/console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 2955/rebuild
https:/