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 | 138 | class EventFilterChainDispatcher; | 138 | class EventFilterChainDispatcher; |
6 | 139 | class CursorListener; | 139 | class CursorListener; |
7 | 140 | class TouchVisualizer; | 140 | class TouchVisualizer; |
8 | 141 | class InputRegion; | ||
9 | 142 | class CursorImages; | 141 | class CursorImages; |
10 | 143 | class Seat; | 142 | class Seat; |
11 | 144 | class KeyMapper; | 143 | class KeyMapper; |
12 | @@ -324,7 +323,6 @@ | |||
13 | 324 | virtual std::shared_ptr<input::Scene> the_input_scene(); | 323 | virtual std::shared_ptr<input::Scene> the_input_scene(); |
14 | 325 | virtual std::shared_ptr<input::CursorListener> the_cursor_listener(); | 324 | virtual std::shared_ptr<input::CursorListener> the_cursor_listener(); |
15 | 326 | virtual std::shared_ptr<input::TouchVisualizer> the_touch_visualizer(); | 325 | virtual std::shared_ptr<input::TouchVisualizer> the_touch_visualizer(); |
16 | 327 | virtual std::shared_ptr<input::InputRegion> the_input_region(); | ||
17 | 328 | virtual std::shared_ptr<input::Seat> the_seat(); | 326 | virtual std::shared_ptr<input::Seat> the_seat(); |
18 | 329 | virtual std::shared_ptr<input::KeyMapper> the_key_mapper(); | 327 | virtual std::shared_ptr<input::KeyMapper> the_key_mapper(); |
19 | 330 | 328 | ||
20 | @@ -388,7 +386,6 @@ | |||
21 | 388 | CachedPtr<input::DefaultInputDeviceHub> default_input_device_hub; | 386 | CachedPtr<input::DefaultInputDeviceHub> default_input_device_hub; |
22 | 389 | CachedPtr<dispatch::MultiplexingDispatchable> input_reading_multiplexer; | 387 | CachedPtr<dispatch::MultiplexingDispatchable> input_reading_multiplexer; |
23 | 390 | CachedPtr<input::InputDispatcher> input_dispatcher; | 388 | CachedPtr<input::InputDispatcher> input_dispatcher; |
24 | 391 | CachedPtr<input::InputRegion> input_region; | ||
25 | 392 | CachedPtr<shell::InputTargeter> input_targeter; | 389 | CachedPtr<shell::InputTargeter> input_targeter; |
26 | 393 | CachedPtr<input::CursorListener> cursor_listener; | 390 | CachedPtr<input::CursorListener> cursor_listener; |
27 | 394 | CachedPtr<input::TouchVisualizer> touch_visualizer; | 391 | CachedPtr<input::TouchVisualizer> touch_visualizer; |
28 | 395 | 392 | ||
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 | 1 | /* | ||
34 | 2 | * Copyright © 2013 Canonical Ltd. | ||
35 | 3 | * | ||
36 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
37 | 5 | * under the terms of the GNU General Public License version 3, | ||
38 | 6 | * as published by the Free Software Foundation. | ||
39 | 7 | * | ||
40 | 8 | * This program is distributed in the hope that it will be useful, | ||
41 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
42 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
43 | 11 | * GNU General Public License for more details. | ||
44 | 12 | * | ||
45 | 13 | * You should have received a copy of the GNU General Public License | ||
46 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
47 | 15 | * | ||
48 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
49 | 17 | */ | ||
50 | 18 | |||
51 | 19 | #ifndef MIR_INPUT_INPUT_REGION_H_ | ||
52 | 20 | #define MIR_INPUT_INPUT_REGION_H_ | ||
53 | 21 | |||
54 | 22 | namespace mir | ||
55 | 23 | { | ||
56 | 24 | namespace geometry | ||
57 | 25 | { | ||
58 | 26 | struct Rectangle; | ||
59 | 27 | struct Rectangles; | ||
60 | 28 | struct Point; | ||
61 | 29 | } | ||
62 | 30 | namespace input | ||
63 | 31 | { | ||
64 | 32 | |||
65 | 33 | /** | ||
66 | 34 | * Interface to the region of valid input coordinates. | ||
67 | 35 | */ | ||
68 | 36 | class InputRegion | ||
69 | 37 | { | ||
70 | 38 | public: | ||
71 | 39 | virtual ~InputRegion() = default; | ||
72 | 40 | |||
73 | 41 | /** The bounding rectangle of the input region */ | ||
74 | 42 | virtual geometry::Rectangle bounding_rectangle() = 0; | ||
75 | 43 | |||
76 | 44 | /** | ||
77 | 45 | * Confines a point to the input region. | ||
78 | 46 | * | ||
79 | 47 | * If the point is within input region it remains unchanged, | ||
80 | 48 | * otherwise it is replaced by the region point that is closest to | ||
81 | 49 | * it. | ||
82 | 50 | * | ||
83 | 51 | * @param [in,out] point the point to confine | ||
84 | 52 | */ | ||
85 | 53 | virtual void confine(geometry::Point& point) = 0; | ||
86 | 54 | virtual void set_input_rectangles(geometry::Rectangles const& rectangles) = 0; | ||
87 | 55 | |||
88 | 56 | protected: | ||
89 | 57 | InputRegion() = default; | ||
90 | 58 | InputRegion(InputRegion const&) = delete; | ||
91 | 59 | InputRegion& operator=(InputRegion const&) = delete; | ||
92 | 60 | }; | ||
93 | 61 | |||
94 | 62 | } | ||
95 | 63 | } | ||
96 | 64 | |||
97 | 65 | #endif /* MIR_INPUT_INPUT_REGION_H_ */ | ||
98 | 66 | 0 | ||
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 | 12 | default_event_builder.cpp | 12 | default_event_builder.cpp |
104 | 13 | default_input_device_hub.cpp | 13 | default_input_device_hub.cpp |
105 | 14 | default_input_manager.cpp | 14 | default_input_manager.cpp |
106 | 15 | display_input_region.cpp | ||
107 | 16 | event_filter_chain_dispatcher.cpp | 15 | event_filter_chain_dispatcher.cpp |
108 | 17 | input_modifier_utils.cpp | 16 | input_modifier_utils.cpp |
109 | 18 | input_probe.cpp | 17 | input_probe.cpp |
110 | 19 | 18 | ||
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 | 41 | { | 41 | { |
116 | 42 | class TouchVisualizer; | 42 | class TouchVisualizer; |
117 | 43 | class CursorListener; | 43 | class CursorListener; |
118 | 44 | class InputRegion; | ||
119 | 45 | class InputDispatcher; | 44 | class InputDispatcher; |
120 | 46 | class KeyMapper; | 45 | class KeyMapper; |
121 | 47 | class SeatObserver; | 46 | class SeatObserver; |
122 | 48 | 47 | ||
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 | 19 | #include "mir/default_server_configuration.h" | 19 | #include "mir/default_server_configuration.h" |
128 | 20 | 20 | ||
129 | 21 | #include "key_repeat_dispatcher.h" | 21 | #include "key_repeat_dispatcher.h" |
130 | 22 | #include "display_input_region.h" | ||
131 | 23 | #include "event_filter_chain_dispatcher.h" | 22 | #include "event_filter_chain_dispatcher.h" |
132 | 24 | #include "config_changer.h" | 23 | #include "config_changer.h" |
133 | 25 | #include "cursor_controller.h" | 24 | #include "cursor_controller.h" |
134 | @@ -96,15 +95,6 @@ | |||
135 | 96 | 95 | ||
136 | 97 | } | 96 | } |
137 | 98 | 97 | ||
138 | 99 | std::shared_ptr<mi::InputRegion> mir::DefaultServerConfiguration::the_input_region() | ||
139 | 100 | { | ||
140 | 101 | return input_region( | ||
141 | 102 | []() | ||
142 | 103 | { | ||
143 | 104 | return std::make_shared<mi::DisplayInputRegion>(); | ||
144 | 105 | }); | ||
145 | 106 | } | ||
146 | 107 | |||
147 | 108 | std::shared_ptr<mi::CompositeEventFilter> | 98 | std::shared_ptr<mi::CompositeEventFilter> |
148 | 109 | mir::DefaultServerConfiguration::the_composite_event_filter() | 99 | mir::DefaultServerConfiguration::the_composite_event_filter() |
149 | 110 | { | 100 | { |
150 | 111 | 101 | ||
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 | 1 | /* | ||
156 | 2 | * Copyright © 2013 Canonical Ltd. | ||
157 | 3 | * | ||
158 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
159 | 5 | * under the terms of the GNU General Public License version 3, | ||
160 | 6 | * as published by the Free Software Foundation. | ||
161 | 7 | * | ||
162 | 8 | * This program is distributed in the hope that it will be useful, | ||
163 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
164 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
165 | 11 | * GNU General Public License for more details. | ||
166 | 12 | * | ||
167 | 13 | * You should have received a copy of the GNU General Public License | ||
168 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
169 | 15 | * | ||
170 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
171 | 17 | */ | ||
172 | 18 | |||
173 | 19 | #include "display_input_region.h" | ||
174 | 20 | #include "mir/graphics/display_configuration.h" | ||
175 | 21 | |||
176 | 22 | #include "mir/geometry/rectangle.h" | ||
177 | 23 | #include "mir/geometry/rectangles.h" | ||
178 | 24 | |||
179 | 25 | namespace mi = mir::input; | ||
180 | 26 | namespace mg = mir::graphics; | ||
181 | 27 | namespace geom = mir::geometry; | ||
182 | 28 | |||
183 | 29 | void mi::DisplayInputRegion::set_input_rectangles(geometry::Rectangles const& config) | ||
184 | 30 | { | ||
185 | 31 | std::unique_lock<std::mutex> lock(rectangle_guard); | ||
186 | 32 | rectangles = config; | ||
187 | 33 | } | ||
188 | 34 | |||
189 | 35 | geom::Rectangle mi::DisplayInputRegion::bounding_rectangle() | ||
190 | 36 | { | ||
191 | 37 | //TODO: This region is mainly used for scaling touchscreen coordinates, so the caller | ||
192 | 38 | // probably wants the full list of rectangles. Additional work is needed | ||
193 | 39 | // to group a touchscreen with a display. So for now, just return the view area | ||
194 | 40 | // of the first display, as that matches the most common systems (laptops with touchscreens, | ||
195 | 41 | // phone/tablets with touchscreens). | ||
196 | 42 | if (rectangles.size() != 0) | ||
197 | 43 | return *rectangles.begin(); | ||
198 | 44 | else | ||
199 | 45 | return geom::Rectangle{}; | ||
200 | 46 | } | ||
201 | 47 | |||
202 | 48 | void mi::DisplayInputRegion::confine(geom::Point& point) | ||
203 | 49 | { | ||
204 | 50 | rectangles.confine(point); | ||
205 | 51 | } | ||
206 | 52 | 0 | ||
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 | 1 | /* | ||
212 | 2 | * Copyright © 2013 Canonical Ltd. | ||
213 | 3 | * | ||
214 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
215 | 5 | * under the terms of the GNU General Public License version 3, | ||
216 | 6 | * as published by the Free Software Foundation. | ||
217 | 7 | * | ||
218 | 8 | * This program is distributed in the hope that it will be useful, | ||
219 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
220 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
221 | 11 | * GNU General Public License for more details. | ||
222 | 12 | * | ||
223 | 13 | * You should have received a copy of the GNU General Public License | ||
224 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
225 | 15 | * | ||
226 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
227 | 17 | */ | ||
228 | 18 | |||
229 | 19 | #ifndef MIR_INPUT_DISPLAY_INPUT_REGION_H_ | ||
230 | 20 | #define MIR_INPUT_DISPLAY_INPUT_REGION_H_ | ||
231 | 21 | |||
232 | 22 | #include "mir/input/input_region.h" | ||
233 | 23 | #include "mir/geometry/rectangles.h" | ||
234 | 24 | |||
235 | 25 | #include <memory> | ||
236 | 26 | #include <mutex> | ||
237 | 27 | |||
238 | 28 | namespace mir | ||
239 | 29 | { | ||
240 | 30 | namespace input | ||
241 | 31 | { | ||
242 | 32 | |||
243 | 33 | class DisplayInputRegion : public InputRegion | ||
244 | 34 | { | ||
245 | 35 | public: | ||
246 | 36 | DisplayInputRegion() = default; | ||
247 | 37 | |||
248 | 38 | geometry::Rectangle bounding_rectangle() override; | ||
249 | 39 | void confine(geometry::Point& point) override; | ||
250 | 40 | void set_input_rectangles(geometry::Rectangles const& rectangles) override; | ||
251 | 41 | |||
252 | 42 | private: | ||
253 | 43 | std::mutex rectangle_guard; | ||
254 | 44 | geometry::Rectangles rectangles; | ||
255 | 45 | }; | ||
256 | 46 | |||
257 | 47 | } | ||
258 | 48 | } | ||
259 | 49 | |||
260 | 50 | #endif /* MIR_INPUT_DISPLAY_INPUT_REGION_H_ */ | ||
261 | 51 | |||
262 | 52 | 0 | ||
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 | 41 | namespace input | 41 | namespace input |
268 | 42 | { | 42 | { |
269 | 43 | class CursorListener; | 43 | class CursorListener; |
270 | 44 | class InputRegion; | ||
271 | 45 | class InputDispatcher; | 44 | class InputDispatcher; |
272 | 46 | class KeyMapper; | 45 | class KeyMapper; |
273 | 47 | class SeatObserver; | 46 | class SeatObserver; |
274 | 48 | 47 | ||
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 | 140 | the_session_event_handler_register(), | 140 | the_session_event_handler_register(), |
280 | 141 | the_server_action_queue(), | 141 | the_server_action_queue(), |
281 | 142 | the_display_configuration_observer(), | 142 | the_display_configuration_observer(), |
282 | 143 | the_input_region(), | ||
283 | 144 | the_main_loop()); | 143 | the_main_loop()); |
284 | 145 | }); | 144 | }); |
285 | 146 | 145 | ||
286 | 147 | 146 | ||
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 | 38 | namespace ms = mir::scene; | 38 | namespace ms = mir::scene; |
292 | 39 | namespace mg = mir::graphics; | 39 | namespace mg = mir::graphics; |
293 | 40 | namespace mc = mir::compositor; | 40 | namespace mc = mir::compositor; |
294 | 41 | namespace mi = mir::input; | ||
295 | 42 | namespace mt = mir::time; | 41 | namespace mt = mir::time; |
296 | 43 | 42 | ||
297 | 44 | namespace | 43 | namespace |
298 | @@ -132,7 +131,6 @@ | |||
299 | 132 | std::shared_ptr<SessionEventHandlerRegister> const& session_event_handler_register, | 131 | std::shared_ptr<SessionEventHandlerRegister> const& session_event_handler_register, |
300 | 133 | std::shared_ptr<ServerActionQueue> const& server_action_queue, | 132 | std::shared_ptr<ServerActionQueue> const& server_action_queue, |
301 | 134 | std::shared_ptr<mg::DisplayConfigurationObserver> const& observer, | 133 | std::shared_ptr<mg::DisplayConfigurationObserver> const& observer, |
302 | 135 | std::shared_ptr<mi::InputRegion> const& region, | ||
303 | 136 | std::shared_ptr<mt::AlarmFactory> const& alarm_factory) | 134 | std::shared_ptr<mt::AlarmFactory> const& alarm_factory) |
304 | 137 | : display{display}, | 135 | : display{display}, |
305 | 138 | compositor{compositor}, | 136 | compositor{compositor}, |
306 | @@ -143,7 +141,6 @@ | |||
307 | 143 | observer{observer}, | 141 | observer{observer}, |
308 | 144 | base_configuration_{display->configuration()}, | 142 | base_configuration_{display->configuration()}, |
309 | 145 | base_configuration_applied{true}, | 143 | base_configuration_applied{true}, |
310 | 146 | region{region}, | ||
311 | 147 | alarm_factory{alarm_factory} | 144 | alarm_factory{alarm_factory} |
312 | 148 | { | 145 | { |
313 | 149 | session_event_handler_register->register_focus_change_handler( | 146 | session_event_handler_register->register_focus_change_handler( |
314 | @@ -181,7 +178,6 @@ | |||
315 | 181 | }); | 178 | }); |
316 | 182 | 179 | ||
317 | 183 | observer->initial_configuration(base_configuration_); | 180 | observer->initial_configuration(base_configuration_); |
318 | 184 | update_input_rectangles(*base_configuration_); | ||
319 | 185 | } | 181 | } |
320 | 186 | 182 | ||
321 | 187 | void ms::MediatingDisplayChanger::configure( | 183 | void ms::MediatingDisplayChanger::configure( |
322 | @@ -461,7 +457,6 @@ | |||
323 | 461 | } | 457 | } |
324 | 462 | 458 | ||
325 | 463 | observer->configuration_applied(conf); | 459 | observer->configuration_applied(conf); |
326 | 464 | update_input_rectangles(*conf); | ||
327 | 465 | base_configuration_applied = false; | 460 | base_configuration_applied = false; |
328 | 466 | } | 461 | } |
329 | 467 | catch (std::exception const& e) | 462 | catch (std::exception const& e) |
330 | @@ -573,13 +568,3 @@ | |||
331 | 573 | }); | 568 | }); |
332 | 574 | } | 569 | } |
333 | 575 | 570 | ||
334 | 576 | void ms::MediatingDisplayChanger::update_input_rectangles(mg::DisplayConfiguration const& config) | ||
335 | 577 | { | ||
336 | 578 | geometry::Rectangles rectangles; | ||
337 | 579 | config.for_each_output([&rectangles](mg::DisplayConfigurationOutput const& output) { | ||
338 | 580 | if (output.used && output.connected && output.power_mode == mir_power_mode_on && | ||
339 | 581 | output.current_mode_index < output.modes.size()) | ||
340 | 582 | rectangles.add(geometry::Rectangle(output.top_left, output.modes[output.current_mode_index].size)); | ||
341 | 583 | }); | ||
342 | 584 | region->set_input_rectangles(rectangles); | ||
343 | 585 | } | ||
344 | 586 | 571 | ||
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 | 22 | #include "mir/frontend/display_changer.h" | 22 | #include "mir/frontend/display_changer.h" |
350 | 23 | #include "mir/display_changer.h" | 23 | #include "mir/display_changer.h" |
351 | 24 | #include "mir/shell/display_configuration_controller.h" | 24 | #include "mir/shell/display_configuration_controller.h" |
352 | 25 | #include "mir/input/input_region.h" | ||
353 | 26 | 25 | ||
354 | 27 | #include <mutex> | 26 | #include <mutex> |
355 | 28 | #include <map> | 27 | #include <map> |
356 | @@ -45,10 +44,6 @@ | |||
357 | 45 | class DisplayConfigurationObserver; | 44 | class DisplayConfigurationObserver; |
358 | 46 | } | 45 | } |
359 | 47 | namespace compositor { class Compositor; } | 46 | namespace compositor { class Compositor; } |
360 | 48 | namespace input | ||
361 | 49 | { | ||
362 | 50 | class InputRegion; | ||
363 | 51 | } | ||
364 | 52 | namespace scene | 47 | namespace scene |
365 | 53 | { | 48 | { |
366 | 54 | class SessionEventHandlerRegister; | 49 | class SessionEventHandlerRegister; |
367 | @@ -68,7 +63,6 @@ | |||
368 | 68 | std::shared_ptr<SessionEventHandlerRegister> const& session_event_handler_register, | 63 | std::shared_ptr<SessionEventHandlerRegister> const& session_event_handler_register, |
369 | 69 | std::shared_ptr<ServerActionQueue> const& server_action_queue, | 64 | std::shared_ptr<ServerActionQueue> const& server_action_queue, |
370 | 70 | std::shared_ptr<graphics::DisplayConfigurationObserver> const& observer, | 65 | std::shared_ptr<graphics::DisplayConfigurationObserver> const& observer, |
371 | 71 | std::shared_ptr<input::InputRegion> const& region, | ||
372 | 72 | std::shared_ptr<time::AlarmFactory> const& alarm_factory); | 66 | std::shared_ptr<time::AlarmFactory> const& alarm_factory); |
373 | 73 | 67 | ||
374 | 74 | /* From mir::frontend::DisplayChanger */ | 68 | /* From mir::frontend::DisplayChanger */ |
375 | @@ -106,7 +100,6 @@ | |||
376 | 106 | void apply_base_config(); | 100 | void apply_base_config(); |
377 | 107 | void send_config_to_all_sessions( | 101 | void send_config_to_all_sessions( |
378 | 108 | std::shared_ptr<graphics::DisplayConfiguration> const& conf); | 102 | std::shared_ptr<graphics::DisplayConfiguration> const& conf); |
379 | 109 | void update_input_rectangles(graphics::DisplayConfiguration const& conf); | ||
380 | 110 | 103 | ||
381 | 111 | std::shared_ptr<graphics::Display> const display; | 104 | std::shared_ptr<graphics::Display> const display; |
382 | 112 | std::shared_ptr<compositor::Compositor> const compositor; | 105 | std::shared_ptr<compositor::Compositor> const compositor; |
383 | @@ -122,7 +115,6 @@ | |||
384 | 122 | std::weak_ptr<frontend::Session> focused_session; | 115 | std::weak_ptr<frontend::Session> focused_session; |
385 | 123 | std::shared_ptr<graphics::DisplayConfiguration> base_configuration_; | 116 | std::shared_ptr<graphics::DisplayConfiguration> base_configuration_; |
386 | 124 | bool base_configuration_applied; | 117 | bool base_configuration_applied; |
387 | 125 | std::shared_ptr<input::InputRegion> const region; | ||
388 | 126 | std::shared_ptr<time::AlarmFactory> const alarm_factory; | 118 | std::shared_ptr<time::AlarmFactory> const alarm_factory; |
389 | 127 | std::unique_ptr<time::Alarm> preview_configuration_timeout; | 119 | std::unique_ptr<time::Alarm> preview_configuration_timeout; |
390 | 128 | std::weak_ptr<frontend::Session> currently_previewing_session; | 120 | std::weak_ptr<frontend::Session> currently_previewing_session; |
391 | 129 | 121 | ||
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 | 748 | mir::DefaultServerConfiguration::the_new_input_dispatcher*; | 748 | mir::DefaultServerConfiguration::the_new_input_dispatcher*; |
397 | 749 | mir::DefaultServerConfiguration::the_input_manager*; | 749 | mir::DefaultServerConfiguration::the_input_manager*; |
398 | 750 | mir::DefaultServerConfiguration::the_input_reading_multiplexer*; | 750 | mir::DefaultServerConfiguration::the_input_reading_multiplexer*; |
399 | 751 | mir::DefaultServerConfiguration::the_input_region*; | ||
400 | 752 | mir::DefaultServerConfiguration::the_input_registrar*; | 751 | mir::DefaultServerConfiguration::the_input_registrar*; |
401 | 753 | mir::DefaultServerConfiguration::the_input_report*; | 752 | mir::DefaultServerConfiguration::the_input_report*; |
402 | 754 | mir::DefaultServerConfiguration::the_input_scene*; | 753 | mir::DefaultServerConfiguration::the_input_scene*; |
403 | 755 | 754 | ||
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 | 1 | /* | ||
409 | 2 | * Copyright © 2013 Canonical Ltd. | ||
410 | 3 | * | ||
411 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
412 | 5 | * under the terms of the GNU General Public License version 3, | ||
413 | 6 | * as published by the Free Software Foundation. | ||
414 | 7 | * | ||
415 | 8 | * This program is distributed in the hope that it will be useful, | ||
416 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
417 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
418 | 11 | * GNU General Public License for more details. | ||
419 | 12 | * | ||
420 | 13 | * You should have received a copy of the GNU General Public License | ||
421 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
422 | 15 | * | ||
423 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
424 | 17 | */ | ||
425 | 18 | |||
426 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_INPUT_REGION_H_ | ||
427 | 20 | #define MIR_TEST_DOUBLES_MOCK_INPUT_REGION_H_ | ||
428 | 21 | |||
429 | 22 | #include "mir/input/input_region.h" | ||
430 | 23 | #include "mir/geometry/point.h" | ||
431 | 24 | #include "mir/geometry/rectangle.h" | ||
432 | 25 | |||
433 | 26 | #include <gmock/gmock.h> | ||
434 | 27 | |||
435 | 28 | namespace mir | ||
436 | 29 | { | ||
437 | 30 | namespace test | ||
438 | 31 | { | ||
439 | 32 | namespace doubles | ||
440 | 33 | { | ||
441 | 34 | |||
442 | 35 | class MockInputRegion : public input::InputRegion | ||
443 | 36 | { | ||
444 | 37 | public: | ||
445 | 38 | MOCK_METHOD0(bounding_rectangle, geometry::Rectangle()); | ||
446 | 39 | MOCK_METHOD1(set_input_rectangles, void(geometry::Rectangles const&)); | ||
447 | 40 | MOCK_METHOD1(confine, void(geometry::Point&)); | ||
448 | 41 | }; | ||
449 | 42 | |||
450 | 43 | } | ||
451 | 44 | } | ||
452 | 45 | } | ||
453 | 46 | |||
454 | 47 | #endif /* MIR_TEST_DOUBLES_MOCK_INPUT_REGION_H_ */ | ||
455 | 48 | |||
456 | 49 | |||
457 | 50 | 0 | ||
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 | 2 | 2 | ||
463 | 3 | list(APPEND UNIT_TEST_SOURCES | 3 | list(APPEND UNIT_TEST_SOURCES |
464 | 4 | ${CMAKE_CURRENT_SOURCE_DIR}/test_event_filter_chain_dispatcher.cpp | 4 | ${CMAKE_CURRENT_SOURCE_DIR}/test_event_filter_chain_dispatcher.cpp |
465 | 5 | ${CMAKE_CURRENT_SOURCE_DIR}/test_display_input_region.cpp | ||
466 | 6 | ${CMAKE_CURRENT_SOURCE_DIR}/test_cursor_controller.cpp | 5 | ${CMAKE_CURRENT_SOURCE_DIR}/test_cursor_controller.cpp |
467 | 7 | ${CMAKE_CURRENT_SOURCE_DIR}/test_xcursor_loader.cpp | 6 | ${CMAKE_CURRENT_SOURCE_DIR}/test_xcursor_loader.cpp |
468 | 8 | ${CMAKE_CURRENT_SOURCE_DIR}/test_touchspot_controller.cpp | 7 | ${CMAKE_CURRENT_SOURCE_DIR}/test_touchspot_controller.cpp |
469 | 9 | 8 | ||
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 | 21 | #include "mir/test/doubles/mock_input_device.h" | 21 | #include "mir/test/doubles/mock_input_device.h" |
475 | 22 | #include "mir/test/doubles/mock_input_device_observer.h" | 22 | #include "mir/test/doubles/mock_input_device_observer.h" |
476 | 23 | #include "mir/test/doubles/mock_input_dispatcher.h" | 23 | #include "mir/test/doubles/mock_input_dispatcher.h" |
477 | 24 | #include "mir/test/doubles/mock_input_region.h" | ||
478 | 25 | #include "mir/test/doubles/mock_input_seat.h" | 24 | #include "mir/test/doubles/mock_input_seat.h" |
479 | 26 | #include "mir/test/doubles/mock_event_sink.h" | 25 | #include "mir/test/doubles/mock_event_sink.h" |
480 | 27 | #include "mir/test/doubles/mock_key_mapper.h" | 26 | #include "mir/test/doubles/mock_key_mapper.h" |
481 | 28 | 27 | ||
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 | 1 | /* | ||
487 | 2 | * Copyright © 2013 Canonical Ltd. | ||
488 | 3 | * | ||
489 | 4 | * This program is free software: you can redistribute it and/or modify | ||
490 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
491 | 6 | * published by the Free Software Foundation. | ||
492 | 7 | * | ||
493 | 8 | * This program is distributed in the hope that it will be useful, | ||
494 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
495 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
496 | 11 | * GNU General Public License for more details. | ||
497 | 12 | * | ||
498 | 13 | * You should have received a copy of the GNU General Public License | ||
499 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
500 | 15 | * | ||
501 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
502 | 17 | */ | ||
503 | 18 | |||
504 | 19 | #include "src/server/input/display_input_region.h" | ||
505 | 20 | |||
506 | 21 | #include <tuple> | ||
507 | 22 | |||
508 | 23 | #include <gtest/gtest.h> | ||
509 | 24 | |||
510 | 25 | namespace mi = mir::input; | ||
511 | 26 | namespace geom = mir::geometry; | ||
512 | 27 | |||
513 | 28 | namespace | ||
514 | 29 | { | ||
515 | 30 | geom::Rectangles const rects{ | ||
516 | 31 | geom::Rectangle{{0,0}, {800,600}}, | ||
517 | 32 | geom::Rectangle{{0,600}, {100,100}}, | ||
518 | 33 | geom::Rectangle{{800,0}, {100,100}} | ||
519 | 34 | }; | ||
520 | 35 | } | ||
521 | 36 | |||
522 | 37 | TEST(DisplayInputRegionTest, returns_correct_bounding_rectangle) | ||
523 | 38 | { | ||
524 | 39 | geom::Rectangle const expected_bounding_rect{geom::Point{0,0}, geom::Size{800,600}}; | ||
525 | 40 | |||
526 | 41 | mi::DisplayInputRegion input_region; | ||
527 | 42 | input_region.set_input_rectangles(rects); | ||
528 | 43 | |||
529 | 44 | auto rect = input_region.bounding_rectangle(); | ||
530 | 45 | EXPECT_EQ(expected_bounding_rect, rect); | ||
531 | 46 | } | ||
532 | 47 | |||
533 | 48 | TEST(DisplayInputRegionTest, confines_point_to_closest_valid_position) | ||
534 | 49 | { | ||
535 | 50 | mi::DisplayInputRegion input_region; | ||
536 | 51 | input_region.set_input_rectangles(rects); | ||
537 | 52 | |||
538 | 53 | std::vector<std::tuple<geom::Point,geom::Point>> point_tuples{ | ||
539 | 54 | std::make_tuple(geom::Point{0,0}, geom::Point{0,0}), | ||
540 | 55 | std::make_tuple(geom::Point{900,50}, geom::Point{899,50}), | ||
541 | 56 | std::make_tuple(geom::Point{850,100}, geom::Point{850,99}), | ||
542 | 57 | std::make_tuple(geom::Point{801,100}, geom::Point{801,99}), | ||
543 | 58 | std::make_tuple(geom::Point{800,101}, geom::Point{799,101}), | ||
544 | 59 | std::make_tuple(geom::Point{800,600}, geom::Point{799,599}), | ||
545 | 60 | std::make_tuple(geom::Point{-1,700}, geom::Point{0,699}), | ||
546 | 61 | std::make_tuple(geom::Point{-1,-1}, geom::Point{0,0}), | ||
547 | 62 | std::make_tuple(geom::Point{-1,50}, geom::Point{0,50}), | ||
548 | 63 | std::make_tuple(geom::Point{799,-1}, geom::Point{799,0}), | ||
549 | 64 | std::make_tuple(geom::Point{800,-1}, geom::Point{800,0}) | ||
550 | 65 | }; | ||
551 | 66 | |||
552 | 67 | for (auto const& t : point_tuples) | ||
553 | 68 | { | ||
554 | 69 | geom::Point confined_point{std::get<0>(t)}; | ||
555 | 70 | geom::Point const expected_point{std::get<1>(t)}; | ||
556 | 71 | input_region.confine(confined_point); | ||
557 | 72 | EXPECT_EQ(expected_point, confined_point); | ||
558 | 73 | } | ||
559 | 74 | |||
560 | 75 | } | ||
561 | 76 | |||
562 | 77 | TEST(DisplayInputRegionTest, returns_empty_bounding_rectangle_when_there_are_no_outputs) | ||
563 | 78 | { | ||
564 | 79 | geom::Rectangles const empty_rects{}; | ||
565 | 80 | geom::Rectangle const empty_rect{}; | ||
566 | 81 | |||
567 | 82 | mi::DisplayInputRegion input_region; | ||
568 | 83 | input_region.set_input_rectangles(empty_rects); | ||
569 | 84 | |||
570 | 85 | auto const bounding_rect = input_region.bounding_rectangle(); | ||
571 | 86 | EXPECT_EQ(empty_rect, bounding_rect); | ||
572 | 87 | } | ||
573 | 88 | 0 | ||
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 | 29 | #include "mir/test/doubles/null_display_configuration.h" | 29 | #include "mir/test/doubles/null_display_configuration.h" |
579 | 30 | #include "mir/test/doubles/stub_display_configuration.h" | 30 | #include "mir/test/doubles/stub_display_configuration.h" |
580 | 31 | #include "mir/test/doubles/mock_scene_session.h" | 31 | #include "mir/test/doubles/mock_scene_session.h" |
581 | 32 | #include "mir/test/doubles/mock_input_region.h" | ||
582 | 33 | #include "mir/test/doubles/stub_session.h" | 32 | #include "mir/test/doubles/stub_session.h" |
583 | 34 | #include "mir/test/doubles/stub_session_container.h" | 33 | #include "mir/test/doubles/stub_session_container.h" |
584 | 35 | #include "mir/test/fake_shared.h" | 34 | #include "mir/test/fake_shared.h" |
585 | @@ -54,33 +53,6 @@ | |||
586 | 54 | namespace | 53 | namespace |
587 | 55 | { | 54 | { |
588 | 56 | 55 | ||
589 | 57 | auto display_output( | ||
590 | 58 | mg::DisplayConfigurationOutputId id, geom::Point pos, geom::Size size, bool connected, bool used, MirPowerMode mode) | ||
591 | 59 | -> mg::DisplayConfigurationOutput | ||
592 | 60 | { | ||
593 | 61 | return mg::DisplayConfigurationOutput{id, | ||
594 | 62 | mg::DisplayConfigurationCardId{0}, | ||
595 | 63 | mg::DisplayConfigurationOutputType::lvds, | ||
596 | 64 | std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888}, | ||
597 | 65 | {mg::DisplayConfigurationMode{size, 60}}, | ||
598 | 66 | 0, | ||
599 | 67 | geom::Size{40, 40}, | ||
600 | 68 | connected, | ||
601 | 69 | used, | ||
602 | 70 | pos, | ||
603 | 71 | 0, | ||
604 | 72 | mir_pixel_format_abgr_8888, | ||
605 | 73 | mode, | ||
606 | 74 | mir_orientation_normal, | ||
607 | 75 | 1.0f, | ||
608 | 76 | mir_form_factor_phone, | ||
609 | 77 | mir_subpixel_arrangement_unknown, | ||
610 | 78 | {}, | ||
611 | 79 | mir_output_gamma_unsupported, | ||
612 | 80 | {} | ||
613 | 81 | }; | ||
614 | 82 | } | ||
615 | 83 | |||
616 | 84 | struct TestDisplayConfiguration : mtd::NullDisplayConfiguration | 56 | struct TestDisplayConfiguration : mtd::NullDisplayConfiguration |
617 | 85 | { | 57 | { |
618 | 86 | std::vector<mg::DisplayConfigurationOutput> const outputs; | 58 | std::vector<mg::DisplayConfigurationOutput> const outputs; |
619 | @@ -176,7 +148,6 @@ | |||
620 | 176 | mt::fake_shared(session_event_sink), | 148 | mt::fake_shared(session_event_sink), |
621 | 177 | mt::fake_shared(server_action_queue), | 149 | mt::fake_shared(server_action_queue), |
622 | 178 | mt::fake_shared(display_configuration_report), | 150 | mt::fake_shared(display_configuration_report), |
623 | 179 | mt::fake_shared(mock_input_region), | ||
624 | 180 | mt::fake_shared(alarm_factory)); | 151 | mt::fake_shared(alarm_factory)); |
625 | 181 | } | 152 | } |
626 | 182 | 153 | ||
627 | @@ -188,7 +159,6 @@ | |||
628 | 188 | mtd::StubDisplayConfig base_config; | 159 | mtd::StubDisplayConfig base_config; |
629 | 189 | StubServerActionQueue server_action_queue; | 160 | StubServerActionQueue server_action_queue; |
630 | 190 | StubDisplayConfigurationObserver display_configuration_report; | 161 | StubDisplayConfigurationObserver display_configuration_report; |
631 | 191 | testing::NiceMock<mtd::MockInputRegion> mock_input_region; | ||
632 | 192 | mtd::FakeAlarmFactory alarm_factory; | 162 | mtd::FakeAlarmFactory alarm_factory; |
633 | 193 | std::shared_ptr<ms::MediatingDisplayChanger> changer; | 163 | std::shared_ptr<ms::MediatingDisplayChanger> changer; |
634 | 194 | }; | 164 | }; |
635 | @@ -726,7 +696,6 @@ | |||
636 | 726 | mt::fake_shared(session_event_sink), | 696 | mt::fake_shared(session_event_sink), |
637 | 727 | mt::fake_shared(mock_server_action_queue), | 697 | mt::fake_shared(mock_server_action_queue), |
638 | 728 | mt::fake_shared(display_configuration_report), | 698 | mt::fake_shared(display_configuration_report), |
639 | 729 | mt::fake_shared(mock_input_region), | ||
640 | 730 | mt::fake_shared(alarm_factory)); | 699 | mt::fake_shared(alarm_factory)); |
641 | 731 | 700 | ||
642 | 732 | void const* owner{nullptr}; | 701 | void const* owner{nullptr}; |
643 | @@ -781,7 +750,6 @@ | |||
644 | 781 | mt::fake_shared(session_event_sink), | 750 | mt::fake_shared(session_event_sink), |
645 | 782 | mt::fake_shared(mock_server_action_queue), | 751 | mt::fake_shared(mock_server_action_queue), |
646 | 783 | mt::fake_shared(display_configuration_report), | 752 | mt::fake_shared(display_configuration_report), |
647 | 784 | mt::fake_shared(mock_input_region), | ||
648 | 785 | mt::fake_shared(alarm_factory)); | 753 | mt::fake_shared(alarm_factory)); |
649 | 786 | 754 | ||
650 | 787 | EXPECT_CALL(mock_server_action_queue, enqueue(_, _)); | 755 | EXPECT_CALL(mock_server_action_queue, enqueue(_, _)); |
651 | @@ -911,7 +879,6 @@ | |||
652 | 911 | mt::fake_shared(session_event_sink), | 879 | mt::fake_shared(session_event_sink), |
653 | 912 | mt::fake_shared(server_action_queue), | 880 | mt::fake_shared(server_action_queue), |
654 | 913 | mt::fake_shared(display_configuration_observer), | 881 | mt::fake_shared(display_configuration_observer), |
655 | 914 | mt::fake_shared(mock_input_region), | ||
656 | 915 | mt::fake_shared(alarm_factory)); | 882 | mt::fake_shared(alarm_factory)); |
657 | 916 | 883 | ||
658 | 917 | mtd::NullDisplayConfiguration conf; | 884 | mtd::NullDisplayConfiguration conf; |
659 | @@ -921,37 +888,6 @@ | |||
660 | 921 | changer->set_base_configuration(mt::fake_shared(conf)); | 888 | changer->set_base_configuration(mt::fake_shared(conf)); |
661 | 922 | } | 889 | } |
662 | 923 | 890 | ||
663 | 924 | TEST_F(MediatingDisplayChangerTest, input_region_receives_display_configuration_on_start) | ||
664 | 925 | { | ||
665 | 926 | using namespace testing; | ||
666 | 927 | EXPECT_CALL(mock_input_region, set_input_rectangles(_)); | ||
667 | 928 | |||
668 | 929 | ms::MediatingDisplayChanger display_changer( | ||
669 | 930 | mt::fake_shared(mock_display), | ||
670 | 931 | mt::fake_shared(mock_compositor), | ||
671 | 932 | mt::fake_shared(mock_conf_policy), | ||
672 | 933 | mt::fake_shared(stub_session_container), | ||
673 | 934 | mt::fake_shared(session_event_sink), | ||
674 | 935 | mt::fake_shared(server_action_queue), | ||
675 | 936 | mt::fake_shared(display_configuration_report), | ||
676 | 937 | mt::fake_shared(mock_input_region), | ||
677 | 938 | mt::fake_shared(alarm_factory)); | ||
678 | 939 | } | ||
679 | 940 | |||
680 | 941 | TEST_F(MediatingDisplayChangerTest, notifies_input_region_on_new_configuration) | ||
681 | 942 | { | ||
682 | 943 | using namespace testing; | ||
683 | 944 | mtd::NullDisplayConfiguration conf; | ||
684 | 945 | mir::geometry::Rectangles expected_rectangles; | ||
685 | 946 | EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); | ||
686 | 947 | |||
687 | 948 | auto session = std::make_shared<mtd::StubSession>(); | ||
688 | 949 | |||
689 | 950 | session_event_sink.handle_focus_change(session); | ||
690 | 951 | changer->configure(session, | ||
691 | 952 | mt::fake_shared(conf)); | ||
692 | 953 | } | ||
693 | 954 | |||
694 | 955 | TEST_F(MediatingDisplayChangerTest, notifies_session_on_preview_base_configuration) | 891 | TEST_F(MediatingDisplayChangerTest, notifies_session_on_preview_base_configuration) |
695 | 956 | { | 892 | { |
696 | 957 | using namespace testing; | 893 | using namespace testing; |
697 | @@ -1122,103 +1058,3 @@ | |||
698 | 1122 | EXPECT_THAT(*received_configuration, mt::DisplayConfigMatches(std::cref(*new_config))); | 1058 | EXPECT_THAT(*received_configuration, mt::DisplayConfigMatches(std::cref(*new_config))); |
699 | 1123 | } | 1059 | } |
700 | 1124 | 1060 | ||
701 | 1125 | TEST_F(MediatingDisplayChangerTest, input_region_skipps_not_connected_displays) | ||
702 | 1126 | { | ||
703 | 1127 | using namespace testing; | ||
704 | 1128 | |||
705 | 1129 | auto const connected = true; | ||
706 | 1130 | auto const disconnected = false; | ||
707 | 1131 | auto const used = true; | ||
708 | 1132 | mir::geometry::Rectangles expected_rectangles; | ||
709 | 1133 | expected_rectangles.add(geom::Rectangle{geom::Point{0,0}, geom::Size{100,100}}); | ||
710 | 1134 | |||
711 | 1135 | TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0}, | ||
712 | 1136 | geom::Point{0, 0}, | ||
713 | 1137 | geom::Size{100, 100}, | ||
714 | 1138 | connected, | ||
715 | 1139 | used, | ||
716 | 1140 | mir_power_mode_on), | ||
717 | 1141 | display_output(mg::DisplayConfigurationOutputId{1}, | ||
718 | 1142 | geom::Point{100, 0}, | ||
719 | 1143 | geom::Size{100, 100}, | ||
720 | 1144 | disconnected, | ||
721 | 1145 | used, | ||
722 | 1146 | mir_power_mode_on)}}; | ||
723 | 1147 | |||
724 | 1148 | EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); | ||
725 | 1149 | |||
726 | 1150 | auto session = std::make_shared<mtd::StubSession>(); | ||
727 | 1151 | |||
728 | 1152 | session_event_sink.handle_focus_change(session); | ||
729 | 1153 | changer->configure(session, | ||
730 | 1154 | mt::fake_shared(conf)); | ||
731 | 1155 | } | ||
732 | 1156 | |||
733 | 1157 | TEST_F(MediatingDisplayChangerTest, input_region_accumulates_powered_and_connected_displays) | ||
734 | 1158 | { | ||
735 | 1159 | using namespace testing; | ||
736 | 1160 | |||
737 | 1161 | auto const connected = true; | ||
738 | 1162 | auto const first_monitor = geom::Rectangle{geom::Point{0, 0}, geom::Size{ 40, 40 }}; | ||
739 | 1163 | auto const second_monitor = geom::Rectangle{geom::Point{40, 0}, geom::Size{ 10, 10}}; | ||
740 | 1164 | auto const used = true; | ||
741 | 1165 | mir::geometry::Rectangles expected_rectangles; | ||
742 | 1166 | expected_rectangles.add(first_monitor); | ||
743 | 1167 | expected_rectangles.add(second_monitor); | ||
744 | 1168 | |||
745 | 1169 | TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0}, | ||
746 | 1170 | first_monitor.top_left, | ||
747 | 1171 | first_monitor.size, | ||
748 | 1172 | connected, | ||
749 | 1173 | used, | ||
750 | 1174 | mir_power_mode_on), | ||
751 | 1175 | display_output(mg::DisplayConfigurationOutputId{1}, | ||
752 | 1176 | second_monitor.top_left, | ||
753 | 1177 | second_monitor.size, | ||
754 | 1178 | connected, | ||
755 | 1179 | used, | ||
756 | 1180 | mir_power_mode_on)}}; | ||
757 | 1181 | |||
758 | 1182 | EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); | ||
759 | 1183 | |||
760 | 1184 | auto session = std::make_shared<mtd::StubSession>(); | ||
761 | 1185 | |||
762 | 1186 | session_event_sink.handle_focus_change(session); | ||
763 | 1187 | changer->configure(session, | ||
764 | 1188 | mt::fake_shared(conf)); | ||
765 | 1189 | } | ||
766 | 1190 | |||
767 | 1191 | |||
768 | 1192 | TEST_F(MediatingDisplayChangerTest, input_region_accumulates_powered_connected_skips_unused_displays) | ||
769 | 1193 | { | ||
770 | 1194 | using namespace testing; | ||
771 | 1195 | |||
772 | 1196 | auto const connected = true; | ||
773 | 1197 | auto const first_monitor = geom::Rectangle{geom::Point{0, 0}, geom::Size{ 40, 40 }}; | ||
774 | 1198 | auto const second_monitor = geom::Rectangle{geom::Point{40, 0}, geom::Size{ 10, 10}}; | ||
775 | 1199 | auto const not_used = false; | ||
776 | 1200 | auto const used = true; | ||
777 | 1201 | mir::geometry::Rectangles expected_rectangles; | ||
778 | 1202 | expected_rectangles.add(second_monitor); | ||
779 | 1203 | |||
780 | 1204 | TestDisplayConfiguration conf{{display_output(mg::DisplayConfigurationOutputId{0}, | ||
781 | 1205 | first_monitor.top_left, | ||
782 | 1206 | first_monitor.size, | ||
783 | 1207 | connected, | ||
784 | 1208 | not_used, | ||
785 | 1209 | mir_power_mode_on), | ||
786 | 1210 | display_output(mg::DisplayConfigurationOutputId{1}, | ||
787 | 1211 | second_monitor.top_left, | ||
788 | 1212 | second_monitor.size, | ||
789 | 1213 | connected, | ||
790 | 1214 | used, | ||
791 | 1215 | mir_power_mode_on)}}; | ||
792 | 1216 | |||
793 | 1217 | EXPECT_CALL(mock_input_region, set_input_rectangles(expected_rectangles)); | ||
794 | 1218 | |||
795 | 1219 | auto session = std::make_shared<mtd::StubSession>(); | ||
796 | 1220 | |||
797 | 1221 | session_event_sink.handle_focus_change(session); | ||
798 | 1222 | changer->configure(session, | ||
799 | 1223 | mt::fake_shared(conf)); | ||
800 | 1224 | } |
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:/