Mir

Merge lp:~mir-team/mir/zesty-0.26 into lp:mir/zesty

Proposed by Michał Sawicz
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1302
Proposed branch: lp:~mir-team/mir/zesty-0.26
Merge into: lp:mir/zesty
Diff against target: 2049 lines (+423/-227)
37 files modified
CMakeLists.txt (+1/-1)
debian/changelog (+20/-0)
include/client/mir/event_printer.h (+5/-5)
include/client/mir/events/event_builders.h (+10/-10)
include/client/mir_toolkit/client_types.h (+22/-25)
include/client/mir_toolkit/debug/surface.h (+4/-3)
include/client/mir_toolkit/events/event.h (+11/-10)
include/client/mir_toolkit/events/input_configuration_event.h (+8/-4)
include/client/mir_toolkit/events/keymap_event.h (+1/-1)
include/client/mir_toolkit/events/surface_event.h (+3/-2)
include/client/mir_toolkit/events/surface_output_event.h (+6/-5)
include/client/mir_toolkit/events/surface_placement.h (+2/-1)
include/client/mir_toolkit/mir_blob.h (+3/-2)
include/client/mir_toolkit/mir_buffer_stream.h (+3/-1)
include/client/mir_toolkit/mir_connection.h (+9/-8)
include/client/mir_toolkit/mir_cursor_configuration.h (+2/-1)
include/client/mir_toolkit/mir_display_configuration.h (+3/-2)
include/client/mir_toolkit/mir_persistent_id.h (+5/-4)
include/client/mir_toolkit/mir_platform_message.h (+8/-7)
include/client/mir_toolkit/mir_screencast.h (+2/-1)
include/client/mir_toolkit/mir_surface.h (+61/-60)
include/client/mir_toolkit/mir_wait.h (+3/-2)
include/client/mir_toolkit/mir_window.h (+4/-3)
include/client/mir_toolkit/rs/mir_render_surface.h (+47/-11)
include/core/mir_toolkit/common.h (+8/-6)
include/core/mir_toolkit/deprecations.h (+36/-0)
src/common/events/input_configuration_event.cpp (+1/-3)
src/include/common/mir/events/input_configuration_event.h (+1/-2)
src/platforms/android/utils/CMakeLists.txt (+1/-0)
src/platforms/mesa/server/kms/kms_page_flipper.cpp (+6/-6)
src/server/input/default_configuration.cpp (+6/-2)
src/server/input/default_device.cpp (+56/-25)
src/server/input/default_device.h (+4/-1)
src/server/input/default_input_device_hub.cpp (+15/-9)
src/server/input/default_input_device_hub.h (+5/-4)
tests/unit-tests/input/test_default_device.cpp (+23/-0)
tests/unit-tests/input/test_default_input_device_hub.cpp (+18/-0)
To merge this branch: bzr merge lp:~mir-team/mir/zesty-0.26
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Review via email: mp+325068@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTMa

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2017-02-17 02:24:03 +0000
3+++ CMakeLists.txt 2017-06-05 10:39:04 +0000
4@@ -29,7 +29,7 @@
5
6 set(MIR_VERSION_MAJOR 0)
7 set(MIR_VERSION_MINOR 26)
8-set(MIR_VERSION_PATCH 2)
9+set(MIR_VERSION_PATCH 3)
10
11 add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
12 add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2017-04-12 21:43:04 +0000
16+++ debian/changelog 2017-06-05 10:39:04 +0000
17@@ -1,3 +1,23 @@
18+mir (0.26.3) UNRELEASED; urgency=medium
19+
20+ [ Daniel van Vugt ]
21+ * New upstream release 0.26.3 (https://launchpad.net/mir/+milestone/0.26.3)
22+ - Enhancements:
23+ . Make deprecations optional (and default to off for builds on 16.04 LTS)
24+ . Added support for building on Ubuntu 17.10 artful.
25+ - Bugs fixed:
26+ . Mir needs to be updated to 0.26 in 16.04LTS (LP: #1685186)
27+ . unity-system-compositor crashed with SIGSEGV in
28+ libinput_device_config_accel_is_available() from
29+ libinput_device_config_accel_set_speed() from
30+ mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
31+ . Please transition to Boost 1.62 (LP: #1675138)
32+ . Mir sending key repeat events continually to nested shell after VT
33+ switch (causes Unity8 lockup for a while) (LP: #1675357)
34+ . mir_demo_standalone_render_overlays fails to link (LP: #1677239)
35+
36+ -- Alan Griffiths <alan.griffiths@canonical.com> Fri, 26 May 2017 16:57:20 +0000
37+
38 mir (0.26.2+17.04.20170322.1-0ubuntu2) zesty; urgency=medium
39
40 [ Mattia Rizzolo ]
41
42=== modified file 'include/client/mir/event_printer.h'
43--- include/client/mir/event_printer.h 2017-01-19 05:30:03 +0000
44+++ include/client/mir/event_printer.h 2017-06-05 10:39:04 +0000
45@@ -35,19 +35,19 @@
46 std::ostream& operator<<(std::ostream& out, MirOrientation orientation);
47
48 std::ostream& operator<<(std::ostream& out, MirSurfaceAttrib attribute)
49-__attribute__ ((deprecated("use << with MirWindowAttrib instead")));
50+MIR_FOR_REMOVAL_IN_VERSION_1("use << with MirWindowAttrib instead");
51 std::ostream& operator<<(std::ostream& out, MirWindowAttrib attribute);
52 std::ostream& operator<<(std::ostream& out, MirSurfaceFocusState state)
53-__attribute__ ((deprecated("use << with MirWindowFocusState instead")));
54+MIR_FOR_REMOVAL_IN_VERSION_1("use << with MirWindowFocusState instead");
55 std::ostream& operator<<(std::ostream& out, MirWindowFocusState state);
56 std::ostream& operator<<(std::ostream& out, MirSurfaceVisibility state)
57-__attribute__ ((deprecated("use << with MirWindowVisibility instead")));
58+MIR_FOR_REMOVAL_IN_VERSION_1("use << with MirWindowVisibility instead");
59 std::ostream& operator<<(std::ostream& out, MirWindowVisibility state);
60 std::ostream& operator<<(std::ostream& out, MirSurfaceType type)
61-__attribute__ ((deprecated("use << with MirWindowType instead")));
62+MIR_FOR_REMOVAL_IN_VERSION_1("use << with MirWindowType instead");
63 std::ostream& operator<<(std::ostream& out, MirWindowType type);
64 std::ostream& operator<<(std::ostream& out, MirSurfaceState state)
65-__attribute__ ((deprecated("use << with MirWindowState instead")));
66+MIR_FOR_REMOVAL_IN_VERSION_1("use << with MirWindowState instead");
67 std::ostream& operator<<(std::ostream& out, MirWindowState state);
68
69 std::ostream& operator<<(std::ostream& out, MirPromptSessionEvent const& event);
70
71=== modified file 'include/client/mir/events/event_builders.h'
72--- include/client/mir/events/event_builders.h 2017-01-19 05:30:03 +0000
73+++ include/client/mir/events/event_builders.h 2017-06-05 10:39:04 +0000
74@@ -48,7 +48,7 @@
75 EventUPtr make_event(frontend::SurfaceId const& surface_id, geometry::Size const& size);
76 // Surface configure event
77 EventUPtr make_event(frontend::SurfaceId const& surface_id, MirSurfaceAttrib attribute, int value)
78-__attribute__ ((deprecated("use make_event with MirWindowAttribute instead")));
79+MIR_FOR_REMOVAL_IN_VERSION_1("use make_event with MirWindowAttribute instead");
80 // Window configure event
81 EventUPtr make_event(frontend::SurfaceId const& surface_id, MirWindowAttrib attribute, int value);
82 // Close surface event
83@@ -81,12 +81,12 @@
84 // Deprecated version with uint64_t mac
85 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
86 uint64_t mac, MirKeyboardAction action, xkb_keysym_t key_code,
87- int scan_code, MirInputEventModifiers modifiers) __attribute__ ((deprecated));
88+ int scan_code, MirInputEventModifiers modifiers) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
89
90 // Deprecated version without mac
91 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
92 MirKeyboardAction action, xkb_keysym_t key_code,
93- int scan_code, MirInputEventModifiers modifiers) __attribute__ ((deprecated));
94+ int scan_code, MirInputEventModifiers modifiers) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
95
96 // Touch event
97 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
98@@ -94,11 +94,11 @@
99
100 // Deprecated version with uint64_t mac
101 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
102- uint64_t mac, MirInputEventModifiers modifiers) __attribute__ ((deprecated));
103+ uint64_t mac, MirInputEventModifiers modifiers) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
104
105 // Deprecated version without mac
106 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
107- MirInputEventModifiers modifiers) __attribute__ ((deprecated));
108+ MirInputEventModifiers modifiers) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
109
110 void add_touch(MirEvent &event, MirTouchId touch_id, MirTouchAction action,
111 MirTouchTooltype tooltype, float x_axis_value, float y_axis_value,
112@@ -110,14 +110,14 @@
113 uint64_t mac, MirInputEventModifiers modifiers, MirPointerAction action,
114 MirPointerButtons buttons_pressed,
115 float x_axis_value, float y_axis_value,
116- float hscroll_value, float vscroll_value) __attribute__ ((deprecated));
117+ float hscroll_value, float vscroll_value) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
118
119 // Deprecated version without relative axis and mac
120 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
121 MirInputEventModifiers modifiers, MirPointerAction action,
122 MirPointerButtons buttons_pressed,
123 float x_axis_value, float y_axis_value,
124- float hscroll_value, float vscroll_value) __attribute__ ((deprecated));
125+ float hscroll_value, float vscroll_value) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
126
127 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
128 std::vector<uint8_t> const& mac, MirInputEventModifiers modifiers, MirPointerAction action,
129@@ -132,7 +132,7 @@
130 MirPointerButtons buttons_pressed,
131 float x_axis_value, float y_axis_value,
132 float hscroll_value, float vscroll_value,
133- float relative_x_value, float relative_y_value) __attribute__ ((deprecated));
134+ float relative_x_value, float relative_y_value) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
135
136 // Deprecated version without mac
137 EventUPtr make_event(MirInputDeviceId device_id, std::chrono::nanoseconds timestamp,
138@@ -140,11 +140,11 @@
139 MirPointerButtons buttons_pressed,
140 float x_axis_value, float y_axis_value,
141 float hscroll_value, float vscroll_value,
142- float relative_x_value, float relative_y_value) __attribute__ ((deprecated));
143+ float relative_x_value, float relative_y_value) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
144
145 // Input configuration event
146 EventUPtr make_event(MirInputConfigurationAction action,
147- MirInputDeviceId id, std::chrono::nanoseconds time) __attribute__((deprecated));
148+ MirInputDeviceId id, std::chrono::nanoseconds time) MIR_FOR_REMOVAL_IN_VERSION_1("unused");
149
150 EventUPtr make_event(std::chrono::nanoseconds timestamp,
151 MirPointerButtons pointer_buttons,
152
153=== modified file 'include/client/mir_toolkit/client_types.h'
154--- include/client/mir_toolkit/client_types.h 2017-03-16 16:47:21 +0000
155+++ include/client/mir_toolkit/client_types.h 2017-06-05 10:39:04 +0000
156@@ -23,6 +23,7 @@
157
158 #include <mir_toolkit/events/event.h>
159 #include <mir_toolkit/common.h>
160+#include <mir_toolkit/deprecations.h>
161
162 #include <stddef.h>
163
164@@ -38,23 +39,22 @@
165 typedef void* MirEGLNativeWindowType;
166 typedef void* MirEGLNativeDisplayType;
167 typedef struct MirConnection MirConnection;
168-typedef struct MirSurface MirSurface __attribute__((deprecated("Use MirWindow instead")));
169+typedef struct MirSurface MirSurface MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindow instead");
170 typedef struct MirSurface MirWindow;
171-typedef struct MirSurfaceSpec MirSurfaceSpec __attribute__((deprecated("Use MirWindowSpec instead")));
172+typedef struct MirSurfaceSpec MirSurfaceSpec MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowSpec instead");
173 typedef struct MirSurfaceSpec MirWindowSpec;
174 typedef struct MirScreencast MirScreencast;
175 typedef struct MirScreencastSpec MirScreencastSpec;
176 typedef struct MirPromptSession MirPromptSession;
177 typedef struct MirBufferStream MirBufferStream;
178-typedef struct MirPersistentId MirPersistentId __attribute((deprecated("Use MirWindowId instead")));
179+typedef struct MirPersistentId MirPersistentId MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowId instead");
180 typedef struct MirPersistentId MirWindowId;
181 typedef struct MirBlob MirBlob;
182 typedef struct MirDisplayConfig MirDisplayConfig;
183 typedef struct MirError MirError;
184 typedef struct MirPresentationChain MirPresentationChain;
185 typedef struct MirBuffer MirBuffer;
186-typedef struct MirRenderSurface MirRenderSurface
187-__attribute__((deprecated("This type is slated for rename due to MirRenderSurface-->MirSurface transition")));
188+typedef struct MirRenderSurface MirRenderSurface;
189
190 /**
191 * Descriptor for an output connection.
192@@ -82,7 +82,7 @@
193 typedef void (*MirConnectedCallback)(
194 MirConnection *connection, void *client_context);
195 typedef MirConnectedCallback mir_connected_callback
196- __attribute__((deprecated("Use MirConnectedCallback instead")));
197+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnectedCallback instead");
198
199 /**
200 * Callback to be passed when calling window functions :
201@@ -102,7 +102,7 @@
202 typedef void (*MirBufferStreamCallback)(
203 MirBufferStream *stream, void *client_context);
204 typedef MirBufferStreamCallback mir_buffer_stream_callback
205- __attribute__((deprecated("Use MirBufferStreamCallback instead")));
206+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirBufferStreamCallback instead");
207
208 /**
209 * Callback for handling of window events.
210@@ -124,7 +124,7 @@
211 typedef void (*MirLifecycleEventCallback)(
212 MirConnection* connection, MirLifecycleState state, void* context);
213 typedef MirLifecycleEventCallback mir_lifecycle_event_callback
214- __attribute__((deprecated("Use MirLifecycleEventCallback instead")));
215+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirLifecycleEventCallback instead");
216
217 /**
218 * Callback called when the server pings for responsiveness testing.
219@@ -136,7 +136,7 @@
220 typedef void (*MirPingEventCallback)(
221 MirConnection* connection, int32_t serial, void* context);
222 typedef MirPingEventCallback mir_ping_event_callback
223- __attribute__((deprecated("Use MirPingEventCallback instead")));
224+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPingEventCallback instead");
225
226 /**
227 * Callback called when a display config change has occurred
228@@ -147,7 +147,7 @@
229 typedef void (*MirDisplayConfigCallback)(
230 MirConnection* connection, void* context);
231 typedef MirDisplayConfigCallback mir_display_config_callback
232- __attribute__((deprecated("Use MirDisplayConfigCallback instead")));
233+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirDisplayConfigCallback instead");
234
235 /**
236 * Callback called when a request for client file descriptors completes
237@@ -162,7 +162,7 @@
238 typedef void (*MirClientFdCallback)(
239 MirPromptSession *prompt_session, size_t count, int const* fds, void* context);
240 typedef MirClientFdCallback mir_client_fd_callback
241- __attribute__((deprecated("Use MirClientFdCallback instead")));
242+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirClientFdCallback instead");
243
244 #pragma GCC diagnostic push
245 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
246@@ -201,7 +201,7 @@
247 * use the value mir_display_output_id_invalid.
248 */
249 uint32_t output_id;
250-} MirSurfaceParameters __attribute__((deprecated("Use MirWindowParameters instead")));
251+} MirSurfaceParameters MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get apis or listen for attribute events instead");
252
253 enum { mir_platform_package_max = 32 };
254
255@@ -214,7 +214,7 @@
256 * \todo This should be removed from the public API at the next API break.
257 */
258 #ifndef __cplusplus
259-__attribute__ ((deprecated))
260+MIR_FOR_REMOVAL_IN_VERSION_1("Use of this type is inherently non-portable")
261 #endif
262 typedef enum MirPlatformType
263 {
264@@ -429,7 +429,7 @@
265 typedef void (*MirScreencastCallback)(
266 MirScreencast *screencast, void *client_context);
267 typedef MirScreencastCallback mir_screencast_callback
268- __attribute__((deprecated("Use MirScreencastCallback instead")));
269+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirScreencastCallback instead");
270
271 /**
272 * Callback member of MirPromptSession for handling of prompt sessions.
273@@ -439,7 +439,7 @@
274 typedef void (*MirPromptSessionCallback)(
275 MirPromptSession* prompt_provider, void* context);
276 typedef MirPromptSessionCallback mir_prompt_session_callback
277- __attribute__((deprecated("Use MirPromptSessionCallback instead")));
278+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionCallback instead");
279
280 /**
281 * Callback member of MirPromptSession for handling of prompt sessions events.
282@@ -452,7 +452,7 @@
283 void* context);
284 typedef MirPromptSessionStateChangeCallback
285 mir_prompt_session_state_change_callback
286- __attribute__((deprecated("Use MirPromptSessionStateChangeCallback instead")));
287+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionStateChangeCallback instead");
288
289 /**
290 * Callback called when a platform operation completes.
291@@ -467,7 +467,7 @@
292 typedef void (*MirPlatformOperationCallback)(
293 MirConnection* connection, MirPlatformMessage* reply, void* context);
294 typedef MirPlatformOperationCallback mir_platform_operation_callback
295- __attribute__((deprecated("Use MirPlatformOperationCallback instead")));
296+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPlatformOperationCallback instead");
297
298 /**
299 * Callback called when a change of input devices has occurred
300@@ -479,7 +479,7 @@
301 typedef void (*MirInputConfigCallback)(
302 MirConnection* connection, void* context);
303 typedef MirInputConfigCallback mir_input_config_callback
304- __attribute__((deprecated("Use MirInputConfigCallback instead")));
305+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirInputConfigCallback instead");
306
307 typedef void (*MirBufferCallback)(MirBuffer*, void* context);
308
309@@ -539,24 +539,21 @@
310 typedef void (*MirErrorCallback)(
311 MirConnection* connection, MirError const* error, void* context);
312 typedef MirErrorCallback mir_error_callback
313- __attribute__((deprecated("Use MirErrorCallback instead")));
314+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirErrorCallback instead");
315
316 #pragma GCC diagnostic push
317 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
318
319 typedef void (*mir_surface_callback)(MirSurface *surface, void *client_context)
320-__attribute__((deprecated("Use MirWindowCallback instead")));
321+MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowCallback instead");
322
323 typedef void (*mir_surface_event_callback)(
324 MirSurface* surface, MirEvent const* event, void* context)
325-__attribute__((deprecated("Use MirWindowEventCallback instead")));
326+MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowEventCallback instead");
327
328 typedef void (*mir_surface_id_callback)(
329 MirSurface* surface, MirPersistentId* id, void* context)
330-__attribute__((deprecated("Use MirWindowIdCallback instead")));
331-
332-typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
333-__attribute__((deprecated("This type is slated for rename due to MirRenderSurface-->MirSurface transition")));
334+MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
335
336 typedef MirSurfaceParameters MirWindowParameters;
337
338
339=== modified file 'include/client/mir_toolkit/debug/surface.h'
340--- include/client/mir_toolkit/debug/surface.h 2017-01-18 04:43:15 +0000
341+++ include/client/mir_toolkit/debug/surface.h 2017-06-05 10:39:04 +0000
342@@ -19,6 +19,7 @@
343 #define MIR_CLIENT_LIBRARY_DEBUG_H
344
345 #include <mir_toolkit/mir_client_library.h>
346+#include <mir_toolkit/deprecations.h>
347
348 /* This header defines debug interfaces that aren't expected to be generally useful
349 * and do not have the same API-stability guarantees that the main API has */
350@@ -65,13 +66,13 @@
351 bool mir_debug_surface_coords_to_screen(MirSurface *surface,
352 int x, int y,
353 int* screen_x, int* screen_y)
354-__attribute__((deprecated("Use mir_extension_window_coordinate_translation instead")));
355+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_extension_window_coordinate_translation instead");
356
357 int mir_debug_surface_id(MirSurface *surface)
358-__attribute__((deprecated("Use mir_debug_window_id() instead")));
359+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_debug_window_id() instead");
360
361 uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface)
362-__attribute__((deprecated("Use mir_debug_window_current_buffer_id() instead")));
363+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_debug_window_current_buffer_id() instead");
364
365 #pragma GCC diagnostic pop
366
367
368=== modified file 'include/client/mir_toolkit/events/event.h'
369--- include/client/mir_toolkit/events/event.h 2017-01-25 08:12:00 +0000
370+++ include/client/mir_toolkit/events/event.h 2017-06-05 10:39:04 +0000
371@@ -22,6 +22,7 @@
372 #include <stddef.h>
373 #include <stdint.h>
374 #include "mir_toolkit/common.h"
375+#include <mir_toolkit/deprecations.h>
376
377 #ifdef __cplusplus
378 /**
379@@ -58,24 +59,24 @@
380 #pragma GCC diagnostic pop
381
382 typedef struct MirSurfaceEvent MirSurfaceEvent
383- __attribute__ ((deprecated("use MirWindowEvent instead")));
384+ MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowEvent instead");
385 typedef struct MirSurfaceEvent MirWindowEvent;
386 typedef struct MirResizeEvent MirResizeEvent;
387 typedef struct MirPromptSessionEvent MirPromptSessionEvent;
388 typedef struct MirOrientationEvent MirOrientationEvent;
389 typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent
390- __attribute__ ((deprecated("use MirCloseWindowEvent instead")));
391+ MIR_FOR_REMOVAL_IN_VERSION_1("use MirCloseWindowEvent instead");
392 typedef struct MirCloseSurfaceEvent MirCloseWindowEvent;
393 typedef struct MirInputEvent MirInputEvent;
394 typedef struct MirKeymapEvent MirKeymapEvent;
395 typedef struct MirInputConfigurationEvent MirInputConfigurationEvent
396- __attribute__ ((deprecated("Use MirInputDeviceStateEvent and the MirInputConfig callback instead")));
397+ MIR_FOR_REMOVAL_IN_VERSION_1("Use MirInputDeviceStateEvent and the MirInputConfig callback instead");
398 typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent
399- __attribute__ ((deprecated("use MirWindowOutputEvent instead")));
400+ MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowOutputEvent instead");
401 typedef struct MirSurfaceOutputEvent MirWindowOutputEvent;
402 typedef struct MirInputDeviceStateEvent MirInputDeviceStateEvent;
403 typedef struct MirSurfacePlacementEvent MirSurfacePlacementEvent
404- __attribute__ ((deprecated("use MirWindowPlacementEvent instead")));
405+ MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowPlacementEvent instead");
406 typedef struct MirSurfacePlacementEvent MirWindowPlacementEvent;
407
408 typedef struct MirCookie MirCookie;
409@@ -136,7 +137,7 @@
410 * \return The associated MirSurfaceEvent
411 */
412 MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event)
413-__attribute__ ((deprecated("use mir_event_get_window_event instead")));
414+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_event instead");
415
416 /**
417 * Retrieve the MirWindowEvent associated with a MirEvent of
418@@ -195,7 +196,7 @@
419 * \return The associated MirCloseSurfaceEvent
420 */
421 /// @cond
422-__attribute__ ((deprecated))
423+MIR_FOR_REMOVAL_IN_VERSION_1("Use of this function is pointless as there is no way to use the return value")
424 /// @endcond
425 MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* event);
426 #pragma GCC diagnostic pop
427@@ -223,7 +224,7 @@
428 * \return The associated MirInputConfigurationEvent
429 */
430 /// @cond
431-__attribute__((deprecated))
432+MIR_FOR_REMOVAL_IN_VERSION_1("Input devices and changes to the input devices are indicated via the MirInputConfigCallback")
433 /// @endcond
434 MirInputConfigurationEvent const* mir_event_get_input_configuration_event(MirEvent const* event);
435 #pragma GCC diagnostic pop
436@@ -242,7 +243,7 @@
437 * \return The associated MirSurfaceOutputEvent
438 */
439 MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event)
440-__attribute__((deprecated("use mir_event_get_window_output_event")));
441+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_output_event");
442
443 /**
444 * Retrieve the MirWindowOutputEvent associated with a MirEvent of type
445@@ -279,7 +280,7 @@
446 * \return The associated MirSurfacePlacementEvent
447 */
448 MirSurfacePlacementEvent const* mir_event_get_surface_placement_event(MirEvent const* event)
449-__attribute__((deprecated("use mir_event_get_window_placement_event")));
450+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_placement_event");
451
452 /**
453 * Retrieve the MirWindowPlacementEvent associated with a MirEvent of
454
455=== modified file 'include/client/mir_toolkit/events/input_configuration_event.h'
456--- include/client/mir_toolkit/events/input_configuration_event.h 2017-01-20 16:27:50 +0000
457+++ include/client/mir_toolkit/events/input_configuration_event.h 2017-06-05 10:39:04 +0000
458@@ -20,6 +20,7 @@
459 #define MIR_TOOLKIT_EVENTS_INPUT_CONFIGURATION_EVENT_H_
460
461 #include <mir_toolkit/events/event.h>
462+#include <mir_toolkit/deprecations.h>
463
464 #ifdef __cplusplus
465 /**
466@@ -45,7 +46,7 @@
467 mir_input_configuration_action_configuration_changed,
468 mir_input_configuration_action_device_reset
469 } MirInputConfigurationAction
470-__attribute__((deprecated));
471+MIR_FOR_REMOVAL_IN_VERSION_1("Input devices and changes to the input devices are indicated via the MirInputConfigCallback");
472
473 #pragma GCC diagnostic push
474 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
475@@ -55,7 +56,8 @@
476 * \param[in] ev The input configuration event
477 * \return The action
478 */
479-MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev) __attribute__((deprecated));
480+MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev)
481+MIR_FOR_REMOVAL_IN_VERSION_1("Input devices and changes to the input devices are indicated via the MirInputConfigCallback");
482
483 /**
484 * Retreive the time associated with a MirInputConfiguration event
485@@ -63,7 +65,8 @@
486 * \param[in] ev The input configuration event
487 * \return The time in nanoseconds since epoch
488 */
489-int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev) __attribute__((deprecated));
490+int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev)
491+MIR_FOR_REMOVAL_IN_VERSION_1("Input devices and changes to the input devices are indicated via the MirInputConfigCallback");
492
493 /**
494 * Retreive the device id associated with a MirInputConfiguration event
495@@ -71,7 +74,8 @@
496 * \param[in] ev The input configuration event
497 * \return The device id or -1 if not applicable to events of this action
498 */
499-MirInputDeviceId mir_input_configuration_event_get_device_id(MirInputConfigurationEvent const* ev) __attribute__((deprecated));
500+MirInputDeviceId mir_input_configuration_event_get_device_id(MirInputConfigurationEvent const* ev)
501+MIR_FOR_REMOVAL_IN_VERSION_1("Input devices and changes to the input devices are indicated via the MirInputConfigCallback");
502 #pragma GCC diagnostic pop
503
504 #ifdef __cplusplus
505
506=== modified file 'include/client/mir_toolkit/events/keymap_event.h'
507--- include/client/mir_toolkit/events/keymap_event.h 2017-01-18 02:29:37 +0000
508+++ include/client/mir_toolkit/events/keymap_event.h 2017-06-05 10:39:04 +0000
509@@ -42,7 +42,7 @@
510 */
511 void mir_keymap_event_get_rules(MirKeymapEvent const* ev,
512 struct xkb_rule_names* rules)
513- __attribute__ ((deprecated));
514+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_keymap_event_get_keymap_buffer() instead");
515
516 /**
517 * Retrieve the new keymap reported by this MirKeymapEvent
518
519=== modified file 'include/client/mir_toolkit/events/surface_event.h'
520--- include/client/mir_toolkit/events/surface_event.h 2017-01-23 03:38:33 +0000
521+++ include/client/mir_toolkit/events/surface_event.h 2017-06-05 10:39:04 +0000
522@@ -20,6 +20,7 @@
523 #define MIR_TOOLKIT_EVENTS_SURFACE_EVENT_H_
524
525 #include <mir_toolkit/events/event.h>
526+#include <mir_toolkit/deprecations.h>
527
528 #ifdef __cplusplus
529 /**
530@@ -39,7 +40,7 @@
531 * \return The associated attribute
532 */
533 MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* event)
534-__attribute__ ((deprecated("use mir_window_event_get_attribute instead")));
535+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_event_get_attribute instead");
536
537 /**
538 * Retrieve the new value of the associated attribute for a given MirSurfaceEvent
539@@ -48,7 +49,7 @@
540 * \return The associated attribute value
541 */
542 int mir_surface_event_get_attribute_value(MirSurfaceEvent const* event)
543-__attribute__ ((deprecated("use make_event with mir_window_event_get_attribute_value instead")));
544+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_event_get_attribute_value with MirWindowEvent instead");
545 #pragma GCC diagnostic pop
546
547 #ifdef __cplusplus
548
549=== modified file 'include/client/mir_toolkit/events/surface_output_event.h'
550--- include/client/mir_toolkit/events/surface_output_event.h 2017-01-23 03:38:33 +0000
551+++ include/client/mir_toolkit/events/surface_output_event.h 2017-06-05 10:39:04 +0000
552@@ -20,6 +20,7 @@
553 #define MIR_TOOLKIT_SURFACE_OUTPUT_EVENT_H_
554
555 #include <mir_toolkit/events/event.h>
556+#include <mir_toolkit/deprecations.h>
557
558 #ifdef __cplusplus
559 /**
560@@ -39,7 +40,7 @@
561 * \return The new DPI value for the surface is primarily on.
562 */
563 int mir_surface_output_event_get_dpi(MirSurfaceOutputEvent const* ev)
564-__attribute__ ((deprecated("use mir_window_output_event_get_dpi instead")));
565+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_output_event_get_dpi instead");
566
567 /**
568 * Retrieve the form factor of the new output configuration of a MirSurfaceOutputEvent
569@@ -48,7 +49,7 @@
570 * \return The new form factor of the output the surface is primarily on.
571 */
572 MirFormFactor mir_surface_output_event_get_form_factor(MirSurfaceOutputEvent const* ev)
573-__attribute__ ((deprecated("use mir_window_output_event_get_form_factor instead")));
574+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_output_event_get_form_factor instead");
575
576 /**
577 * Retrieve the suggested scaling factor of the new output configuration of a
578@@ -58,7 +59,7 @@
579 * \return The new scaling factor of the output the surface is primarily on.
580 */
581 float mir_surface_output_event_get_scale(MirSurfaceOutputEvent const* ev)
582-__attribute__ ((deprecated("use mir_window_output_event_get_scale instead")));
583+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_output_event_get_scale instead");
584
585 /**
586 * Retrieve the maximum refresh rate of the output(s) associated with a
587@@ -70,7 +71,7 @@
588 * \return The refresh rate in Hz
589 */
590 double mir_surface_output_event_get_refresh_rate(MirSurfaceOutputEvent const* ev)
591-__attribute__ ((deprecated("use mir_window_output_event_get_refresh_rate instead")));
592+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_output_event_get_refresh_rate instead");
593
594 /**
595 * Retrieve the ID of the output this surface is on from a MirSurfaceOutputEvent
596@@ -80,7 +81,7 @@
597 * (From MirDisplayOutput::output_id)
598 */
599 uint32_t mir_surface_output_event_get_output_id(MirSurfaceOutputEvent const *ev)
600-__attribute__ ((deprecated("use mir_window_output_event_get_output_id instead")));
601+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_output_event_get_output_id instead");
602
603 #pragma GCC diagnostic pop
604
605
606=== modified file 'include/client/mir_toolkit/events/surface_placement.h'
607--- include/client/mir_toolkit/events/surface_placement.h 2017-01-19 05:30:03 +0000
608+++ include/client/mir_toolkit/events/surface_placement.h 2017-06-05 10:39:04 +0000
609@@ -20,6 +20,7 @@
610 #define MIR_TOOLKIT_SURFACE_PLACEMENT_H_
611
612 #include <mir_toolkit/client_types.h>
613+#include <mir_toolkit/deprecations.h>
614
615 #ifdef __cplusplus
616 /**
617@@ -38,7 +39,7 @@
618 * \return The position relative to the parent surface
619 */
620 MirRectangle mir_surface_placement_get_relative_position(MirSurfacePlacementEvent const* event)
621-__attribute__ ((deprecated("use mir_window_placement_get_relative_position instead")));
622+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_placement_get_relative_position instead");
623
624 #ifdef __cplusplus
625 }
626
627=== modified file 'include/client/mir_toolkit/mir_blob.h'
628--- include/client/mir_toolkit/mir_blob.h 2017-01-19 05:30:03 +0000
629+++ include/client/mir_toolkit/mir_blob.h 2017-06-05 10:39:04 +0000
630@@ -19,6 +19,7 @@
631 #define MIR_TOOLKIT_MIR_BLOB_H_
632
633 #include <mir_toolkit/client_types.h>
634+#include <mir_toolkit/deprecations.h>
635
636 #ifdef __cplusplus
637 /**
638@@ -35,7 +36,7 @@
639 * \return A blob
640 */
641 MirBlob* mir_blob_from_display_configuration(MirDisplayConfiguration* configuration)
642-__attribute__ ((deprecated("use mir_blob_from_display_config instead")));
643+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_blob_from_display_config instead");
644
645 /**
646 * Create a blob from a display config
647@@ -65,7 +66,7 @@
648 * \return A display configuration
649 */
650 MirDisplayConfiguration* mir_blob_to_display_configuration(MirBlob* blob)
651-__attribute__ ((deprecated("use mir_blob_to_display_config instead")));
652+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_blob_to_display_config instead");
653
654 /**
655 * Create a blob from a display config
656
657=== modified file 'include/client/mir_toolkit/mir_buffer_stream.h'
658--- include/client/mir_toolkit/mir_buffer_stream.h 2017-01-24 07:49:13 +0000
659+++ include/client/mir_toolkit/mir_buffer_stream.h 2017-06-05 10:39:04 +0000
660@@ -20,6 +20,7 @@
661
662 #include <mir_toolkit/mir_native_buffer.h>
663 #include <mir_toolkit/client_types.h>
664+#include <mir_toolkit/deprecations.h>
665
666 #ifdef __cplusplus
667 /**
668@@ -141,7 +142,8 @@
669 * mir_platform_type_gbm
670 */
671 /// @cond
672-__attribute__ ((deprecated))
673+MIR_FOR_REMOVAL_IN_VERSION_1("To identify the graphics platform use mir_connection_get_graphics_module(). \n"
674+ "To safely interpret the buffer contents use mir_buffer_stream_get_graphics_region()")
675 /// @endcond
676 MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream *stream);
677
678
679=== modified file 'include/client/mir_toolkit/mir_connection.h'
680--- include/client/mir_toolkit/mir_connection.h 2017-01-24 19:53:45 +0000
681+++ include/client/mir_toolkit/mir_connection.h 2017-06-05 10:39:04 +0000
682@@ -20,6 +20,7 @@
683
684 #include <mir_toolkit/client_types.h>
685 #include <mir_toolkit/common.h>
686+#include <mir_toolkit/deprecations.h>
687
688 #include <stdbool.h>
689
690@@ -93,7 +94,7 @@
691 * \param [out] platform_package Structure to be populated
692 */
693 void mir_connection_get_platform(MirConnection *connection, MirPlatformPackage *platform_package)
694-__attribute__((deprecated("use platform extensions instead")));
695+MIR_FOR_REMOVAL_IN_VERSION_1("use platform extensions instead");
696
697 /**
698 * Query graphics platform module.
699@@ -105,7 +106,7 @@
700 * \param [out] properties Structure to be populated
701 */
702 void mir_connection_get_graphics_module(MirConnection *connection, MirModuleProperties *properties)
703-__attribute__((deprecated("use graphics module extension instead")));
704+MIR_FOR_REMOVAL_IN_VERSION_1("use graphics module extension instead");
705
706 /**
707 * Register a callback to be called when a Lifecycle state change occurs.
708@@ -156,7 +157,7 @@
709 * \return structure that describes the display configuration
710 */
711 MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection)
712-__attribute__ ((deprecated("use mir_connection_create_display_configuration instead")));
713+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_connection_create_display_configuration instead");
714
715 /**
716 * Query the display
717@@ -188,7 +189,7 @@
718 * \param [in] display_configuration The display_configuration information resource to be destroyed
719 */
720 void mir_display_config_destroy(MirDisplayConfiguration* display_configuration)
721-__attribute__ ((deprecated("use mir_display_config_release instead")));
722+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_display_config_release instead");
723
724 /**
725 * Apply the display configuration
726@@ -204,7 +205,7 @@
727 * \return A handle that can be passed to mir_wait_for
728 */
729 MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration)
730-__attribute__ ((deprecated("use mir_connection_apply_session_display_config instead")));
731+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_connection_apply_session_display_config instead");
732
733 /**
734 * Apply the display config for the connection
735@@ -254,7 +255,7 @@
736 MirWaitHandle* mir_connection_set_base_display_config(
737 MirConnection* connection,
738 MirDisplayConfiguration const* display_configuration)
739-__attribute__ ((deprecated("use mir_connection_preview_base_display_configuration/mir_connection_confirm_base_display_configuration")));
740+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_connection_preview_base_display_configuration/mir_connection_confirm_base_display_configuration");
741
742
743 /**
744@@ -379,7 +380,7 @@
745 MirConnection* connection,
746 MirPlatformMessage const* request,
747 MirPlatformOperationCallback callback, void* context)
748-__attribute__ ((deprecated("use platform specific extensions instead")));
749+MIR_FOR_REMOVAL_IN_VERSION_1("use platform specific extensions instead");
750
751 /**
752 * Create a snapshot of the attached input devices and device configurations.
753@@ -399,7 +400,7 @@
754 * \param [in] config The input configuration
755 */
756 void mir_input_config_destroy(MirInputConfig const* config)
757-__attribute__ ((deprecated("use mir_input_config_release instead")));
758+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_input_config_release instead");
759
760 /**
761 * Release this snapshot of the input configuration.
762
763=== modified file 'include/client/mir_toolkit/mir_cursor_configuration.h'
764--- include/client/mir_toolkit/mir_cursor_configuration.h 2017-01-18 02:29:37 +0000
765+++ include/client/mir_toolkit/mir_cursor_configuration.h 2017-06-05 10:39:04 +0000
766@@ -20,6 +20,7 @@
767
768 #include <mir_toolkit/common.h>
769 #include <mir_toolkit/client_types.h>
770+#include <mir_toolkit/deprecations.h>
771
772 /**
773 * Opaque structure containing cursor parameterization. Create with mir_cursor* family.
774@@ -53,7 +54,7 @@
775 * to_mir_cursor_configuration_destroy
776 */
777 /// @cond
778-__attribute__ ((deprecated))
779+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_cursor_name()")
780 /// @endcond
781 MirCursorConfiguration *mir_cursor_configuration_from_name(char const* name);
782
783
784=== modified file 'include/client/mir_toolkit/mir_display_configuration.h'
785--- include/client/mir_toolkit/mir_display_configuration.h 2017-02-20 05:36:21 +0000
786+++ include/client/mir_toolkit/mir_display_configuration.h 2017-06-05 10:39:04 +0000
787@@ -20,6 +20,7 @@
788 #define MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
789
790 #include "client_types.h"
791+#include <mir_toolkit/deprecations.h>
792
793 #ifdef __cplusplus
794 extern "C" {
795@@ -60,7 +61,7 @@
796 */
797 int mir_display_config_get_max_simultaneous_outputs(
798 MirDisplayConfig const* config)
799- __attribute__((deprecated("Not accurate in Mir 0.26 and later. May be removed in future.")));
800+ MIR_FOR_REMOVAL_IN_VERSION_1("Not accurate in Mir 0.26 and later. May be removed in future.");
801
802 /**
803 * Get the number of outputs available in this display configuration.
804@@ -268,7 +269,7 @@
805 * \returns The name of the output type.
806 */
807 char const* mir_display_output_type_name(MirDisplayOutputType type)
808-__attribute__((deprecated("use mir_output_type_name instead")));
809+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_output_type_name instead");
810
811 /**
812 * Get the textual name of an output type.
813
814=== modified file 'include/client/mir_toolkit/mir_persistent_id.h'
815--- include/client/mir_toolkit/mir_persistent_id.h 2017-02-02 19:52:04 +0000
816+++ include/client/mir_toolkit/mir_persistent_id.h 2017-06-05 10:39:04 +0000
817@@ -19,6 +19,7 @@
818 #define MIR_TOOLKIT_MIR_PERSISTENT_ID_H_
819
820 #include <mir_toolkit/client_types.h>
821+#include <mir_toolkit/deprecations.h>
822
823 #include <stdbool.h>
824
825@@ -39,7 +40,7 @@
826 * \note This does not guarantee that the ID refers to a currently valid object.
827 */
828 bool mir_persistent_id_is_valid(MirPersistentId* id)
829-__attribute__((deprecated("Use mir_window_id_is_valid() instead")));
830+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_id_is_valid() instead");
831
832 /**
833 * \brief Free a MirPersistentId
834@@ -48,7 +49,7 @@
835 * object referred to by \arg id.
836 */
837 void mir_persistent_id_release(MirPersistentId* id)
838-__attribute__((deprecated("Use mir_window_id_release() instead")));
839+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_id_release() instead");
840
841 /**
842 * \brief Get a string representation of a MirSurfaceId
843@@ -59,7 +60,7 @@
844 * \see mir_surface_id_from_string
845 */
846 char const* mir_persistent_id_as_string(MirPersistentId* id)
847-__attribute__((deprecated("Use mir_window_id_as_string() instead")));
848+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_id_as_string() instead");
849
850 /**
851 * \brief Deserialise a string representation of a MirSurfaceId
852@@ -67,7 +68,7 @@
853 * \return The deserialised MirSurfaceId
854 */
855 MirPersistentId* mir_persistent_id_from_string(char const* string_representation)
856-__attribute__((deprecated("Use mir_window_id_from_string() instead")));
857+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_id_from_string() instead");
858
859 #pragma GCC diagnostic pop
860
861
862=== modified file 'include/client/mir_toolkit/mir_platform_message.h'
863--- include/client/mir_toolkit/mir_platform_message.h 2017-01-18 02:29:37 +0000
864+++ include/client/mir_toolkit/mir_platform_message.h 2017-06-05 10:39:04 +0000
865@@ -19,6 +19,7 @@
866 #define MIR_TOOLKIT_MIR_PLATFORM_MESSAGE_H_
867
868 #include <sys/types.h>
869+#include <mir_toolkit/deprecations.h>
870
871 #ifdef __cplusplus
872 /**
873@@ -51,7 +52,7 @@
874 * \param [in] opcode The platform message opcode
875 * \return The created MirPlatformMessage
876 */
877-__attribute__((deprecated("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")))
878+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")
879 MirPlatformMessage* mir_platform_message_create(unsigned int opcode);
880
881 /**
882@@ -59,7 +60,7 @@
883 *
884 * \param [in] message The MirPlatformMessage
885 */
886-__attribute__((deprecated("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")))
887+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")
888 void mir_platform_message_release(MirPlatformMessage const* message);
889
890 /**
891@@ -71,7 +72,7 @@
892 * \param [in] data Pointer to the data
893 * \param [in] data_size The size of the data in bytes
894 */
895-__attribute__((deprecated("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")))
896+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")
897 void mir_platform_message_set_data(MirPlatformMessage* message, void const* data, size_t data_size);
898
899 /**
900@@ -89,7 +90,7 @@
901 * \param [in] fds Pointer to the array of fds
902 * \param [in] num_fds The number of fds
903 */
904-__attribute__((deprecated("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")))
905+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")
906 void mir_platform_message_set_fds(MirPlatformMessage* message, int const* fds, size_t num_fds);
907
908 /**
909@@ -98,7 +99,7 @@
910 * \param [in] message The MirPlatformMessage
911 * \return The opcode
912 */
913-__attribute__((deprecated("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")))
914+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")
915 unsigned int mir_platform_message_get_opcode(MirPlatformMessage const* message);
916
917 /**
918@@ -111,7 +112,7 @@
919 * \param [in] message The MirPlatformMessage
920 * \return The data
921 */
922-__attribute__((deprecated("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")))
923+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")
924 MirPlatformMessageData mir_platform_message_get_data(MirPlatformMessage const* message);
925
926 /**
927@@ -128,7 +129,7 @@
928 * \param [in] message The MirPlatformMessage
929 * \return The fds
930 */
931-__attribute__((deprecated("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")))
932+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_extension_mesa_drm_auth or mir_extension_set_gbm_device")
933 MirPlatformMessageFds mir_platform_message_get_fds(MirPlatformMessage const* message);
934
935 #ifdef __cplusplus
936
937=== modified file 'include/client/mir_toolkit/mir_screencast.h'
938--- include/client/mir_toolkit/mir_screencast.h 2017-01-19 05:30:03 +0000
939+++ include/client/mir_toolkit/mir_screencast.h 2017-06-05 10:39:04 +0000
940@@ -18,6 +18,7 @@
941 #define MIR_TOOLKIT_MIR_SCREENCAST_H_
942
943 #include <mir_toolkit/client_types.h>
944+#include <mir_toolkit/deprecations.h>
945
946 #ifdef __cplusplus
947 /**
948@@ -143,7 +144,7 @@
949 MirScreencast* mir_connection_create_screencast_sync(
950 MirConnection* connection,
951 MirScreencastParameters* parameters)
952-__attribute__ ((deprecated("use mir_screencast_create_sync instead")));
953+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_screencast_create_sync instead");
954
955 /**
956 * Release the specified screencast.
957
958=== modified file 'include/client/mir_toolkit/mir_surface.h'
959--- include/client/mir_toolkit/mir_surface.h 2017-01-24 11:06:35 +0000
960+++ include/client/mir_toolkit/mir_surface.h 2017-06-05 10:39:04 +0000
961@@ -22,6 +22,7 @@
962 #include <mir_toolkit/client_types.h>
963 #include <mir_toolkit/common.h>
964 #include <mir_toolkit/mir_cursor_configuration.h>
965+#include <mir_toolkit/deprecations.h>
966
967 #include <stdbool.h>
968
969@@ -40,7 +41,7 @@
970 MirSurfaceSpec* mir_connection_create_spec_for_normal_surface(MirConnection* connection,
971 int width, int height,
972 MirPixelFormat format)
973-__attribute__((deprecated("Use mir_create_normal_window_spec() instead")));
974+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_create_normal_window_spec() instead");
975
976 MirSurfaceSpec*
977 mir_connection_create_spec_for_menu(MirConnection* connection,
978@@ -50,7 +51,7 @@
979 MirSurface* parent,
980 MirRectangle* rect,
981 MirEdgeAttachment edge)
982-__attribute__((deprecated("Use mir_specify_menu() instead")));
983+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_specify_menu() instead");
984
985 MirSurfaceSpec*
986 mir_connection_create_spec_for_tooltip(MirConnection* connection,
987@@ -58,7 +59,7 @@
988 MirPixelFormat format,
989 MirSurface* parent,
990 MirRectangle* zone)
991-__attribute__((deprecated("Use mir_create_tip_window_spec() instead")));
992+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_create_tip_window_spec() instead");
993
994 MirSurfaceSpec*
995 mir_connection_create_spec_for_tip(MirConnection* connection,
996@@ -67,30 +68,30 @@
997 MirSurface* parent,
998 MirRectangle* rect,
999 MirEdgeAttachment edge)
1000-__attribute__((deprecated("Use mir_create_tip_window_spec() instead")));
1001+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_create_tip_window_spec() instead");
1002
1003 MirSurfaceSpec*
1004 mir_connection_create_spec_for_modal_dialog(MirConnection* connection,
1005 int width, int height,
1006 MirPixelFormat format,
1007 MirSurface* parent)
1008-__attribute__((deprecated("Use mir_create_modal_dialog_window_spec() instead")));
1009+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_create_modal_dialog_window_spec() instead");
1010
1011 MirSurfaceSpec*
1012 mir_connection_create_spec_for_dialog(MirConnection* connection,
1013 int width, int height,
1014 MirPixelFormat format)
1015-__attribute__((deprecated("Use mir_create_dialog_window_spec() instead")));
1016+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_create_dialog_window_spec() instead");
1017
1018 MirSurfaceSpec* mir_create_surface_spec(MirConnection* connection)
1019-__attribute__((deprecated("Use mir_create_window_spec() instead")));
1020+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_create_window_spec() instead");
1021
1022 MirSurfaceSpec*
1023 mir_connection_create_spec_for_changes(MirConnection* connection)
1024-__attribute__((deprecated("Use mir_create_window_spec() instead")));
1025+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_create_window_spec() instead");
1026
1027 void mir_surface_spec_set_parent(MirSurfaceSpec* spec, MirSurface* parent)
1028-__attribute__((deprecated("Use mir_window_spec_set_parent() instead")));
1029+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_parent() instead");
1030
1031 /**
1032 *\deprecated This will soon be a property of the backing content.
1033@@ -103,77 +104,77 @@
1034 * was removed by use of mir_window_spec_set_streams().
1035 */
1036 int mir_surface_get_swapinterval(MirSurface* surface)
1037-__attribute__((deprecated("This will soon be a property of the backing content")));
1038+MIR_FOR_REMOVAL_IN_VERSION_1("This will soon be a property of the backing content");
1039
1040 void mir_surface_spec_set_type(MirSurfaceSpec* spec, MirSurfaceType type)
1041-__attribute__((deprecated("use mir_window_spec_set_type() instead")));
1042+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_type() instead");
1043
1044 void mir_surface_spec_set_name(MirSurfaceSpec* spec, char const* name)
1045-__attribute__((deprecated("use mir_window_spec_set_name() instead")));
1046+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_name() instead");
1047
1048 void mir_surface_spec_set_width(MirSurfaceSpec* spec, unsigned width)
1049-__attribute__((deprecated("use mir_window_spec_set_width() instead")));
1050+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_width() instead");
1051
1052 void mir_surface_spec_set_height(MirSurfaceSpec* spec, unsigned height)
1053-__attribute__((deprecated("use mir_window_spec_set_height() instead")));
1054+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_height() instead");
1055
1056 void mir_surface_spec_set_width_increment(MirSurfaceSpec* spec, unsigned width_inc)
1057-__attribute__((deprecated("use mir_window_spec_set_width_increment() instead")));
1058+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_width_increment() instead");
1059
1060 void mir_surface_spec_set_height_increment(MirSurfaceSpec* spec, unsigned height_inc)
1061-__attribute__((deprecated("use mir_window_spec_set_height_increment() instead")));
1062+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_height_increment() instead");
1063
1064 void mir_surface_spec_set_min_width(MirSurfaceSpec* spec, unsigned min_width)
1065-__attribute__((deprecated("use mir_window_spec_set_min_width() instead")));
1066+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_min_width() instead");
1067
1068 void mir_surface_spec_set_min_height(MirSurfaceSpec* spec, unsigned min_height)
1069-__attribute__((deprecated("use mir_window_spec_set_min_height() instead")));
1070+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_min_height() instead");
1071
1072 void mir_surface_spec_set_max_width(MirSurfaceSpec* spec, unsigned max_width)
1073-__attribute__((deprecated("use mir_window_spec_set_max_width() instead")));
1074+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_max_width() instead");
1075
1076 void mir_surface_spec_set_max_height(MirSurfaceSpec* spec, unsigned max_height)
1077-__attribute__((deprecated("use mir_window_spec_set_max_height() instead")));
1078+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_max_height() instead");
1079
1080 void mir_surface_spec_set_min_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height)
1081-__attribute__((deprecated("use mir_window_spec_set_min_aspect_ratio() instead")));
1082+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_min_aspect_ratio() instead");
1083
1084 void mir_surface_spec_set_max_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height)
1085-__attribute__((deprecated("use mir_window_spec_set_max_aspect_ratio() instead")));
1086+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_max_aspect_ratio() instead");
1087
1088 void mir_surface_spec_set_fullscreen_on_output(MirSurfaceSpec* spec, uint32_t output_id)
1089-__attribute__((deprecated("use mir_window_spec_set_fullscreen_on_output() instead")));
1090+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_fullscreen_on_output() instead");
1091
1092 void mir_surface_spec_set_preferred_orientation(MirSurfaceSpec* spec, MirOrientationMode mode)
1093-__attribute__((deprecated("use mir_window_spec_set_preferred_orientation() instead")));
1094+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_preferred_orientation() instead");
1095
1096 bool mir_surface_spec_attach_to_foreign_parent(MirSurfaceSpec* spec,
1097 MirPersistentId* parent,
1098 MirRectangle* attachment_rect,
1099 MirEdgeAttachment edge)
1100-__attribute__((deprecated("use mir_window_spec_attach_to_foreign_parent() instead")));
1101+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_attach_to_foreign_parent() instead");
1102
1103 void mir_surface_spec_set_state(MirSurfaceSpec* spec, MirSurfaceState state)
1104-__attribute__((deprecated("use mir_window_spec_set_state() instead")));
1105+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_state() instead");
1106
1107 void mir_surface_spec_release(MirSurfaceSpec* spec)
1108-__attribute__((deprecated("use mir_window_spec_release() instead")));
1109+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_release() instead");
1110
1111 void mir_surface_spec_set_input_shape(MirSurfaceSpec* spec,
1112 MirRectangle const *rectangles,
1113 size_t n_rects)
1114-__attribute__((deprecated("use mir_window_spec_set_input_shape() instead")));
1115+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_input_shape() instead");
1116
1117 void mir_surface_spec_set_event_handler(MirSurfaceSpec* spec,
1118 mir_surface_event_callback callback,
1119 void* context)
1120-__attribute__((deprecated("use mir_window_spec_set_event_handler() instead")));
1121+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_event_handler() instead");
1122
1123 void mir_surface_spec_set_shell_chrome(MirSurfaceSpec* spec, MirShellChrome style)
1124-__attribute__((deprecated("use mir_window_spec_set_shell_chrome() instead")));
1125+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_shell_chrome() instead");
1126
1127 void mir_surface_spec_set_pointer_confinement(MirSurfaceSpec* spec, MirPointerConfinementState state)
1128-__attribute__((deprecated("use mir_window_spec_set_pointer_confinement() instead")));
1129+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_pointer_confinement() instead");
1130
1131 void mir_surface_spec_set_placement(MirSurfaceSpec* spec,
1132 const MirRectangle* rect,
1133@@ -182,69 +183,69 @@
1134 MirPlacementHints placement_hints,
1135 int offset_dx,
1136 int offset_dy)
1137-__attribute__((deprecated("use mir_window_spec_set_placement() instead")));
1138+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_placement() instead");
1139
1140 MirSurfaceSpec* mir_connection_create_spec_for_input_method(MirConnection* connection,
1141 int width, int height,
1142 MirPixelFormat format)
1143-__attribute__((deprecated("use mir_create_input_method_window_spec() instead")));
1144+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_create_input_method_window_spec() instead");
1145
1146 void mir_surface_spec_set_pixel_format(MirSurfaceSpec* spec, MirPixelFormat format)
1147-__attribute__((deprecated("use mir_window_spec_set_pixel_format() instead")));
1148+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_pixel_format() instead");
1149
1150 void mir_surface_spec_set_buffer_usage(MirSurfaceSpec* spec, MirBufferUsage usage)
1151-__attribute__((deprecated("use mir_window_spec_set_buffer_usage() instead")));
1152+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_buffer_usage() instead");
1153
1154 void mir_surface_spec_set_streams(MirSurfaceSpec* spec,
1155 MirBufferStreamInfo* streams,
1156 unsigned int num_streams)
1157-__attribute__((deprecated("use mir_window_spec_set_streams() instead")));
1158+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_streams() instead");
1159
1160 void mir_surface_apply_spec(MirSurface* surface, MirSurfaceSpec* spec)
1161-__attribute__((deprecated("use mir_window_apply_spec() instead")));
1162+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_apply_spec() instead");
1163
1164 bool mir_surface_is_valid(MirSurface *surface)
1165-__attribute__((deprecated("use mir_window_is_valid() instead")));
1166+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_is_valid() instead");
1167
1168 MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,
1169 mir_surface_callback callback, void* context)
1170-__attribute__((deprecated("use mir_create_window() instead")));
1171+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_create_window() instead");
1172
1173 MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)
1174-__attribute__((deprecated("use mir_create_window_sync() instead")));
1175+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_create_window_sync() instead");
1176
1177 MirWaitHandle *mir_surface_release(
1178 MirSurface *surface,
1179 mir_surface_callback callback,
1180 void *context)
1181-__attribute__((deprecated("use mir_window_release() instead")));
1182+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_release() instead");
1183
1184 void mir_surface_release_sync(MirSurface *surface)
1185-__attribute__((deprecated("use mir_window_release_sync() instead")));
1186+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_release_sync() instead");
1187
1188 void mir_surface_set_event_handler(MirSurface *surface,
1189 mir_surface_event_callback callback,
1190 void* context)
1191-__attribute__((deprecated("use mir_window_set_event_handler() instead")));
1192+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_set_event_handler() instead");
1193
1194 MirBufferStream* mir_surface_get_buffer_stream(MirSurface *surface)
1195-__attribute__((deprecated("use mir_window_get_buffer_stream() instead")));
1196+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_buffer_stream() instead");
1197
1198 char const* mir_surface_get_error_message(MirSurface *surface)
1199-__attribute__((deprecated("use mir_window_get_error_message() instead")));
1200+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_error_message() instead");
1201
1202 void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters)
1203-__attribute__((deprecated("use mir_window_get_parameters() instead")));
1204+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_parameters() instead");
1205
1206 MirSurfaceType mir_surface_get_type(MirSurface* surface)
1207-__attribute__((deprecated("use mir_window_get_type() instead")));
1208+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_type() instead");
1209
1210 MirWaitHandle* mir_surface_set_state(MirSurface *surface,
1211 MirSurfaceState state)
1212-__attribute__((deprecated("use mir_window_set_state() instead")));
1213+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_set_state() instead");
1214
1215 MirSurfaceState mir_surface_get_state(MirSurface *surface)
1216-__attribute__((deprecated("use mir_window_get_state() instead")));
1217+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_state() instead");
1218
1219 /**
1220 * Set the swapinterval for the default stream.
1221@@ -260,37 +261,37 @@
1222 * or NULL if the interval could not be supported
1223 */
1224 MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval)
1225-__attribute__((deprecated("Swap interval should be set on the backing content")));
1226+MIR_FOR_REMOVAL_IN_VERSION_1("Swap interval should be set on the backing content");
1227
1228 int mir_surface_get_dpi(MirSurface* surface)
1229-__attribute__((deprecated("use mir_window_get_dpi() instead")));
1230+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_dpi() instead");
1231
1232 MirSurfaceFocusState mir_surface_get_focus(MirSurface *surface)
1233-__attribute__((deprecated("use mir_window_get_focus_state() instead")));
1234+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_focus_state() instead");
1235
1236 MirSurfaceVisibility mir_surface_get_visibility(MirSurface *surface)
1237-__attribute__((deprecated("use mir_window_get_visibility() instead")));
1238+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_visibility() instead");
1239
1240 MirWaitHandle* mir_surface_configure_cursor(MirSurface *surface, MirCursorConfiguration const* parameters)
1241-__attribute__((deprecated("use mir_window_configure_cursor() instead")));
1242+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_configure_cursor() instead");
1243
1244 MirOrientation mir_surface_get_orientation(MirSurface *surface)
1245-__attribute__((deprecated("use mir_window_get_orientation() instead")));
1246+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_orientation() instead");
1247
1248 MirWaitHandle* mir_surface_set_preferred_orientation(MirSurface *surface, MirOrientationMode orientation)
1249-__attribute__((deprecated("use mir_window_set_preferred_orientation() instead")));
1250+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_set_preferred_orientation() instead");
1251
1252 MirOrientationMode mir_surface_get_preferred_orientation(MirSurface *surface)
1253-__attribute__((deprecated("use mir_window_get_preferred_orientation() instead")));
1254+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_get_preferred_orientation() instead");
1255
1256 MirWaitHandle* mir_surface_request_persistent_id(MirSurface* surface, mir_surface_id_callback callback, void* context)
1257-__attribute__((deprecated("use mir_window_request_persistent_id() instead")));
1258+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_request_persistent_id() instead");
1259
1260 MirPersistentId* mir_surface_request_persistent_id_sync(MirSurface *surface)
1261-__attribute__((deprecated("use mir_window_request_persistent_id_sync() instead")));
1262+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_request_persistent_id_sync() instead");
1263
1264 void mir_surface_raise(MirSurface* surface, MirCookie const* cookie)
1265-__attribute__((deprecated("use mir_window_raise() instead")));
1266+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_raise() instead");
1267
1268 #pragma GCC diagnostic pop
1269
1270
1271=== modified file 'include/client/mir_toolkit/mir_wait.h'
1272--- include/client/mir_toolkit/mir_wait.h 2017-01-19 23:17:56 +0000
1273+++ include/client/mir_toolkit/mir_wait.h 2017-06-05 10:39:04 +0000
1274@@ -19,6 +19,7 @@
1275 #define MIR_TOOLKIT_MIR_WAIT_H_
1276
1277 #include <mir_toolkit/client_types.h>
1278+#include <mir_toolkit/deprecations.h>
1279
1280 #ifdef __cplusplus
1281 /**
1282@@ -36,7 +37,7 @@
1283 * \param [in] wait_handle Handle returned by an asynchronous request
1284 */
1285 void mir_wait_for(MirWaitHandle *wait_handle)
1286-__attribute__ ((deprecated("No longer supported - use callbacks or wait for state changes")));
1287+MIR_FOR_REMOVAL_IN_VERSION_1("No longer supported - use callbacks or wait for state changes");
1288
1289 /**
1290 * Wait on the supplied handle until one instance of the associated request
1291@@ -47,7 +48,7 @@
1292 * \param [in] wait_handle Handle returned by an asynchronous request
1293 */
1294 void mir_wait_for_one(MirWaitHandle *wait_handle)
1295-__attribute__ ((deprecated("No longer supported - use callbacks or wait for state changes")));
1296+MIR_FOR_REMOVAL_IN_VERSION_1("No longer supported - use callbacks or wait for state changes");
1297
1298
1299 #ifdef __cplusplus
1300
1301=== modified file 'include/client/mir_toolkit/mir_window.h'
1302--- include/client/mir_toolkit/mir_window.h 2017-02-03 20:39:06 +0000
1303+++ include/client/mir_toolkit/mir_window.h 2017-06-05 10:39:04 +0000
1304@@ -22,6 +22,7 @@
1305 #include <mir_toolkit/client_types.h>
1306 #include <mir_toolkit/common.h>
1307 #include <mir_toolkit/mir_cursor_configuration.h>
1308+#include <mir_toolkit/deprecations.h>
1309
1310 #include <stdbool.h>
1311
1312@@ -555,7 +556,7 @@
1313 MirRenderSurface* render_surface,
1314 int logical_width, int logical_height,
1315 int displacement_x, int displacement_y)
1316-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1317+MIR_FOR_REMOVAL_IN_VERSION_1("This function is slated for rename due to MirRenderSurface-->MirSurface transition");
1318 #pragma GCC diagnostic pop
1319
1320 /**
1321@@ -774,7 +775,7 @@
1322 * \param [in,out] context User data passed to completion callback.
1323 */
1324 void mir_window_request_persistent_id(MirWindow* window, MirWindowIdCallback callback, void* context)
1325-__attribute__((deprecated("Use mir_window_request_window_id() instead")));
1326+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id() instead");
1327 void mir_window_request_window_id(MirWindow* window, MirWindowIdCallback callback, void* context);
1328
1329 /**
1330@@ -784,7 +785,7 @@
1331 * be freed with a call to mir_persistent_id_release()
1332 */
1333 MirPersistentId* mir_window_request_persistent_id_sync(MirWindow* window)
1334-__attribute__((deprecated("Use mir_window_request_window_id_sync")));
1335+MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id_sync");
1336 MirWindowId* mir_window_request_window_id_sync(MirWindow* window);
1337 #ifdef __cplusplus
1338 }
1339
1340=== modified file 'include/client/mir_toolkit/rs/mir_render_surface.h'
1341--- include/client/mir_toolkit/rs/mir_render_surface.h 2017-03-16 16:47:21 +0000
1342+++ include/client/mir_toolkit/rs/mir_render_surface.h 2017-06-05 10:39:04 +0000
1343@@ -21,6 +21,18 @@
1344 #define MIR_TOOLKIT_MIR_RENDER_SURFACE_H_
1345
1346 #include <mir_toolkit/client_types.h>
1347+#include <mir_toolkit/deprecations.h>
1348+
1349+#ifndef MIR_DEPRECATE_RENDERSURFACES
1350+ #define MIR_DEPRECATE_RENDERSURFACES 0
1351+#endif
1352+
1353+#if MIR_ENABLE_DEPRECATIONS > 0 && MIR_DEPRECATE_RENDERSURFACES > 0
1354+ #define MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME\
1355+ __attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")))
1356+#else
1357+ #define MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME
1358+#endif
1359
1360 #ifdef __cplusplus
1361 /**
1362@@ -30,6 +42,9 @@
1363 extern "C" {
1364 #endif
1365
1366+typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
1367+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1368+
1369 #pragma GCC diagnostic push
1370 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1371 /**
1372@@ -49,7 +64,7 @@
1373 int width, int height,
1374 MirRenderSurfaceCallback callback,
1375 void* context)
1376-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1377+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1378
1379 /**
1380 * Create a render surface and wait for the result
1381@@ -64,7 +79,7 @@
1382 MirRenderSurface* mir_connection_create_render_surface_sync(
1383 MirConnection* connection,
1384 int width, int height)
1385-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1386+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1387
1388 /**
1389 * Get the size of the MirRenderSurface
1390@@ -76,7 +91,7 @@
1391 void mir_render_surface_get_size(
1392 MirRenderSurface* render_surface,
1393 int* width, int* height)
1394-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1395+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1396
1397 /**
1398 * Set the size of the MirRenderSurface
1399@@ -88,7 +103,7 @@
1400 void mir_render_surface_set_size(
1401 MirRenderSurface* render_surface,
1402 int width, int height)
1403-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1404+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1405
1406 /**
1407 * Test for a valid render surface
1408@@ -100,8 +115,7 @@
1409 */
1410 bool mir_render_surface_is_valid(
1411 MirRenderSurface* render_surface)
1412-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1413-
1414+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1415 /**
1416 * Retrieve a text description of the error. The returned string is owned by
1417 * the library and remains valid until the render surface or the associated
1418@@ -113,7 +127,7 @@
1419 */
1420 char const *mir_render_surface_get_error_message(
1421 MirRenderSurface* render_surface)
1422-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1423+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1424
1425 /**
1426 * Release the specified render surface
1427@@ -122,7 +136,7 @@
1428 */
1429 void mir_render_surface_release(
1430 MirRenderSurface* render_surface)
1431-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1432+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1433
1434 /**
1435 * Obtain the buffer stream backing a given render surface.
1436@@ -142,7 +156,7 @@
1437 MirRenderSurface* render_surface,
1438 int width, int height,
1439 MirPixelFormat format)
1440-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1441+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1442
1443 /**
1444 * Obtain the presentation chain backing a given render surface.
1445@@ -155,7 +169,7 @@
1446 */
1447 MirPresentationChain* mir_render_surface_get_presentation_chain(
1448 MirRenderSurface* render_surface)
1449-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1450+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1451
1452 /** Query whether the server supports a given presentation mode.
1453 *
1454@@ -189,7 +203,29 @@
1455 MirWindowSpec* spec,
1456 MirRenderSurface* render_surface,
1457 int hotspot_x, int hotspot_y)
1458-__attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
1459+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1460+
1461+/**
1462+ * Set the MirWindowSpec to display content contained in a render surface
1463+ *
1464+ * \warning: The initial call to mir_window_spec_add_render_surface will set
1465+ * the bottom-most content, and subsequent calls will stack the
1466+ * content on top.
1467+ *
1468+ * \param spec The window_spec to be updated
1469+ * \param render_surface The render surface containing the content to be displayed
1470+ * \param logical_width The width that the content will be displayed at
1471+ * (Ignored for buffer streams)
1472+ * \param logical_height The height that the content will be displayed at
1473+ * (Ignored for buffer streams)
1474+ * \param displacement_x The x displacement from the top-left corner of the MirWindow
1475+ * \param displacement_y The y displacement from the top-left corner of the MirWindow
1476+ */
1477+void mir_window_spec_add_render_surface(MirWindowSpec* spec,
1478+ MirRenderSurface* render_surface,
1479+ int logical_width, int logical_height,
1480+ int displacement_x, int displacement_y)
1481+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
1482
1483 #pragma GCC diagnostic pop
1484
1485
1486=== modified file 'include/core/mir_toolkit/common.h'
1487--- include/core/mir_toolkit/common.h 2017-01-23 22:29:00 +0000
1488+++ include/core/mir_toolkit/common.h 2017-06-05 10:39:04 +0000
1489@@ -21,6 +21,8 @@
1490 #ifndef MIR_COMMON_H_
1491 #define MIR_COMMON_H_
1492
1493+#include <mir_toolkit/deprecations.h>
1494+
1495 //for clang
1496 #ifndef __has_feature
1497 #define __has_feature(x) 0 // Compatibility with non-clang
1498@@ -35,7 +37,7 @@
1499 (__has_extension(attribute_deprecated_with_message) && \
1500 __has_extension(enumerator_attributes))
1501 #define MIR_DEPRECATED_ENUM(ENUM, INSTEAD) \
1502- ENUM __attribute__ ((deprecated("Use " #INSTEAD " instead")))
1503+ ENUM MIR_FOR_REMOVAL_IN_VERSION_1("Use " #INSTEAD " instead")
1504 #else
1505 #define MIR_DEPRECATED_ENUM(ENUM, INSTEAD) \
1506 ENUM
1507@@ -65,7 +67,7 @@
1508 mir_surface_attrib_preferred_orientation,
1509 /* Must be last */
1510 mir_surface_attribs
1511-} MirSurfaceAttrib __attribute__ ((deprecated("use MirWindowAttrib")));
1512+} MirSurfaceAttrib MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowAttrib");
1513
1514 /**
1515 * Attributes of a window that the client and server/shell may wish to
1516@@ -102,7 +104,7 @@
1517 mir_surface_type_satellite, /**< AKA "toolbox"/"toolbar" */
1518 mir_surface_type_tip, /**< AKA "tooltip" */
1519 mir_surface_types
1520-} MirSurfaceType __attribute__ ((deprecated("use MirWindowType")));
1521+} MirSurfaceType MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowType");
1522
1523 typedef enum MirWindowType
1524 {
1525@@ -132,7 +134,7 @@
1526 mir_surface_state_horizmaximized,
1527 mir_surface_state_hidden,
1528 mir_surface_states
1529-} MirSurfaceState __attribute__ ((deprecated("use MirWindowState")));
1530+} MirSurfaceState MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowState");
1531
1532 typedef enum MirWindowState
1533 {
1534@@ -154,7 +156,7 @@
1535 {
1536 mir_surface_unfocused = 0,
1537 mir_surface_focused
1538-} MirSurfaceFocusState __attribute__ ((deprecated("use MirWindowFocusState")));
1539+} MirSurfaceFocusState MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowFocusState");
1540
1541 typedef enum MirWindowFocusState
1542 {
1543@@ -166,7 +168,7 @@
1544 {
1545 mir_surface_visibility_occluded = 0,
1546 mir_surface_visibility_exposed
1547-} MirSurfaceVisibility __attribute__ ((deprecated("use MirWindowFocusState")));
1548+} MirSurfaceVisibility MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowFocusState");
1549
1550 typedef enum MirWindowVisibility
1551 {
1552
1553=== added file 'include/core/mir_toolkit/deprecations.h'
1554--- include/core/mir_toolkit/deprecations.h 1970-01-01 00:00:00 +0000
1555+++ include/core/mir_toolkit/deprecations.h 2017-06-05 10:39:04 +0000
1556@@ -0,0 +1,36 @@
1557+/*
1558+ * Copyright © 2017 Canonical Ltd.
1559+ *
1560+ * This program is free software: you can redistribute it and/or modify it
1561+ * under the terms of the GNU Lesser General Public License version 3,
1562+ * as published by the Free Software Foundation.
1563+ *
1564+ * This program is distributed in the hope that it will be useful,
1565+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1566+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1567+ * GNU Lesser General Public License for more details.
1568+ *
1569+ * You should have received a copy of the GNU Lesser General Public License
1570+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1571+ */
1572+
1573+#ifndef MIR_DEPRECATIONS_H_
1574+#define MIR_DEPRECATIONS_H_
1575+
1576+#ifndef MIR_ENABLE_DEPRECATIONS
1577+ // use g++ version < 6.2 as a proxy for building on Ubunutu 16.04LTS ("Xenial") or 16.10 (Yakkety)
1578+ #if defined(__clang__) || !defined(__GNUC__) || (__GNUC__ > 6) || ((__GNUC__ == 6) && (__GNUC_MINOR__ >= 2))
1579+ #define MIR_ENABLE_DEPRECATIONS 1
1580+ #else
1581+ #define MIR_ENABLE_DEPRECATIONS 0
1582+ #endif
1583+#endif
1584+
1585+#if MIR_ENABLE_DEPRECATIONS > 0
1586+ #define MIR_FOR_REMOVAL_IN_VERSION_1(message)\
1587+ __attribute__((deprecated(message)))
1588+#else
1589+ #define MIR_FOR_REMOVAL_IN_VERSION_1(message)
1590+#endif
1591+
1592+#endif //MIR_DEPRECATIONS_H_
1593
1594=== modified file 'src/common/events/input_configuration_event.cpp'
1595--- src/common/events/input_configuration_event.cpp 2017-01-20 16:27:50 +0000
1596+++ src/common/events/input_configuration_event.cpp 2017-06-05 10:39:04 +0000
1597@@ -18,13 +18,12 @@
1598
1599 #include "mir/events/input_configuration_event.h"
1600
1601+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1602 MirInputConfigurationEvent::MirInputConfigurationEvent()
1603 {
1604 event.initInputConfiguration();
1605 }
1606
1607-#pragma GCC diagnostic push
1608-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1609 MirInputConfigurationAction MirInputConfigurationEvent::action() const
1610 {
1611 return static_cast<MirInputConfigurationAction>(event.asReader().getInputConfiguration().getAction());
1612@@ -34,7 +33,6 @@
1613 {
1614 event.getInputConfiguration().setAction(static_cast<mir::capnp::InputConfigurationEvent::Action>(action));
1615 }
1616-#pragma GCC diagnostic pop
1617
1618 std::chrono::nanoseconds MirInputConfigurationEvent::when() const
1619 {
1620
1621=== modified file 'src/include/common/mir/events/input_configuration_event.h'
1622--- src/include/common/mir/events/input_configuration_event.h 2017-01-20 16:27:50 +0000
1623+++ src/include/common/mir/events/input_configuration_event.h 2017-06-05 10:39:04 +0000
1624@@ -37,8 +37,7 @@
1625
1626 MirInputDeviceId id() const;
1627 void set_id(MirInputDeviceId id);
1628-}
1629- __attribute__((deprecated));
1630+};
1631 #pragma GCC diagnostic pop
1632
1633 #endif /* MIR_COMMON_INPUT_CONFIGURATION_EVENT_H_ */
1634
1635=== modified file 'src/platforms/android/utils/CMakeLists.txt'
1636--- src/platforms/android/utils/CMakeLists.txt 2017-01-18 02:29:37 +0000
1637+++ src/platforms/android/utils/CMakeLists.txt 2017-06-05 10:39:04 +0000
1638@@ -36,6 +36,7 @@
1639 )
1640
1641 target_link_libraries(mir_demo_standalone_render_overlays
1642+ mirclient
1643 mircommon
1644 mirplatform
1645 )
1646
1647=== modified file 'src/platforms/mesa/server/kms/kms_page_flipper.cpp'
1648--- src/platforms/mesa/server/kms/kms_page_flipper.cpp 2017-01-18 02:29:37 +0000
1649+++ src/platforms/mesa/server/kms/kms_page_flipper.cpp 2017-06-05 10:39:04 +0000
1650@@ -26,6 +26,7 @@
1651 #include <xf86drm.h>
1652 #include <xf86drmMode.h>
1653 #include <chrono>
1654+#include <cstring>
1655
1656 namespace mg = mir::graphics;
1657 namespace mgm = mir::graphics::mesa;
1658@@ -89,12 +90,11 @@
1659
1660 mg::Frame mgm::KMSPageFlipper::wait_for_flip(uint32_t crtc_id)
1661 {
1662- static drmEventContext evctx =
1663- {
1664- DRM_EVENT_CONTEXT_VERSION, /* .version */
1665- 0, /* .vblank_handler */
1666- page_flip_handler /* .page_flip_handler */
1667- };
1668+ drmEventContext evctx;
1669+ memset(&evctx, 0, sizeof evctx);
1670+ evctx.version = 2; // We only support the old v2 page_flip_handler
1671+ evctx.page_flip_handler = &page_flip_handler;
1672+
1673 static std::thread::id const invalid_tid;
1674
1675 {
1676
1677=== modified file 'src/server/input/default_configuration.cpp'
1678--- src/server/input/default_configuration.cpp 2017-01-18 02:29:37 +0000
1679+++ src/server/input/default_configuration.cpp 2017-06-05 10:39:04 +0000
1680@@ -186,7 +186,9 @@
1681 std::chrono::milliseconds const key_repeat_delay{50};
1682
1683 auto const options = the_options();
1684- auto enable_repeat = options->get<bool>(options::enable_key_repeat_opt);
1685+ // lp:1675357: Disable generation of key repeat events on nested servers
1686+ auto enable_repeat = options->get<bool>(options::enable_key_repeat_opt) &&
1687+ !options->is_set(options::host_socket_opt);
1688
1689 return std::make_shared<mi::KeyRepeatDispatcher>(
1690 the_event_filter_chain_dispatcher(), the_main_loop(), the_cookie_authority(),
1691@@ -365,7 +367,9 @@
1692 the_key_mapper(),
1693 the_server_status_listener());
1694
1695- if (key_repeater && !the_options()->is_set(options::host_socket_opt))
1696+ // lp:1675357: KeyRepeatDispatcher must be informed about removed input devices, otherwise
1697+ // pressed keys get repeated indefinitely
1698+ if (key_repeater)
1699 key_repeater->set_input_device_hub(hub);
1700 return hub;
1701 });
1702
1703=== modified file 'src/server/input/default_device.cpp'
1704--- src/server/input/default_device.cpp 2017-01-18 02:29:37 +0000
1705+++ src/server/input/default_device.cpp 2017-06-05 10:39:04 +0000
1706@@ -30,10 +30,17 @@
1707
1708 namespace mi = mir::input;
1709
1710-mi::DefaultDevice::DefaultDevice(MirInputDeviceId id, std::shared_ptr<dispatch::ActionQueue> const& actions,
1711- InputDevice& device, std::shared_ptr<KeyMapper> const& key_mapper)
1712- : device_id{id}, device{device}, info(device.get_device_info()), pointer{device.get_pointer_settings()},
1713- touchpad{device.get_touchpad_settings()}, actions{actions}, key_mapper{key_mapper}
1714+mi::DefaultDevice::DefaultDevice(MirInputDeviceId id,
1715+ std::shared_ptr<dispatch::ActionQueue> const& actions,
1716+ InputDevice& device,
1717+ std::shared_ptr<KeyMapper> const& key_mapper)
1718+ : device_id{id},
1719+ device{device},
1720+ info(device.get_device_info()),
1721+ pointer{device.get_pointer_settings()},
1722+ touchpad{device.get_touchpad_settings()},
1723+ actions{actions},
1724+ key_mapper{key_mapper}
1725 {
1726 if (contains(info.capabilities, mi::DeviceCapability::keyboard))
1727 {
1728@@ -70,8 +77,8 @@
1729 auto const& settings = pointer.value();
1730
1731 return MirPointerConfig(settings.handedness, settings.acceleration,
1732- settings.cursor_acceleration_bias, settings.horizontal_scroll_scale,
1733- settings.vertical_scroll_scale);
1734+ settings.cursor_acceleration_bias, settings.horizontal_scroll_scale,
1735+ settings.vertical_scroll_scale);
1736 }
1737
1738 mir::optional_value<MirTouchpadConfig> mi::DefaultDevice::touchpad_configuration() const
1739@@ -82,14 +89,17 @@
1740 auto const& settings = touchpad.value();
1741
1742 return MirTouchpadConfig(settings.click_mode, settings.scroll_mode, settings.button_down_scroll_button,
1743- settings.tap_to_click, settings.disable_while_typing, settings.disable_with_mouse,
1744- settings.middle_mouse_button_emulation);
1745+ settings.tap_to_click, settings.disable_while_typing, settings.disable_with_mouse,
1746+ settings.middle_mouse_button_emulation);
1747 }
1748
1749 void mi::DefaultDevice::apply_pointer_configuration(MirPointerConfig const& conf)
1750 {
1751- if (!pointer.is_set())
1752- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a pointer configuration"));
1753+ {
1754+ std::lock_guard<std::mutex> lock(config_mutex);
1755+ if (!pointer.is_set())
1756+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a pointer configuration"));
1757+ }
1758
1759 if (conf.cursor_acceleration_bias() < -1.0 || conf.cursor_acceleration_bias() > 1.0)
1760 BOOST_THROW_EXCEPTION(std::invalid_argument("Cursor acceleration bias out of range"));
1761@@ -101,18 +111,25 @@
1762 settings.vertical_scroll_scale = conf.vertical_scroll_scale();
1763 settings.horizontal_scroll_scale = conf.horizontal_scroll_scale();
1764
1765- pointer = settings;
1766-
1767- actions->enqueue([settings = std::move(settings), dev=&device]
1768- {
1769- dev->apply_settings(settings);
1770- });
1771+ {
1772+ std::lock_guard<std::mutex> lock(config_mutex);
1773+ pointer = settings;
1774+ if (!actions) // device is disabled
1775+ return;
1776+ actions->enqueue([settings = std::move(settings), dev=&device]
1777+ {
1778+ dev->apply_settings(settings);
1779+ });
1780+ }
1781 }
1782
1783 void mi::DefaultDevice::apply_touchpad_configuration(MirTouchpadConfig const& conf)
1784 {
1785- if (!touchpad.is_set())
1786- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a touchpad configuration"));
1787+ {
1788+ std::lock_guard<std::mutex> lock(config_mutex);
1789+ if (!touchpad.is_set())
1790+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a touchpad configuration"));
1791+ }
1792
1793 if (conf.scroll_mode() & mir_touchpad_scroll_mode_button_down_scroll &&
1794 conf.button_down_scroll_button() == mi::no_scroll_button)
1795@@ -127,12 +144,17 @@
1796 settings.tap_to_click = conf.tap_to_click();
1797 settings.middle_mouse_button_emulation = conf.middle_mouse_button_emulation();
1798
1799- touchpad = settings;
1800+ {
1801+ std::lock_guard<std::mutex> lock(config_mutex);
1802+ touchpad = settings;
1803
1804- actions->enqueue([settings = std::move(settings), dev=&device]
1805- {
1806+ if (!actions) // device is disabled
1807+ return;
1808+ actions->enqueue([settings = std::move(settings), dev=&device]
1809+ {
1810 dev->apply_settings(settings);
1811- });
1812+ });
1813+ }
1814 }
1815
1816 mir::optional_value<MirKeyboardConfig> mi::DefaultDevice::keyboard_configuration() const
1817@@ -145,9 +167,18 @@
1818 if (!contains(info.capabilities, mi::DeviceCapability::keyboard))
1819 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a keyboard configuration"));
1820
1821+ std::lock_guard<std::mutex> lock(config_mutex);
1822+ if (!actions) // device is disabled
1823+ return;
1824 if (keyboard.value().device_keymap() != conf.device_keymap())
1825- {
1826 keyboard = conf;
1827- key_mapper->set_keymap_for_device(device_id, conf.device_keymap());
1828- }
1829+ else
1830+ return;
1831+ key_mapper->set_keymap_for_device(device_id, conf.device_keymap());
1832+}
1833+
1834+void mi::DefaultDevice::disable_queue()
1835+{
1836+ std::lock_guard<std::mutex> lock(config_mutex);
1837+ actions.reset();
1838 }
1839
1840=== modified file 'src/server/input/default_device.h'
1841--- src/server/input/default_device.h 2017-01-18 02:29:37 +0000
1842+++ src/server/input/default_device.h 2017-06-05 10:39:04 +0000
1843@@ -29,6 +29,7 @@
1844 #include "mir/optional_value.h"
1845
1846 #include <memory>
1847+#include <mutex>
1848
1849 namespace mir
1850 {
1851@@ -58,6 +59,7 @@
1852 void apply_touchpad_configuration(MirTouchpadConfig const&) override;
1853 optional_value<MirKeyboardConfig> keyboard_configuration() const override;
1854 void apply_keyboard_configuration(MirKeyboardConfig const&) override;
1855+ void disable_queue();
1856 private:
1857 MirInputDeviceId const device_id;
1858 InputDevice& device;
1859@@ -65,8 +67,9 @@
1860 optional_value<PointerSettings> pointer;
1861 optional_value<TouchpadSettings> touchpad;
1862 optional_value<MirKeyboardConfig> keyboard;
1863- std::shared_ptr<dispatch::ActionQueue> const actions;
1864+ std::shared_ptr<dispatch::ActionQueue> actions;
1865 std::shared_ptr<KeyMapper> const key_mapper;
1866+ std::mutex mutable config_mutex;
1867 };
1868
1869 }
1870
1871=== modified file 'src/server/input/default_input_device_hub.cpp'
1872--- src/server/input/default_input_device_hub.cpp 2017-01-19 09:38:52 +0000
1873+++ src/server/input/default_input_device_hub.cpp 2017-06-05 10:39:04 +0000
1874@@ -99,15 +99,16 @@
1875 if (it == end(devices))
1876 {
1877 auto id = create_new_device_id();
1878- auto handle = std::make_shared<DefaultDevice>(id, device_queue, *device, key_mapper);
1879+ auto queue = std::make_shared<dispatch::ActionQueue>();
1880+ auto handle = std::make_shared<DefaultDevice>(id, queue, *device, key_mapper);
1881 // send input device info to observer loop..
1882 devices.push_back(std::make_unique<RegisteredDevice>(
1883- device, id, input_dispatchable, cookie_authority, handle));
1884+ device, handle->id(), queue, cookie_authority, handle));
1885
1886 auto const& dev = devices.back();
1887
1888 seat->add_device(*handle);
1889- dev->start(seat);
1890+ dev->start(seat, input_dispatchable);
1891
1892 // pass input device handle to observer loop..
1893 observer_queue->enqueue(this,
1894@@ -115,7 +116,6 @@
1895 {
1896 add_device_handle(handle);
1897 });
1898-
1899 }
1900 else
1901 {
1902@@ -140,7 +140,7 @@
1903 if (seat)
1904 {
1905 seat->remove_device(*item->handle);
1906- item->stop();
1907+ item->stop(input_dispatchable);
1908 }
1909 // send input device info to observer queue..
1910 observer_queue->enqueue(
1911@@ -166,14 +166,14 @@
1912 mi::DefaultInputDeviceHub::RegisteredDevice::RegisteredDevice(
1913 std::shared_ptr<InputDevice> const& dev,
1914 MirInputDeviceId device_id,
1915- std::shared_ptr<dispatch::MultiplexingDispatchable> const& multiplexer,
1916+ std::shared_ptr<dispatch::ActionQueue> const& queue,
1917 std::shared_ptr<mir::cookie::Authority> const& cookie_authority,
1918 std::shared_ptr<mi::DefaultDevice> const& handle)
1919 : handle(handle),
1920 device_id(device_id),
1921 cookie_authority(cookie_authority),
1922 device(dev),
1923- multiplexer(multiplexer)
1924+ queue(queue)
1925 {
1926 }
1927
1928@@ -206,17 +206,23 @@
1929 return dev == device;
1930 }
1931
1932-void mi::DefaultInputDeviceHub::RegisteredDevice::start(std::shared_ptr<Seat> const& seat)
1933+void mi::DefaultInputDeviceHub::RegisteredDevice::start(std::shared_ptr<Seat> const& seat, std::shared_ptr<dispatch::MultiplexingDispatchable> const& multiplexer)
1934 {
1935+ multiplexer->add_watch(queue);
1936+
1937 this->seat = seat;
1938 builder = std::make_unique<DefaultEventBuilder>(device_id, cookie_authority, seat);
1939 device->start(this, builder.get());
1940 }
1941
1942-void mi::DefaultInputDeviceHub::RegisteredDevice::stop()
1943+void mi::DefaultInputDeviceHub::RegisteredDevice::stop(std::shared_ptr<dispatch::MultiplexingDispatchable> const& multiplexer)
1944 {
1945+ multiplexer->remove_watch(queue);
1946+ handle->disable_queue();
1947+
1948 device->stop();
1949 seat = nullptr;
1950+ queue.reset();
1951 builder.reset();
1952 }
1953
1954
1955=== modified file 'src/server/input/default_input_device_hub.h'
1956--- src/server/input/default_input_device_hub.h 2017-01-19 09:38:52 +0000
1957+++ src/server/input/default_input_device_hub.h 2017-06-05 10:39:04 +0000
1958@@ -90,6 +90,7 @@
1959 void device_changed(Device* dev);
1960 void emit_changed_devices();
1961 MirInputDeviceId create_new_device_id();
1962+
1963 std::shared_ptr<Seat> const seat;
1964 std::shared_ptr<frontend::EventSink> const sink;
1965 std::shared_ptr<dispatch::MultiplexingDispatchable> const input_dispatchable;
1966@@ -105,14 +106,14 @@
1967 public:
1968 RegisteredDevice(std::shared_ptr<InputDevice> const& dev,
1969 MirInputDeviceId dev_id,
1970- std::shared_ptr<dispatch::MultiplexingDispatchable> const& multiplexer,
1971+ std::shared_ptr<dispatch::ActionQueue> const& multiplexer,
1972 std::shared_ptr<cookie::Authority> const& cookie_authority,
1973 std::shared_ptr<DefaultDevice> const& handle);
1974 void handle_input(MirEvent& event) override;
1975 mir::geometry::Rectangle bounding_rectangle() const override;
1976 bool device_matches(std::shared_ptr<InputDevice> const& dev) const;
1977- void start(std::shared_ptr<Seat> const& seat);
1978- void stop();
1979+ void start(std::shared_ptr<Seat> const& seat, std::shared_ptr<dispatch::MultiplexingDispatchable> const& dispatchable);
1980+ void stop(std::shared_ptr<dispatch::MultiplexingDispatchable> const& dispatchable);
1981 MirInputDeviceId id();
1982 std::shared_ptr<Seat> seat;
1983 const std::shared_ptr<DefaultDevice> handle;
1984@@ -124,7 +125,7 @@
1985 std::unique_ptr<DefaultEventBuilder> builder;
1986 std::shared_ptr<cookie::Authority> cookie_authority;
1987 std::shared_ptr<InputDevice> const device;
1988- std::shared_ptr<dispatch::MultiplexingDispatchable> const multiplexer;
1989+ std::shared_ptr<dispatch::ActionQueue> queue;
1990 };
1991
1992 std::vector<std::shared_ptr<Device>> handles;
1993
1994=== modified file 'tests/unit-tests/input/test_default_device.cpp'
1995--- tests/unit-tests/input/test_default_device.cpp 2017-01-18 02:29:37 +0000
1996+++ tests/unit-tests/input/test_default_device.cpp 2017-06-05 10:39:04 +0000
1997@@ -155,3 +155,26 @@
1998
1999 queue->dispatch(md::FdEvent::readable);
2000 }
2001+
2002+TEST_F(DefaultDevice, disable_queue_ends_config_processing)
2003+{
2004+ mi::DefaultDevice dev(MirInputDeviceId{17}, queue, touchpad, mt::fake_shared(key_mapper));
2005+
2006+ dev.disable_queue();
2007+ MirPointerConfig pointer_conf;
2008+ pointer_conf.cursor_acceleration_bias(1.0);
2009+
2010+ EXPECT_CALL(touchpad, apply_settings(Matcher<mi::TouchpadSettings const&>(_))).Times(0);
2011+ dev.apply_pointer_configuration(pointer_conf);
2012+}
2013+
2014+TEST_F(DefaultDevice, disable_queue_removes_reference_to_queue)
2015+{
2016+ std::weak_ptr<md::ActionQueue> ref = queue;
2017+ mi::DefaultDevice dev(MirInputDeviceId{17}, queue, touchpad, mt::fake_shared(key_mapper));
2018+ queue.reset();
2019+
2020+ EXPECT_THAT(ref.lock(), Ne(nullptr));
2021+ dev.disable_queue();
2022+ EXPECT_THAT(ref.lock(), Eq(nullptr));
2023+}
2024
2025=== modified file 'tests/unit-tests/input/test_default_input_device_hub.cpp'
2026--- tests/unit-tests/input/test_default_input_device_hub.cpp 2017-01-19 09:38:52 +0000
2027+++ tests/unit-tests/input/test_default_input_device_hub.cpp 2017-06-05 10:39:04 +0000
2028@@ -236,3 +236,21 @@
2029 observer_loop.trigger_server_actions();
2030 }
2031
2032+TEST_F(InputDeviceHubTest, no_device_config_action_after_device_removal)
2033+{
2034+ std::shared_ptr<mi::Device> dev_ptr;
2035+ MirPointerConfig ptr_config;
2036+ ptr_config.cursor_acceleration_bias(0.5);
2037+
2038+ ON_CALL(mock_observer, device_added(WithName("mouse"))).WillByDefault(SaveArg<0>(&dev_ptr));
2039+
2040+ hub.add_device(mt::fake_shared(mouse));
2041+ hub.add_observer(mt::fake_shared(mock_observer));
2042+ observer_loop.trigger_server_actions();
2043+
2044+ EXPECT_CALL(mouse, apply_settings(Matcher<mi::PointerSettings const&>(_))).Times(0);
2045+
2046+ dev_ptr->apply_pointer_configuration(ptr_config);
2047+ hub.remove_device(mt::fake_shared(mouse));
2048+ observer_loop.trigger_server_actions();
2049+}

Subscribers

People subscribed via source and target branches

to all changes: