Merge lp:~brandontschaefer/mir/deprecate-set-event-handler into lp:mir
- deprecate-set-event-handler
- Merge into development-branch
Proposed by
Brandon Schaefer
Status: | Superseded |
---|---|
Proposed branch: | lp:~brandontschaefer/mir/deprecate-set-event-handler |
Merge into: | lp:mir |
Diff against target: |
602 lines (+130/-34) 23 files modified
benchmarks/frame-uniformity/touch_measuring_client.cpp (+6/-3) examples/camera.c (+11/-8) examples/client_touch_validator.cpp (+4/-1) examples/demo_client_display_config.c (+4/-1) examples/eglapp.c (+3/-3) examples/eglsquare.cpp (+4/-1) examples/fingerpaint.c (+8/-5) examples/pointer_confinement.c (+1/-1) examples/target.c (+8/-2) include/client/mir_toolkit/mir_surface.h (+4/-0) src/client/mir_surface.cpp (+7/-0) src/server/graphics/nested/mir_client_host_connection.cpp (+4/-1) src/utils/vanity.c (+8/-2) tests/acceptance-tests/test_client_input.cpp (+6/-1) tests/acceptance-tests/test_client_library.cpp (+3/-0) tests/acceptance-tests/test_client_surface_events.cpp (+12/-0) tests/acceptance-tests/test_client_surface_visibility.cpp (+3/-0) tests/acceptance-tests/test_confined_pointer.cpp (+6/-0) tests/acceptance-tests/test_nested_input.cpp (+6/-0) tests/acceptance-tests/test_nested_mir.cpp (+6/-0) tests/acceptance-tests/test_surface_raise.cpp (+10/-5) tests/acceptance-tests/test_system_compositor_window_manager.cpp (+3/-0) tests/privileged-tests/test_input_events.cpp (+3/-0) |
To merge this branch: | bzr merge lp:~brandontschaefer/mir/deprecate-set-event-handler |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir development team | Pending | ||
Review via email: mp+314242@code.launchpad.net |
This proposal has been superseded by a proposal from 2017-01-06.
Commit message
Description of the change
Deprecate set_event_handler as we are using mir_surface_
The tests need to stay testing the old way, which will be moved over once we remove the function. All other places have moved over to the new way.
To post a comment you must log in.
- 3908. By Brandon Schaefer
-
* Merge parent
- 3909. By Brandon Schaefer
-
* Merge parent, fix conflicts
Unmerged revisions
- 3909. By Brandon Schaefer
-
* Merge parent, fix conflicts
- 3908. By Brandon Schaefer
-
* Merge parent
- 3907. By Brandon Schaefer
-
* Deprecate mir_surface_
set_event_ handler
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'benchmarks/frame-uniformity/touch_measuring_client.cpp' |
2 | --- benchmarks/frame-uniformity/touch_measuring_client.cpp 2015-06-17 05:20:42 +0000 |
3 | +++ benchmarks/frame-uniformity/touch_measuring_client.cpp 2017-01-06 19:13:38 +0000 |
4 | @@ -42,7 +42,7 @@ |
5 | |
6 | auto surface = mir_surface_create_sync(spec); |
7 | mir_surface_spec_release(spec); |
8 | - |
9 | + |
10 | if (!mir_surface_is_valid(surface)) |
11 | { |
12 | std::cerr << "Surface creation failed: " << mir_surface_get_error_message(surface) << std::endl; |
13 | @@ -55,14 +55,17 @@ |
14 | void input_callback(MirSurface * /* surface */, MirEvent const* event, void* context) |
15 | { |
16 | auto results = static_cast<TouchSamples*>(context); |
17 | - |
18 | + |
19 | results->record_pointer_coordinates(std::chrono::high_resolution_clock::now(), *event); |
20 | } |
21 | |
22 | void collect_input_and_frame_timing(MirSurface *surface, mt::Barrier& client_ready, std::chrono::high_resolution_clock::duration duration, std::shared_ptr<TouchSamples> const& results) |
23 | { |
24 | +#pragma GCC diagnostic push |
25 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
26 | mir_surface_set_event_handler(surface, input_callback, results.get()); |
27 | - |
28 | +#pragma GCC diagnostic pop |
29 | + |
30 | client_ready.ready(); |
31 | |
32 | // May be better if end time were relative to the first input event |
33 | |
34 | === modified file 'examples/camera.c' |
35 | --- examples/camera.c 2016-10-26 05:15:38 +0000 |
36 | +++ examples/camera.c 2017-01-06 19:13:38 +0000 |
37 | @@ -397,6 +397,12 @@ |
38 | return 0; |
39 | } |
40 | |
41 | + State state = |
42 | + { |
43 | + PTHREAD_MUTEX_INITIALIZER, |
44 | + true |
45 | + }; |
46 | + |
47 | MirSurface* surface = mir_eglapp_native_surface(); |
48 | if (win_width == 1) /* Fullscreen was not chosen */ |
49 | { |
50 | @@ -408,6 +414,7 @@ |
51 | win_height = cam->pix.height; |
52 | mir_surface_spec_set_width(changes, win_width); |
53 | mir_surface_spec_set_height(changes, win_height); |
54 | + mir_surface_spec_set_event_handler(changes, on_event, &state); |
55 | mir_surface_apply_spec(surface, changes); |
56 | mir_surface_spec_release(changes); |
57 | } |
58 | @@ -465,13 +472,6 @@ |
59 | glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
60 | glViewport(0, 0, win_width, win_height); |
61 | |
62 | - State state = |
63 | - { |
64 | - PTHREAD_MUTEX_INITIALIZER, |
65 | - true |
66 | - }; |
67 | - mir_surface_set_event_handler(surface, on_event, &state); |
68 | - |
69 | bool first_frame = true; |
70 | while (mir_eglapp_running()) |
71 | { |
72 | @@ -563,7 +563,10 @@ |
73 | mir_eglapp_swap_buffers(); |
74 | } |
75 | |
76 | - mir_surface_set_event_handler(surface, NULL, NULL); |
77 | + MirSurfaceSpec* spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
78 | + mir_surface_spec_set_event_handler(spec, NULL, NULL); |
79 | + mir_surface_apply_spec(surface, spec); |
80 | + mir_surface_spec_release(spec); |
81 | mir_eglapp_cleanup(); |
82 | close_camera(cam); |
83 | |
84 | |
85 | === modified file 'examples/client_touch_validator.cpp' |
86 | --- examples/client_touch_validator.cpp 2016-10-21 07:53:23 +0000 |
87 | +++ examples/client_touch_validator.cpp 2017-01-06 19:13:38 +0000 |
88 | @@ -168,7 +168,10 @@ |
89 | TouchState state; |
90 | |
91 | MirSurface *surface = mir_eglapp_native_surface(); |
92 | - mir_surface_set_event_handler(surface, on_event, &state); |
93 | + MirSurfaceSpec *spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
94 | + mir_surface_spec_set_event_handler(spec, on_event, &state); |
95 | + mir_surface_apply_spec(surface, spec); |
96 | + mir_surface_spec_release(spec); |
97 | |
98 | float const opacity = mir_eglapp_background_opacity; |
99 | Color red = {opacity, 0.0f, 0.0f, opacity}; |
100 | |
101 | === modified file 'examples/demo_client_display_config.c' |
102 | --- examples/demo_client_display_config.c 2016-10-21 07:53:23 +0000 |
103 | +++ examples/demo_client_display_config.c 2017-01-06 19:13:38 +0000 |
104 | @@ -368,7 +368,10 @@ |
105 | mir_connection_set_display_config_change_callback( |
106 | connection, display_change_callback, &ctx); |
107 | |
108 | - mir_surface_set_event_handler(surface, event_callback, &ctx); |
109 | + MirSurfaceSpec *spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
110 | + mir_surface_spec_set_event_handler(spec, event_callback, &ctx); |
111 | + mir_surface_apply_spec(surface, spec); |
112 | + mir_surface_spec_release(spec); |
113 | |
114 | time_t start = time(NULL); |
115 | |
116 | |
117 | === modified file 'examples/eglapp.c' |
118 | --- examples/eglapp.c 2016-12-09 02:54:31 +0000 |
119 | +++ examples/eglapp.c 2017-01-06 19:13:38 +0000 |
120 | @@ -484,13 +484,13 @@ |
121 | if (output_id != mir_display_output_id_invalid) |
122 | mir_surface_spec_set_fullscreen_on_output(spec, output_id); |
123 | |
124 | + mir_surface_spec_set_event_handler(spec, mir_eglapp_handle_event, NULL); |
125 | + |
126 | surface = mir_surface_create_sync(spec); |
127 | mir_surface_spec_release(spec); |
128 | |
129 | CHECK(mir_surface_is_valid(surface), "Can't create a surface"); |
130 | |
131 | - mir_surface_set_event_handler(surface, mir_eglapp_handle_event, NULL); |
132 | - |
133 | spec = mir_connection_create_spec_for_changes(connection); |
134 | mir_surface_spec_set_cursor_name(spec, cursor_name); |
135 | mir_surface_apply_spec(surface, spec); |
136 | @@ -498,7 +498,7 @@ |
137 | |
138 | eglsurface = eglCreateWindowSurface(egldisplay, eglconfig, |
139 | (EGLNativeWindowType)mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(surface)), NULL); |
140 | - |
141 | + |
142 | CHECK(eglsurface != EGL_NO_SURFACE, "eglCreateWindowSurface failed"); |
143 | |
144 | eglctx = eglCreateContext(egldisplay, eglconfig, EGL_NO_CONTEXT, |
145 | |
146 | === modified file 'examples/eglsquare.cpp' |
147 | --- examples/eglsquare.cpp 2015-05-29 12:53:18 +0000 |
148 | +++ examples/eglsquare.cpp 2017-01-06 19:13:38 +0000 |
149 | @@ -109,7 +109,10 @@ |
150 | context{connection, surface, swap_interval}, |
151 | program{context, dimensions.width, dimensions.height} |
152 | { |
153 | - mir_surface_set_event_handler(surface, &on_event, this); |
154 | + MirSurfaceSpec* spec = mir_connection_create_spec_for_changes(connection); |
155 | + mir_surface_spec_set_event_handler(spec, &on_event, this); |
156 | + mir_surface_apply_spec(surface, spec); |
157 | + mir_surface_spec_release(spec); |
158 | } |
159 | |
160 | void on_event(MirEvent const* ev) |
161 | |
162 | === modified file 'examples/fingerpaint.c' |
163 | --- examples/fingerpaint.c 2016-01-29 08:18:22 +0000 |
164 | +++ examples/fingerpaint.c 2017-01-06 19:13:38 +0000 |
165 | @@ -468,6 +468,7 @@ |
166 | MirSurfaceSpec *spec = mir_connection_create_spec_for_normal_surface(conn, width, height, pixel_format); |
167 | mir_surface_spec_set_name(spec, "Mir Fingerpaint"); |
168 | mir_surface_spec_set_buffer_usage(spec, mir_buffer_usage_software); |
169 | + mir_surface_spec_set_event_handler(spec, &on_event, &canvas); |
170 | |
171 | surf = mir_surface_create_sync(spec); |
172 | mir_surface_spec_release(spec); |
173 | @@ -475,8 +476,7 @@ |
174 | if (surf != NULL) |
175 | { |
176 | mir_surface_set_swapinterval(surf, swap_interval); |
177 | - mir_surface_set_event_handler(surf, &on_event, &canvas); |
178 | - |
179 | + |
180 | canvas.width = width; |
181 | canvas.height = height; |
182 | canvas.stride = canvas.width * BYTES_PER_PIXEL(pixel_format); |
183 | @@ -488,9 +488,9 @@ |
184 | signal(SIGINT, shutdown); |
185 | signal(SIGTERM, shutdown); |
186 | signal(SIGHUP, shutdown); |
187 | - |
188 | + |
189 | clear_region(&canvas, &background); |
190 | - |
191 | + |
192 | MirBufferStream *bs = mir_surface_get_buffer_stream(surf); |
193 | |
194 | while (running) |
195 | @@ -509,7 +509,10 @@ |
196 | } |
197 | |
198 | /* Ensure canvas won't be used after it's freed */ |
199 | - mir_surface_set_event_handler(surf, NULL, NULL); |
200 | + MirSurfaceSpec* spec = mir_connection_create_spec_for_changes(conn); |
201 | + mir_surface_spec_set_event_handler(spec, NULL, NULL); |
202 | + mir_surface_apply_spec(surf, spec); |
203 | + mir_surface_spec_release(spec); |
204 | free(canvas.vaddr); |
205 | } |
206 | else |
207 | |
208 | === modified file 'examples/pointer_confinement.c' |
209 | --- examples/pointer_confinement.c 2016-12-09 02:54:31 +0000 |
210 | +++ examples/pointer_confinement.c 2017-01-06 19:13:38 +0000 |
211 | @@ -214,10 +214,10 @@ |
212 | glUseProgram(prog); |
213 | |
214 | MirSurface* surface = mir_eglapp_native_surface(); |
215 | - mir_surface_set_event_handler(surface, handle_event, NULL); |
216 | |
217 | spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
218 | mir_surface_spec_set_pointer_confinement(spec, mir_pointer_confined_to_surface); |
219 | + mir_surface_spec_set_event_handler(spec, handle_event, NULL); |
220 | |
221 | mir_surface_apply_spec(surface, spec); |
222 | mir_surface_spec_release(spec); |
223 | |
224 | === modified file 'examples/target.c' |
225 | --- examples/target.c 2016-10-21 07:53:23 +0000 |
226 | +++ examples/target.c 2017-01-06 19:13:38 +0000 |
227 | @@ -352,7 +352,10 @@ |
228 | } |
229 | |
230 | MirSurface *surface = mir_eglapp_native_surface(); |
231 | - mir_surface_set_event_handler(surface, on_event, &state); |
232 | + MirSurfaceSpec *spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
233 | + mir_surface_spec_set_event_handler(spec, on_event, &state); |
234 | + mir_surface_apply_spec(surface, spec); |
235 | + mir_surface_spec_release(spec); |
236 | |
237 | while (true) |
238 | { |
239 | @@ -421,7 +424,10 @@ |
240 | mir_eglapp_swap_buffers(); |
241 | } |
242 | |
243 | - mir_surface_set_event_handler(surface, NULL, NULL); |
244 | + spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
245 | + mir_surface_spec_set_event_handler(spec, NULL, NULL); |
246 | + mir_surface_apply_spec(surface, spec); |
247 | + mir_surface_spec_release(spec); |
248 | mir_eglapp_cleanup(); |
249 | |
250 | pthread_join(shutdown_handler_thread, NULL); |
251 | |
252 | === modified file 'include/client/mir_toolkit/mir_surface.h' |
253 | --- include/client/mir_toolkit/mir_surface.h 2016-12-09 02:54:31 +0000 |
254 | +++ include/client/mir_toolkit/mir_surface.h 2017-01-06 19:13:38 +0000 |
255 | @@ -607,6 +607,9 @@ |
256 | |
257 | /** |
258 | * Set the event handler to be called when events arrive for a surface. |
259 | + * |
260 | + * \deprecated Use mir_surface_spec_set_event_handler instead. |
261 | + * |
262 | * \warning event_handler could be called from another thread. You must do |
263 | * any locking appropriate to protect your data accessed in the |
264 | * callback. There is also a chance that different events will be |
265 | @@ -616,6 +619,7 @@ |
266 | * \param [in] callback The callback function |
267 | * \param [in] context Additional argument to be passed to callback |
268 | */ |
269 | +__attribute__ ((deprecated)) |
270 | void mir_surface_set_event_handler(MirSurface *surface, |
271 | mir_surface_event_callback callback, |
272 | void* context); |
273 | |
274 | === modified file 'src/client/mir_surface.cpp' |
275 | --- src/client/mir_surface.cpp 2016-12-23 07:58:44 +0000 |
276 | +++ src/client/mir_surface.cpp 2017-01-06 19:13:38 +0000 |
277 | @@ -654,6 +654,13 @@ |
278 | surface_specification->set_hotspot_y(rs_cursor.hotspot.y.as_int()); |
279 | } |
280 | |
281 | + if (spec.event_handler.is_set()) |
282 | + { |
283 | + set_event_handler( |
284 | + spec.event_handler.value().callback, |
285 | + spec.event_handler.value().context); |
286 | + } |
287 | + |
288 | modify_wait_handle.expect_result(); |
289 | server->modify_surface(&mods, modify_result.get(), |
290 | google::protobuf::NewCallback(this, &MirSurface::on_modified)); |
291 | |
292 | === modified file 'src/server/graphics/nested/mir_client_host_connection.cpp' |
293 | --- src/server/graphics/nested/mir_client_host_connection.cpp 2016-12-21 04:39:38 +0000 |
294 | +++ src/server/graphics/nested/mir_client_host_connection.cpp 2017-01-06 19:13:38 +0000 |
295 | @@ -139,7 +139,10 @@ |
296 | |
297 | void set_event_handler(mir_surface_event_callback cb, void* context) override |
298 | { |
299 | - mir_surface_set_event_handler(mir_surface, cb, context); |
300 | + auto spec = mir_connection_create_spec_for_changes(mir_connection); |
301 | + mir_surface_spec_set_event_handler(spec, cb, context); |
302 | + mir_surface_apply_spec(mir_surface, spec); |
303 | + mir_surface_spec_release(spec); |
304 | } |
305 | |
306 | void set_cursor_image(mg::CursorImage const& image) |
307 | |
308 | === modified file 'src/utils/vanity.c' |
309 | --- src/utils/vanity.c 2016-11-07 02:53:07 +0000 |
310 | +++ src/utils/vanity.c 2017-01-06 19:13:38 +0000 |
311 | @@ -752,7 +752,10 @@ |
312 | false |
313 | }; |
314 | MirSurface* surface = mir_eglapp_native_surface(); |
315 | - mir_surface_set_event_handler(surface, on_event, &state); |
316 | + MirSurfaceSpec* spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
317 | + mir_surface_spec_set_event_handler(spec, on_event, &state); |
318 | + mir_surface_apply_spec(surface, spec); |
319 | + mir_surface_spec_release(spec); |
320 | |
321 | GLint tint = glGetUniformLocation(prog, "tint"); |
322 | |
323 | @@ -891,7 +894,10 @@ |
324 | last_swap_time = swap_time; |
325 | } |
326 | |
327 | - mir_surface_set_event_handler(surface, NULL, NULL); |
328 | + spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection()); |
329 | + mir_surface_spec_set_event_handler(spec, NULL, NULL); |
330 | + mir_surface_apply_spec(surface, spec); |
331 | + mir_surface_spec_release(spec); |
332 | mir_eglapp_cleanup(); |
333 | |
334 | pthread_join(capture_thread, NULL); |
335 | |
336 | === modified file 'tests/acceptance-tests/test_client_input.cpp' |
337 | --- tests/acceptance-tests/test_client_input.cpp 2016-12-20 15:01:43 +0000 |
338 | +++ tests/acceptance-tests/test_client_input.cpp 2017-01-06 19:13:38 +0000 |
339 | @@ -102,8 +102,10 @@ |
340 | if (!mir_surface_is_valid(surface)) |
341 | BOOST_THROW_EXCEPTION(std::runtime_error{std::string{"Failed creating a surface: "}+ |
342 | mir_surface_get_error_message(surface)}); |
343 | - |
344 | +#pragma GCC diagnostic push |
345 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
346 | mir_surface_set_event_handler(surface, handle_event, this); |
347 | +#pragma GCC diagnostic pop |
348 | mir_buffer_stream_swap_buffers_sync( |
349 | mir_surface_get_buffer_stream(surface)); |
350 | |
351 | @@ -149,7 +151,10 @@ |
352 | // Remove the event handler to avoid handling spurious events unrelated |
353 | // to the tests (e.g. pointer leave events when the surface is destroyed), |
354 | // which can cause test expectations to fail. |
355 | +#pragma GCC diagnostic push |
356 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
357 | mir_surface_set_event_handler(surface, null_event_handler, nullptr); |
358 | +#pragma GCC diagnostic pop |
359 | mir_surface_release_sync(surface); |
360 | mir_connection_release(connection); |
361 | } |
362 | |
363 | === modified file 'tests/acceptance-tests/test_client_library.cpp' |
364 | --- tests/acceptance-tests/test_client_library.cpp 2016-12-17 00:52:45 +0000 |
365 | +++ tests/acceptance-tests/test_client_library.cpp 2017-01-06 19:13:38 +0000 |
366 | @@ -938,8 +938,11 @@ |
367 | * |
368 | * Without manual dispatch, it's racy to try and test that. |
369 | */ |
370 | +#pragma GCC diagnostic push |
371 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
372 | mir_surface_set_event_handler(surface, &dummy_event_handler_one, nullptr); |
373 | mir_surface_set_event_handler(surface, &dummy_event_handler_two, nullptr); |
374 | +#pragma GCC diagnostic pop |
375 | |
376 | mir_surface_release_sync(surface); |
377 | mir_connection_release(connection); |
378 | |
379 | === modified file 'tests/acceptance-tests/test_client_surface_events.cpp' |
380 | --- tests/acceptance-tests/test_client_surface_events.cpp 2016-12-09 02:54:31 +0000 |
381 | +++ tests/acceptance-tests/test_client_surface_events.cpp 2017-01-06 19:13:38 +0000 |
382 | @@ -128,12 +128,15 @@ |
383 | |
384 | mtf::ConnectedClientWithASurface::SetUp(); |
385 | |
386 | +#pragma GCC diagnostic push |
387 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
388 | mir_surface_set_event_handler(surface, &event_callback, this); |
389 | |
390 | scene_surface = the_latest_surface(); |
391 | |
392 | other_surface = mtf::make_any_surface(connection); |
393 | mir_surface_set_event_handler(other_surface, nullptr, nullptr); |
394 | +#pragma GCC diagnostic pop |
395 | |
396 | reset_last_event(); |
397 | } |
398 | @@ -306,7 +309,10 @@ |
399 | { |
400 | set_event_filter(mir_event_type_close_surface); |
401 | |
402 | +#pragma GCC diagnostic push |
403 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
404 | mir_surface_set_event_handler(surface, nullptr, nullptr); |
405 | +#pragma GCC diagnostic pop |
406 | scene_surface->request_client_surface_close(); |
407 | |
408 | EXPECT_FALSE(wait_for_event(std::chrono::seconds(1))); |
409 | @@ -348,6 +354,8 @@ |
410 | auto surface = mtf::make_any_surface(connection); |
411 | |
412 | mt::Signal focus_received; |
413 | +#pragma GCC diagnostic push |
414 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
415 | mir_surface_set_event_handler( |
416 | surface, |
417 | [](MirSurface*, MirEvent const* event, void* ctx) |
418 | @@ -378,6 +386,7 @@ |
419 | } |
420 | }, |
421 | &unfocus_received); |
422 | +#pragma GCC diagnostic pop |
423 | |
424 | mir_surface_release_sync(surface); |
425 | |
426 | @@ -392,6 +401,8 @@ |
427 | auto surface = mtf::make_any_surface(connection); |
428 | |
429 | mt::Signal focus_received; |
430 | +#pragma GCC diagnostic push |
431 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
432 | mir_surface_set_event_handler( |
433 | surface, |
434 | [](MirSurface*, MirEvent const* event, void* ctx) |
435 | @@ -422,6 +433,7 @@ |
436 | } |
437 | }, |
438 | &unfocus_received); |
439 | +#pragma GCC diagnostic pop |
440 | |
441 | // Add a new surface that will take focus. |
442 | auto focus_grabbing_surface = mtf::make_any_surface(connection); |
443 | |
444 | === modified file 'tests/acceptance-tests/test_client_surface_visibility.cpp' |
445 | --- tests/acceptance-tests/test_client_surface_visibility.cpp 2016-08-11 07:24:14 +0000 |
446 | +++ tests/acceptance-tests/test_client_surface_visibility.cpp 2017-01-06 19:13:38 +0000 |
447 | @@ -126,7 +126,10 @@ |
448 | |
449 | ~Surface() |
450 | { |
451 | +#pragma GCC diagnostic push |
452 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
453 | mir_surface_set_event_handler(surface, null_event_callback, nullptr); |
454 | +#pragma GCC diagnostic pop |
455 | mir_surface_release_sync(surface); |
456 | } |
457 | |
458 | |
459 | === modified file 'tests/acceptance-tests/test_confined_pointer.cpp' |
460 | --- tests/acceptance-tests/test_confined_pointer.cpp 2017-01-04 04:40:09 +0000 |
461 | +++ tests/acceptance-tests/test_confined_pointer.cpp 2017-01-06 19:13:38 +0000 |
462 | @@ -89,7 +89,10 @@ |
463 | mir_surface_get_error_message(surface)}); |
464 | } |
465 | |
466 | +#pragma GCC diagnostic push |
467 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
468 | mir_surface_set_event_handler(surface, handle_event, this); |
469 | +#pragma GCC diagnostic pop |
470 | mir_buffer_stream_swap_buffers_sync( |
471 | mir_surface_get_buffer_stream(surface)); |
472 | |
473 | @@ -148,7 +151,10 @@ |
474 | // Remove the event handler to avoid handling spurious events unrelated |
475 | // to the tests (e.g. pointer leave events when the surface is destroyed), |
476 | // which can cause test expectations to fail. |
477 | +#pragma GCC diagnostic push |
478 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
479 | mir_surface_set_event_handler(surface, null_event_handler, nullptr); |
480 | +#pragma GCC diagnostic pop |
481 | mir_surface_release_sync(surface); |
482 | mir_connection_release(connection); |
483 | } |
484 | |
485 | === modified file 'tests/acceptance-tests/test_nested_input.cpp' |
486 | --- tests/acceptance-tests/test_nested_input.cpp 2016-12-09 02:54:31 +0000 |
487 | +++ tests/acceptance-tests/test_nested_input.cpp 2017-01-06 19:13:38 +0000 |
488 | @@ -133,7 +133,10 @@ |
489 | // Ensure the nested server posts a frame |
490 | connection = mir_connect_sync(connect_string.c_str(), __PRETTY_FUNCTION__); |
491 | surface = mtf::make_any_surface(connection); |
492 | +#pragma GCC diagnostic push |
493 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
494 | mir_surface_set_event_handler(surface, handle_event, this); |
495 | +#pragma GCC diagnostic pop |
496 | mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); |
497 | } |
498 | |
499 | @@ -173,7 +176,10 @@ |
500 | static void null_event_handler(MirSurface*, MirEvent const*, void*) {}; |
501 | ~ExposedSurface() |
502 | { |
503 | +#pragma GCC diagnostic push |
504 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
505 | mir_surface_set_event_handler(surface, null_event_handler, nullptr); |
506 | +#pragma GCC diagnostic pop |
507 | mir_surface_release_sync(surface); |
508 | mir_connection_release(connection); |
509 | } |
510 | |
511 | === modified file 'tests/acceptance-tests/test_nested_mir.cpp' |
512 | --- tests/acceptance-tests/test_nested_mir.cpp 2016-12-16 00:09:49 +0000 |
513 | +++ tests/acceptance-tests/test_nested_mir.cpp 2017-01-06 19:13:38 +0000 |
514 | @@ -420,7 +420,10 @@ |
515 | |
516 | void wait_until_surface_ready(MirSurface* surface) |
517 | { |
518 | +#pragma GCC diagnostic push |
519 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
520 | mir_surface_set_event_handler(surface, wait_for_key_a_event, this); |
521 | +#pragma GCC diagnostic pop |
522 | |
523 | auto const dummy_events_received = mt::spin_wait_for_condition_or_timeout( |
524 | [this] |
525 | @@ -436,7 +439,10 @@ |
526 | |
527 | EXPECT_TRUE(dummy_events_received); |
528 | |
529 | +#pragma GCC diagnostic push |
530 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
531 | mir_surface_set_event_handler(surface, nullptr, nullptr); |
532 | +#pragma GCC diagnostic pop |
533 | } |
534 | |
535 | protected: |
536 | |
537 | === modified file 'tests/acceptance-tests/test_surface_raise.cpp' |
538 | --- tests/acceptance-tests/test_surface_raise.cpp 2016-12-09 02:54:31 +0000 |
539 | +++ tests/acceptance-tests/test_surface_raise.cpp 2017-01-06 19:13:38 +0000 |
540 | @@ -52,23 +52,28 @@ |
541 | { |
542 | ConnectedClientHeadlessServer::SetUp(); |
543 | |
544 | - surface1 = mtf::make_any_surface(connection); |
545 | + surface1 = mtf::make_any_surface(connection); |
546 | +#pragma GCC diagnostic push |
547 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
548 | mir_surface_set_event_handler(surface1, &cookie_capturing_callback, this); |
549 | +#pragma GCC diagnostic pop |
550 | mir_buffer_stream_swap_buffers_sync( |
551 | mir_surface_get_buffer_stream(surface1)); |
552 | |
553 | surface2 = mtf::make_any_surface(connection); |
554 | - mir_surface_set_event_handler(surface2, &cookie_capturing_callback, this); |
555 | - mir_buffer_stream_swap_buffers_sync( |
556 | - mir_surface_get_buffer_stream(surface2)); |
557 | |
558 | // Need fullscreen for the cursor events |
559 | auto const spec = mir_connection_create_spec_for_changes(connection); |
560 | mir_surface_spec_set_fullscreen_on_output(spec, 1); |
561 | mir_surface_apply_spec(surface1, spec); |
562 | + |
563 | + mir_surface_spec_set_event_handler(spec, &cookie_capturing_callback, this); |
564 | mir_surface_apply_spec(surface2, spec); |
565 | mir_surface_spec_release(spec); |
566 | - |
567 | + |
568 | + mir_buffer_stream_swap_buffers_sync( |
569 | + mir_surface_get_buffer_stream(surface2)); |
570 | + |
571 | bool surface_fullscreen = mt::spin_wait_for_condition_or_timeout( |
572 | [this] |
573 | { |
574 | |
575 | === modified file 'tests/acceptance-tests/test_system_compositor_window_manager.cpp' |
576 | --- tests/acceptance-tests/test_system_compositor_window_manager.cpp 2016-06-08 13:49:11 +0000 |
577 | +++ tests/acceptance-tests/test_system_compositor_window_manager.cpp 2017-01-06 19:13:38 +0000 |
578 | @@ -81,7 +81,10 @@ |
579 | auto const surface = mir_surface_create_sync(spec); |
580 | mir_surface_spec_release(spec); |
581 | |
582 | +#pragma GCC diagnostic push |
583 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
584 | mir_surface_set_event_handler(surface, on_surface_event, this); |
585 | +#pragma GCC diagnostic pop |
586 | |
587 | return SurfaceHandle{surface}; |
588 | }; |
589 | |
590 | === modified file 'tests/privileged-tests/test_input_events.cpp' |
591 | --- tests/privileged-tests/test_input_events.cpp 2016-11-09 02:30:14 +0000 |
592 | +++ tests/privileged-tests/test_input_events.cpp 2017-01-06 19:13:38 +0000 |
593 | @@ -213,7 +213,10 @@ |
594 | if (!mir_surface_is_valid(surface)) |
595 | throw std::runtime_error("Failed to create MirSurface"); |
596 | |
597 | +#pragma GCC diagnostic push |
598 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
599 | mir_surface_set_event_handler(surface, handle_input, handler); |
600 | +#pragma GCC diagnostic pop |
601 | mir_buffer_stream_swap_buffers_sync( |
602 | mir_surface_get_buffer_stream(surface)); |
603 |