Mir

Merge lp:~alan-griffiths/mir/delete-dead-code into lp:mir

Proposed by Alan Griffiths
Status: Work in progress
Proposed branch: lp:~alan-griffiths/mir/delete-dead-code
Merge into: lp:mir
Diff against target: 586 lines (+19/-239)
17 files modified
include/server/mir/scene/null_surface_observer.h (+0/-1)
include/server/mir/scene/surface.h (+2/-4)
include/server/mir/scene/surface_observer.h (+0/-2)
include/test/mir/test/doubles/stub_surface.h (+0/-2)
src/include/server/mir/scene/surface_event_source.h (+0/-2)
src/include/server/mir/scene/surface_observers.h (+0/-2)
src/server/scene/basic_surface.cpp (+11/-24)
src/server/scene/basic_surface.h (+2/-5)
src/server/scene/legacy_surface_change_notification.cpp (+1/-7)
src/server/scene/legacy_surface_change_notification.h (+0/-2)
src/server/scene/null_surface_observer.cpp (+0/-5)
src/server/scene/surface_event_source.cpp (+0/-9)
tests/acceptance-tests/test_client_cursor_api.cpp (+0/-6)
tests/acceptance-tests/test_client_input.cpp (+2/-117)
tests/acceptance-tests/test_nested_input.cpp (+1/-43)
tests/include/mir/test/doubles/stub_scene_surface.h (+0/-3)
tests/mir_test_framework/stub_surface.cpp (+0/-5)
To merge this branch: bzr merge lp:~alan-griffiths/mir/delete-dead-code
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+331604@code.launchpad.net

Commit message

[mirserver] Surface::set_keymap() is unused, so we don't need the code to support it

To post a comment you must log in.

Unmerged revisions

4278. By Alan Griffiths

Delete dead code - Surface::set_keymap()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/server/mir/scene/null_surface_observer.h'
2--- include/server/mir/scene/null_surface_observer.h 2017-07-28 17:00:43 +0000
3+++ include/server/mir/scene/null_surface_observer.h 2017-09-29 20:07:10 +0000
4@@ -42,7 +42,6 @@
5 void cursor_image_set_to(graphics::CursorImage const& image) override;
6 void reception_mode_set_to(input::InputReceptionMode mode) override;
7 void client_surface_close_requested() override;
8- void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout, std::string const& variant, std::string const& options) override;
9 void renamed(char const* name) override;
10 void cursor_image_removed() override;
11 void placed_relative(geometry::Rectangle const& placement) override;
12
13=== modified file 'include/server/mir/scene/surface.h'
14--- include/server/mir/scene/surface.h 2017-08-30 15:38:42 +0000
15+++ include/server/mir/scene/surface.h 2017-09-29 20:07:10 +0000
16@@ -63,7 +63,7 @@
17 /// Size of the surface including window frame (if any)
18 virtual geometry::Size size() const = 0;
19
20- virtual graphics::RenderableList generate_renderables(compositor::CompositorID id) const = 0;
21+ virtual graphics::RenderableList generate_renderables(compositor::CompositorID id) const = 0;
22 virtual int buffers_ready_for_compositor(void const* compositor_id) const = 0;
23
24 virtual MirWindowType type() const = 0;
25@@ -89,7 +89,7 @@
26 virtual void set_transformation(glm::mat4 const& t) = 0;
27 virtual void set_alpha(float alpha) = 0;
28 virtual void set_orientation(MirOrientation orientation) = 0;
29-
30+
31 virtual void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& image) override = 0;
32 virtual std::shared_ptr<graphics::CursorImage> cursor_image() const override = 0;
33
34@@ -106,8 +106,6 @@
35 // TODO a legacy of old interactions and needs removing
36 virtual int query(MirWindowAttrib attrib) const = 0;
37
38- virtual void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,
39- std::string const& variant, std::string const& options) = 0;
40 virtual void rename(std::string const& title) = 0;
41 virtual void set_streams(std::list<StreamInfo> const& streams) = 0;
42
43
44=== modified file 'include/server/mir/scene/surface_observer.h'
45--- include/server/mir/scene/surface_observer.h 2017-07-28 17:00:43 +0000
46+++ include/server/mir/scene/surface_observer.h 2017-09-29 20:07:10 +0000
47@@ -57,8 +57,6 @@
48 virtual void reception_mode_set_to(input::InputReceptionMode mode) = 0;
49 virtual void cursor_image_set_to(graphics::CursorImage const& image) = 0;
50 virtual void client_surface_close_requested() = 0;
51- virtual void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout,
52- std::string const& variant, std::string const& options) = 0;
53 virtual void renamed(char const* name) = 0;
54 virtual void cursor_image_removed() = 0;
55 virtual void placed_relative(geometry::Rectangle const& placement) = 0;
56
57=== modified file 'include/test/mir/test/doubles/stub_surface.h'
58--- include/test/mir/test/doubles/stub_surface.h 2017-08-30 15:38:42 +0000
59+++ include/test/mir/test/doubles/stub_surface.h 2017-09-29 20:07:10 +0000
60@@ -63,8 +63,6 @@
61 std::shared_ptr<Surface> parent() const override;
62 void add_observer(std::shared_ptr<scene::SurfaceObserver> const& observer) override;
63 void remove_observer(std::weak_ptr<scene::SurfaceObserver> const& observer) override;
64- void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,
65- std::string const& variant, std::string const& options) override;
66 void rename(std::string const& title) override;
67 void set_confine_pointer_state(MirPointerConfinementState state) override;
68 MirPointerConfinementState confine_pointer_state() const override;
69
70=== modified file 'src/include/server/mir/scene/surface_event_source.h'
71--- src/include/server/mir/scene/surface_event_source.h 2017-07-28 17:00:43 +0000
72+++ src/include/server/mir/scene/surface_event_source.h 2017-09-29 20:07:10 +0000
73@@ -47,8 +47,6 @@
74 void moved_to(geometry::Point const& top_left) override;
75 void orientation_set_to(MirOrientation orientation) override;
76 void client_surface_close_requested() override;
77- void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout,
78- std::string const& variant, std::string const& options) override;
79 void placed_relative(geometry::Rectangle const& placement) override;
80 void input_consumed(MirEvent const* event) override;
81 void start_drag_and_drop(std::vector<uint8_t> const& handle) override;
82
83=== modified file 'src/include/server/mir/scene/surface_observers.h'
84--- src/include/server/mir/scene/surface_observers.h 2017-07-28 17:00:43 +0000
85+++ src/include/server/mir/scene/surface_observers.h 2017-09-29 20:07:10 +0000
86@@ -45,8 +45,6 @@
87 void reception_mode_set_to(input::InputReceptionMode mode) override;
88 void cursor_image_set_to(graphics::CursorImage const& image) override;
89 void client_surface_close_requested() override;
90- void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout,
91- std::string const& variant, std::string const& options) override;
92 void renamed(char const*) override;
93 void cursor_image_removed() override;
94 void placed_relative(geometry::Rectangle const& placement) override;
95
96=== modified file 'src/server/scene/basic_surface.cpp'
97--- src/server/scene/basic_surface.cpp 2017-08-30 15:38:42 +0000
98+++ src/server/scene/basic_surface.cpp 2017-09-29 20:07:10 +0000
99@@ -113,13 +113,6 @@
100 { observer->client_surface_close_requested(); });
101 }
102
103-void ms::SurfaceObservers::keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout,
104- std::string const& variant, std::string const& options)
105-{
106- for_each([&](std::shared_ptr<SurfaceObserver> const& observer)
107- { observer->keymap_changed(id, model, layout, variant, options); });
108-}
109-
110 void ms::SurfaceObservers::renamed(char const* name)
111 {
112 for_each([name](std::shared_ptr<SurfaceObserver> const& observer)
113@@ -410,7 +403,7 @@
114 bool ms::BasicSurface::visible() const
115 {
116 std::unique_lock<std::mutex> lk(guard);
117- return visible(lk);
118+ return visible(lk);
119 }
120
121 bool ms::BasicSurface::visible(std::unique_lock<std::mutex>&) const
122@@ -436,7 +429,7 @@
123 }
124
125 MirWindowType ms::BasicSurface::type() const
126-{
127+{
128 std::unique_lock<std::mutex> lg(guard);
129 return type_;
130 }
131@@ -444,7 +437,7 @@
132 MirWindowType ms::BasicSurface::set_type(MirWindowType t)
133 {
134 std::unique_lock<std::mutex> lg(guard);
135-
136+
137 if (t < 0 || t > mir_window_types)
138 {
139 BOOST_THROW_EXCEPTION(std::logic_error("Invalid surface "
140@@ -456,7 +449,7 @@
141 type_ = t;
142 lg.unlock();
143
144- observers.attrib_changed(mir_window_attrib_type, type_);
145+ observers.attrib_changed(mir_window_attrib_type, type_);
146 }
147
148 return t;
149@@ -496,7 +489,7 @@
150 {
151 swapinterval_ = interval;
152 bool allow_dropping = (interval == 0);
153- for (auto& info : layers)
154+ for (auto& info : layers)
155 info.stream->allow_framedropping(allow_dropping);
156
157 lg.unlock();
158@@ -610,7 +603,7 @@
159 {
160 std::unique_lock<std::mutex> lock(guard);
161 cursor_stream_adapter->reset();
162-
163+
164 cursor_image_ = image;
165 }
166
167@@ -722,7 +715,7 @@
168 lg.unlock();
169 observers.attrib_changed(mir_window_attrib_dpi, new_dpi);
170 }
171-
172+
173 return new_dpi;
174 }
175
176@@ -753,7 +746,7 @@
177 void ms::BasicSurface::add_observer(std::shared_ptr<SurfaceObserver> const& observer)
178 {
179 observers.add(observer);
180- for (auto& info : layers)
181+ for (auto& info : layers)
182 info.stream->add_observer(observer);
183 }
184
185@@ -763,7 +756,7 @@
186 if (!o)
187 BOOST_THROW_EXCEPTION(std::runtime_error("Invalid observer (previously destroyed)"));
188 observers.remove(o);
189- for (auto& info : layers)
190+ for (auto& info : layers)
191 info.stream->remove_observer(observer);
192 }
193
194@@ -803,7 +796,7 @@
195 {
196 return underlying_buffer_stream->framedropping() ? 0 : 1;
197 }
198-
199+
200 std::shared_ptr<mg::Buffer> buffer() const override
201 {
202 if (!compositor_buffer)
203@@ -822,7 +815,7 @@
204
205 bool shaped() const override
206 { return mg::contains_alpha(underlying_buffer_stream->pixel_format()); }
207-
208+
209 mg::Renderable::ID id() const override
210 { return id_; }
211 private:
212@@ -850,12 +843,6 @@
213 observers.input_consumed(event);
214 }
215
216-void ms::BasicSurface::set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,
217- std::string const& variant, std::string const& options)
218-{
219- observers.keymap_changed(id, model, layout, variant, options);
220-}
221-
222 void ms::BasicSurface::rename(std::string const& title)
223 {
224 if (surface_name != title)
225
226=== modified file 'src/server/scene/basic_surface.h'
227--- src/server/scene/basic_surface.h 2017-08-30 15:38:42 +0000
228+++ src/server/scene/basic_surface.h 2017-09-29 20:07:10 +0000
229@@ -103,7 +103,7 @@
230 void set_transformation(glm::mat4 const&) override;
231
232 bool visible() const override;
233-
234+
235 graphics::RenderableList generate_renderables(compositor::CompositorID id) const override;
236 int buffers_ready_for_compositor(void const* compositor_id) const override;
237
238@@ -113,7 +113,7 @@
239 int query(MirWindowAttrib attrib) const override;
240 void hide() override;
241 void show() override;
242-
243+
244 void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& image) override;
245 std::shared_ptr<graphics::CursorImage> cursor_image() const override;
246
247@@ -131,9 +131,6 @@
248
249 int dpi() const;
250
251- void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,
252- std::string const& variant, std::string const& options) override;
253-
254 void rename(std::string const& title) override;
255
256 void set_confine_pointer_state(MirPointerConfinementState state) override;
257
258=== modified file 'src/server/scene/legacy_surface_change_notification.cpp'
259--- src/server/scene/legacy_surface_change_notification.cpp 2017-07-28 17:00:43 +0000
260+++ src/server/scene/legacy_surface_change_notification.cpp 2017-09-29 20:07:10 +0000
261@@ -94,12 +94,6 @@
262 {
263 }
264
265-// A keymap change is not enough to trigger recomposition
266-void ms::LegacySurfaceChangeNotification::keymap_changed(MirInputDeviceId, std::string const&, std::string const&,
267- std::string const&, std::string const&)
268-{
269-}
270-
271 void ms::LegacySurfaceChangeNotification::renamed(char const*)
272 {
273 notify_scene_change();
274@@ -111,4 +105,4 @@
275
276 void ms::LegacySurfaceChangeNotification::start_drag_and_drop(std::vector<uint8_t> const& /*handle*/)
277 {
278-}
279\ No newline at end of file
280+}
281
282=== modified file 'src/server/scene/legacy_surface_change_notification.h'
283--- src/server/scene/legacy_surface_change_notification.h 2017-07-28 17:00:43 +0000
284+++ src/server/scene/legacy_surface_change_notification.h 2017-09-29 20:07:10 +0000
285@@ -45,8 +45,6 @@
286 void reception_mode_set_to(input::InputReceptionMode mode) override;
287 void cursor_image_set_to(graphics::CursorImage const& image) override;
288 void client_surface_close_requested() override;
289- void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout,
290- std::string const& variant, std::string const& options) override;
291 void renamed(char const*) override;
292 void cursor_image_removed() override;
293 void placed_relative(geometry::Rectangle const& placement) override;
294
295=== modified file 'src/server/scene/null_surface_observer.cpp'
296--- src/server/scene/null_surface_observer.cpp 2017-07-28 17:00:43 +0000
297+++ src/server/scene/null_surface_observer.cpp 2017-09-29 20:07:10 +0000
298@@ -32,11 +32,6 @@
299 void ms::NullSurfaceObserver::reception_mode_set_to(input::InputReceptionMode /*mode*/) {}
300 void ms::NullSurfaceObserver::cursor_image_set_to(mg::CursorImage const& /*image*/) {}
301 void ms::NullSurfaceObserver::client_surface_close_requested() {}
302-void ms::NullSurfaceObserver::keymap_changed(MirInputDeviceId /* id */, std::string const& /*model*/,
303- std::string const& /*layout*/, std::string const& /*variant*/,
304- std::string const& /**/)
305-{
306-}
307 void ms::NullSurfaceObserver::renamed(char const*) {}
308 void ms::NullSurfaceObserver::cursor_image_removed() {}
309 void ms::NullSurfaceObserver::placed_relative(geometry::Rectangle const& /*placement*/) {}
310
311=== modified file 'src/server/scene/surface_event_source.cpp'
312--- src/server/scene/surface_event_source.cpp 2017-07-28 17:00:43 +0000
313+++ src/server/scene/surface_event_source.cpp 2017-09-29 20:07:10 +0000
314@@ -81,15 +81,6 @@
315 event_sink->handle_event(*mev::make_event(id));
316 }
317
318-void ms::SurfaceEventSource::keymap_changed(MirInputDeviceId device_id,
319- std::string const& model,
320- std::string const& layout,
321- std::string const& variant,
322- std::string const& options)
323-{
324- event_sink->handle_event(*mev::make_event(id, device_id, model, layout, variant, options));
325-}
326-
327 void ms::SurfaceEventSource::placed_relative(geometry::Rectangle const& placement)
328 {
329 event_sink->handle_event(*mev::make_event(id, placement));
330
331=== modified file 'tests/acceptance-tests/test_client_cursor_api.cpp'
332--- tests/acceptance-tests/test_client_cursor_api.cpp 2017-09-24 21:17:51 +0000
333+++ tests/acceptance-tests/test_client_cursor_api.cpp 2017-09-29 20:07:10 +0000
334@@ -74,12 +74,6 @@
335 MOCK_METHOD1(reception_mode_set_to, void(mi::InputReceptionMode mode));
336 MOCK_METHOD1(cursor_image_set_to, void(mg::CursorImage const& image));
337 MOCK_METHOD0(client_surface_close_requested, void());
338- MOCK_METHOD5(keymap_changed, void(
339- MirInputDeviceId id,
340- std::string const& model,
341- std::string const& layout,
342- std::string const& variant,
343- std::string const& options));
344 MOCK_METHOD1(renamed, void(char const* name));
345 MOCK_METHOD0(cursor_image_removed, void());
346 MOCK_METHOD1(placed_relative, void(geom::Rectangle const& placement));
347
348=== modified file 'tests/acceptance-tests/test_client_input.cpp'
349--- tests/acceptance-tests/test_client_input.cpp 2017-07-28 17:00:43 +0000
350+++ tests/acceptance-tests/test_client_input.cpp 2017-09-29 20:07:10 +0000
351@@ -106,7 +106,7 @@
352 set_callback(connection,
353 [](MirConnection*, void* context)
354 {
355- static_cast<mt::Signal*>(context)->raise();
356+ static_cast<mt::Signal*>(context)->raise();
357 },
358 &change_complete
359 );
360@@ -805,79 +805,6 @@
361 first_client.all_events_received.wait_for(2s);
362 }
363
364-TEST_F(TestClientInput, clients_receive_keymap_change_events)
365-{
366- Client first_client(new_connection(), first);
367-
368- std::string const model = "pc105";
369- std::string const layout = "dvorak";
370- MirInputDeviceId const id = 1;
371-
372- EXPECT_CALL(first_client, handle_keymap(mt::KeymapEventForDevice(id)))
373- .Times(1)
374- .WillOnce(mt::WakeUp(&first_client.all_events_received));
375-
376- server.the_shell()->focused_surface()->set_keymap(id, model, layout, "", "");
377- first_client.all_events_received.wait_for(2s);
378-}
379-
380-TEST_F(TestClientInput, keymap_changes_change_keycode_received)
381-{
382- Client first_client(new_connection(), first);
383-
384- MirInputDeviceId const id = 1;
385- std::string const model = "pc105";
386- std::string const layout = "us";
387- std::string const variant = "dvorak";
388-
389- mt::Signal first_event_received,
390- client_sees_keymap_change;
391-
392- InSequence seq;
393- EXPECT_CALL(first_client, handle_input(AllOf(mt::KeyDownEvent(), mt::KeyOfSymbol(XKB_KEY_n))));
394- EXPECT_CALL(first_client, handle_input(mt::KeyUpEvent()))
395- .WillOnce(mt::WakeUp(&first_event_received));
396- EXPECT_CALL(first_client, handle_keymap(mt::KeymapEventForDevice(id)))
397- .WillOnce(mt::WakeUp(&client_sees_keymap_change));
398-
399- EXPECT_CALL(first_client, handle_input(AllOf(mt::KeyDownEvent(), mt::KeyOfSymbol(XKB_KEY_b))));
400- EXPECT_CALL(first_client, handle_input(mt::KeyUpEvent()))
401- .WillOnce(mt::WakeUp(&first_client.all_events_received));
402-
403- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_N));
404- fake_keyboard->emit_event(mis::a_key_up_event().of_scancode(KEY_N));
405-
406- first_event_received.wait_for(60s);
407-
408- server.the_shell()->focused_surface()->set_keymap(id, model, layout, variant, "");
409-
410- client_sees_keymap_change.wait_for(60s);
411-
412- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_N));
413- fake_keyboard->emit_event(mis::a_key_up_event().of_scancode(KEY_N));
414-
415- first_client.all_events_received.wait_for(5s);
416-}
417-
418-
419-TEST_F(TestClientInput, sends_no_wrong_keymaps_to_clients)
420-{
421- Client first_client(new_connection(), first);
422-
423- MirInputDeviceId const id = 1;
424- std::string const model = "thargoid207";
425- std::string const layout = "polaris";
426-
427- mt::Signal first_event_received,
428- client_sees_keymap_change;
429-
430- EXPECT_CALL(first_client, handle_keymap(mt::KeymapEventForDevice(id))).Times(0);
431-
432- EXPECT_THROW(
433- {server.the_shell()->focused_surface()->set_keymap(id, model, layout, "", "");},
434- std::invalid_argument);
435-}
436-
437 TEST_F(TestClientInput, event_filter_may_consume_events)
438 {
439 std::shared_ptr<MockEventFilter> mock_event_filter = std::make_shared<MockEventFilter>();
440@@ -932,7 +859,7 @@
441 TEST_F(TestClientInput, pointer_events_pass_through_shaped_out_regions_of_client)
442 {
443 positions[first] = {{0, 0}, {10, 10}};
444-
445+
446 Client client(new_connection(), first);
447
448 MirRectangle input_rects[] = {{1, 1, 10, 10}};
449@@ -1128,48 +1055,6 @@
450 first_client.all_events_received.wait_for(10s);
451 }
452
453-TEST_F(TestClientInput, reestablishes_num_lock_state_in_client_with_surface_keymap)
454-{
455- Client a_client_with_keymap(new_connection(), first);
456-
457- mir::test::Signal keymap_received;
458- mir::test::Signal device_state_received;
459-
460- EXPECT_CALL(a_client_with_keymap, handle_keymap(_))
461- .WillOnce(mt::WakeUp(&keymap_received));
462- EXPECT_CALL(a_client_with_keymap,
463- handle_input_device_state(
464- mt::DeviceStateWithPressedKeys(std::vector<uint32_t>{KEY_NUMLOCK, KEY_NUMLOCK})))
465- .WillOnce(mt::WakeUp(&device_state_received));
466-
467- get_surface(first)->set_keymap(MirInputDeviceId{0}, "pc105", "de", "", "");
468- keymap_received.wait_for(4s);
469-
470- {
471- Client a_client(new_connection(), second);
472-
473- EXPECT_CALL(a_client, handle_input(mt::KeyDownEvent()));
474- EXPECT_CALL(a_client, handle_input(mt::KeyUpEvent()));
475- EXPECT_CALL(a_client, handle_input(AllOf(mt::KeyDownEvent(),mt::KeyOfSymbol(XKB_KEY_KP_4))));
476- EXPECT_CALL(a_client, handle_input(AllOf(mt::KeyUpEvent(),mt::KeyOfSymbol(XKB_KEY_KP_4))))
477- .WillOnce(mt::WakeUp(&a_client.all_events_received));
478-
479- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_NUMLOCK));
480- fake_keyboard->emit_event(mis::a_key_up_event().of_scancode(KEY_NUMLOCK));
481- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_KP4));
482- fake_keyboard->emit_event(mis::a_key_up_event().of_scancode(KEY_KP4));
483-
484- a_client.all_events_received.wait_for(10s);
485- }
486- device_state_received.wait_for(4s);
487- EXPECT_CALL(a_client_with_keymap, handle_input(mt::KeyOfSymbol(XKB_KEY_KP_4)))
488- .WillOnce(mt::WakeUp(&a_client_with_keymap.all_events_received));
489-
490- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_KP4));
491-
492- a_client_with_keymap.all_events_received.wait_for(10s);
493-}
494-
495 TEST_F(TestClientInput, initial_mouse_configuration_can_be_querried)
496 {
497 wait_for_input_devices();
498
499=== modified file 'tests/acceptance-tests/test_nested_input.cpp'
500--- tests/acceptance-tests/test_nested_input.cpp 2017-07-28 17:00:43 +0000
501+++ tests/acceptance-tests/test_nested_input.cpp 2017-09-29 20:07:10 +0000
502@@ -158,7 +158,7 @@
503 {
504 {{ 0, 0}, {1920, 1080}}
505 };
506-
507+
508 struct NestedServerWithMockEventFilter : mtf::HeadlessNestedServerRunner
509 {
510 NestedServerWithMockEventFilter(std::string const& connection_string,
511@@ -571,45 +571,3 @@
512
513 EXPECT_THAT(mir_pointer_config_get_acceleration_bias(ptr_conf), acceleration_bias);
514 }
515-
516-TEST_F(NestedInput, pressed_keys_on_vt_switch_are_forgotten)
517-{
518- mt::Signal keymap_received;
519- mt::Signal devices_ready;
520- mt::Signal initial_keys_received;
521- mt::Signal keys_without_modifier_received;
522- NiceMock<MockEventFilter> nested_event_filter;
523- ON_CALL(nested_event_filter, handle(
524- mt::InputDeviceStateEvent()))
525- .WillByDefault(mt::WakeUp(&devices_ready));
526-
527- NestedServerWithMockEventFilter nested_mir{new_connection(), mt::fake_shared(nested_event_filter)};
528- ExposedSurface client_to_nested(nested_mir.new_connection(), "with_keymap");
529-
530- ASSERT_TRUE(devices_ready.wait_for(10s));
531- EXPECT_CALL(client_to_nested, handle_keymap())
532- .WillOnce(mt::WakeUp(&keymap_received));
533- EXPECT_CALL(client_to_nested, handle_input(mt::KeyOfScanCode(KEY_RIGHTALT)));
534- EXPECT_CALL(client_to_nested, handle_input(mt::KeyOfScanCode(KEY_RIGHTCTRL)))
535- .WillOnce(mt::WakeUp(&initial_keys_received));
536-
537- nested_mir.get_surface("with_keymap")->set_keymap(MirInputDeviceId{0}, "pc105", "de", "", "");
538-
539- ASSERT_TRUE(client_to_nested.ready_to_accept_events.wait_for(10s));
540- EXPECT_TRUE(keymap_received.wait_for(10s));
541-
542- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_RIGHTALT));
543- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_RIGHTCTRL));
544-
545- EXPECT_TRUE(initial_keys_received.wait_for(10s));
546-
547- display.trigger_pause();
548- display.trigger_resume();
549-
550- EXPECT_CALL(client_to_nested,
551- handle_input(AllOf(mt::KeyOfScanCode(KEY_A), mt::KeyWithModifiers(mir_input_event_modifier_none))))
552- .WillOnce(mt::WakeUp(&keys_without_modifier_received));
553-
554- fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_A));
555- EXPECT_TRUE(keys_without_modifier_received.wait_for(10s));
556-}
557
558=== modified file 'tests/include/mir/test/doubles/stub_scene_surface.h'
559--- tests/include/mir/test/doubles/stub_scene_surface.h 2017-08-30 15:38:42 +0000
560+++ tests/include/mir/test/doubles/stub_scene_surface.h 2017-09-29 20:07:10 +0000
561@@ -83,9 +83,6 @@
562
563 std::shared_ptr<mir::scene::Surface> parent() const override { return nullptr; }
564
565- void set_keymap(MirInputDeviceId, std::string const&, std::string const&, std::string const&, std::string const&) override
566- {}
567-
568 void set_cursor_stream(std::shared_ptr<frontend::BufferStream> const&, geometry::Displacement const&) override {}
569 void rename(std::string const&) override {}
570 std::shared_ptr<frontend::BufferStream> primary_buffer_stream() const override { return nullptr; }
571
572=== modified file 'tests/mir_test_framework/stub_surface.cpp'
573--- tests/mir_test_framework/stub_surface.cpp 2017-08-30 15:38:42 +0000
574+++ tests/mir_test_framework/stub_surface.cpp 2017-09-29 20:07:10 +0000
575@@ -171,11 +171,6 @@
576 {
577 }
578
579-void mtd::StubSurface::set_keymap(MirInputDeviceId /*id*/, std::string const& /*model*/, std::string const& /*layout*/,
580- std::string const& /*variant*/, std::string const& /*options*/)
581-{
582-}
583-
584 void mtd::StubSurface::rename(std::string const& /*title*/)
585 {
586 }

Subscribers

People subscribed via source and target branches