Merge lp:~mir-team/miral/miral-0.26 into lp:miral/release
- miral-0.26
- Merge into release
Proposed by
Cemil Azizoglu
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Cemil Azizoglu | ||||||||
Approved revision: | 497 | ||||||||
Merged at revision: | 351 | ||||||||
Proposed branch: | lp:~mir-team/miral/miral-0.26 | ||||||||
Merge into: | lp:miral/release | ||||||||
Diff against target: |
4244 lines (+1486/-502) 52 files modified
CMakeLists.txt (+13/-9) debian/changelog (+17/-0) debian/control (+1/-0) debian/libmiral2.symbols (+8/-1) include/miral/canonical_window_manager.h (+1/-2) include/miral/detail/mir_forward_compatibility.h (+42/-0) include/miral/toolkit/persistent_id.h (+11/-1) include/miral/toolkit/window.h (+21/-14) include/miral/toolkit/window_spec.h (+136/-43) include/miral/window_info.h (+6/-6) include/miral/window_management_policy.h (+5/-3) include/miral/window_specification.h (+5/-5) miral-kiosk/kiosk_window_manager.cpp (+4/-4) miral-kiosk/sw_splash.cpp (+28/-3) miral-shell/miral-screencast.sh (+3/-1) miral-shell/spinner/eglapp.cpp (+37/-1) miral-shell/spinner/miregl.cpp (+58/-23) miral-shell/spinner/miregl.h (+4/-4) miral-shell/tiling_window_manager.cpp (+16/-16) miral-shell/tiling_window_manager.h (+3/-3) miral-shell/titlebar_provider.cpp (+28/-16) miral-shell/titlebar_provider.h (+4/-4) miral-shell/titlebar_window_manager.cpp (+12/-12) miral-shell/titlebar_window_manager.h (+3/-3) miral/CMakeLists.txt (+4/-3) miral/active_outputs.cpp (+5/-0) miral/basic_window_manager.cpp (+118/-115) miral/basic_window_manager.h (+2/-2) miral/both_versions.h (+48/-0) miral/canonical_window_manager.cpp (+8/-1) miral/coordinate_translator.cpp (+5/-0) miral/coordinate_translator.h (+10/-0) miral/keymap.cpp (+8/-1) miral/symbols.map (+41/-5) miral/window_info.cpp (+66/-51) miral/window_management_policy.cpp (+6/-1) miral/window_management_trace.cpp (+97/-45) miral/window_management_trace.h (+2/-2) miral/window_specification.cpp (+6/-6) scripts/process_doxygen_xml.py (+346/-3) test/CMakeLists.txt (+10/-7) test/active_window.cpp (+53/-16) test/display_reconfiguration.cpp (+4/-4) test/drag_active_window.cpp (+2/-2) test/modify_window_state.cpp (+15/-15) test/persistent_surface_store.cpp (+12/-12) test/raise_tree.cpp (+95/-0) test/select_active_window.cpp (+6/-6) test/test_window_manager_tools.h (+14/-13) test/window_placement.cpp (+3/-3) test/window_placement_anchors_to_parent.cpp (+1/-1) test/window_placement_client_api.cpp (+33/-14) |
||||||||
To merge this branch: | bzr merge lp:~mir-team/miral/miral-0.26 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Review via email: mp+315599@code.launchpad.net |
Commit message
Adaptations for Mir 0.26.
Description of the change
Adaptations for Mir 0.26.
To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) : | # |
review:
Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : | # |
> The hack for generating backward-compatible synonyms fails to account for the
> case of building against earlier versions of Mir. In which case it fails to
> generate forward-compatible synonyms.
>
> That is, MirAL 1.1 built against Mir 0.25 is not ABI compatible with MirAL 1.1
> built against Mir 0.26.
I've an MP against lp:miral that addresses this. My preference would be to land that (and anything else that's been approved) and re-sync this release branch.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : | # |
LGTM now
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-01-18 18:15:55 +0000 |
3 | +++ CMakeLists.txt 2017-01-26 16:46:42 +0000 |
4 | @@ -1,4 +1,4 @@ |
5 | -cmake_minimum_required(VERSION 3.0) |
6 | +cmake_minimum_required(VERSION 3.1) |
7 | project(miral) |
8 | |
9 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
10 | @@ -16,16 +16,20 @@ |
11 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
12 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
13 | |
14 | +set(CMAKE_CXX_STANDARD 14) |
15 | +set(CMAKE_CXX_STANDARD_REQUIRED on) |
16 | +set(CMAKE_CXX_EXTENSIONS off) |
17 | + |
18 | +set(CMAKE_C_STANDARD 99) |
19 | +set(CMAKE_C_STANDARD_REQUIRED on) |
20 | +set(CMAKE_C_EXTENSIONS off) |
21 | + |
22 | set(MIRAL_COMPILER_FLAGS "-pthread -g -Werror -Wall -pedantic -Wextra -fPIC") |
23 | set(MIRAL_LINKER_FLAGS "-Wl,-z,defs") |
24 | |
25 | -check_cxx_compiler_flag(-Wno-mismatched-tags MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS) |
26 | -if (MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS) |
27 | - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-mismatched-tags") |
28 | -endif() |
29 | - |
30 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MIRAL_COMPILER_FLAGS}") |
31 | -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MIRAL_COMPILER_FLAGS} -Wnon-virtual-dtor -std=c++14") |
32 | +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MIRAL_COMPILER_FLAGS} -Wnon-virtual-dtor") |
33 | +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long") # fix spurious FTBFS on X+O |
34 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}") |
35 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}") |
36 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}") |
37 | @@ -37,8 +41,8 @@ |
38 | include_directories(include SYSTEM ${MIRCLIENT_INCLUDE_DIRS}) |
39 | |
40 | set(MIRAL_VERSION_MAJOR 1) |
41 | -set(MIRAL_VERSION_MINOR 0) |
42 | -set(MIRAL_VERSION_PATCH 2) |
43 | +set(MIRAL_VERSION_MINOR 1) |
44 | +set(MIRAL_VERSION_PATCH 0) |
45 | |
46 | set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH}) |
47 | |
48 | |
49 | === modified file 'debian/changelog' |
50 | --- debian/changelog 2017-01-18 18:17:47 +0000 |
51 | +++ debian/changelog 2017-01-26 16:46:42 +0000 |
52 | @@ -1,3 +1,20 @@ |
53 | +miral (1.1.0) UNRELEASED; urgency=medium |
54 | + |
55 | + * New upstream release 1.1.0 (https://launchpad.net/miral/+milestone/1.1) |
56 | + - ABI summary: |
57 | + . miral ABI unchanged at 2 |
58 | + - Enhancements: |
59 | + . Compatibility with Mir 0.26 and update API to use the new Mir types and |
60 | + enums. |
61 | + . Logging of exceptions added to --window-management-trace |
62 | + . Rename WindowManagementPolicy::place_new_surface => place_new_window" |
63 | + - Bugs fixed: |
64 | + . top-level window is not raised along with its child (LP: #1658085) |
65 | + . miral-shell depends on default cursor theme being installed |
66 | + (LP: #1658159) |
67 | + |
68 | + -- Alan Griffiths <alan.griffiths@canonical.com> Wed, 14 Dec 2016 16:31:08 +0000 |
69 | + |
70 | miral (1.0.2+17.04.20170118.1-0ubuntu1) zesty; urgency=medium |
71 | |
72 | * New upstream release 1.0.1 (https://launchpad.net/miral/+milestone/1.0) |
73 | |
74 | === modified file 'debian/control' |
75 | --- debian/control 2016-12-20 15:45:29 +0000 |
76 | +++ debian/control 2017-01-26 16:46:42 +0000 |
77 | @@ -63,6 +63,7 @@ |
78 | Architecture: linux-any |
79 | Depends: ${misc:Depends}, |
80 | ${shlibs:Depends}, |
81 | +Recommends: dmz-cursor-theme, |
82 | Description: Display server for Ubuntu - demonstration programs |
83 | MirAL provides an ABI-stable abstraction layer for Mir based shells, |
84 | insulating them from mirserver ABI breaks. |
85 | |
86 | === modified file 'debian/libmiral2.symbols' |
87 | --- debian/libmiral2.symbols 2016-12-13 13:07:15 +0000 |
88 | +++ debian/libmiral2.symbols 2017-01-26 16:46:42 +0000 |
89 | @@ -354,4 +354,11 @@ |
90 | (c++)"typeinfo for miral::CanonicalWindowManagerPolicy@MIRAL_1.0" 1.0.0 |
91 | (c++)"vtable for miral::ActiveOutputsListener@MIRAL_1.0" 1.0.0 |
92 | (c++)"vtable for miral::WindowManagementPolicy@MIRAL_1.0" 1.0.0 |
93 | - (c++)"vtable for miral::CanonicalWindowManagerPolicy@MIRAL_1.0" 1.0.0 |
94 | \ No newline at end of file |
95 | + (c++)"vtable for miral::CanonicalWindowManagerPolicy@MIRAL_1.0" 1.0.0 |
96 | + MIRAL_1.1@MIRAL_1.1 1.1.0 |
97 | + (c++)"miral::WindowInfo::needs_titlebar(MirWindowType)@MIRAL_1.1" 1.1.0 |
98 | + (c++)"miral::WindowInfo::type(MirWindowType)@MIRAL_1.1" 1.1.0 |
99 | + (c++)"miral::WindowInfo::state(MirWindowState)@MIRAL_1.1" 1.1.0 |
100 | + (c++)"miral::WindowManagementPolicy::advise_state_change(miral::WindowInfo const&, MirWindowState)@MIRAL_1.1" 1.1.0 |
101 | + (c++)"miral::WindowInfo::can_morph_to(MirWindowType) const@MIRAL_1.1" 1.1.0 |
102 | + (c++)"miral::CanonicalWindowManagerPolicy::place_new_window(miral::ApplicationInfo const&, miral::WindowSpecification const&)@MIRAL_1.1" 1.1.0 |
103 | \ No newline at end of file |
104 | |
105 | === modified file 'include/miral/canonical_window_manager.h' |
106 | --- include/miral/canonical_window_manager.h 2016-12-05 09:46:35 +0000 |
107 | +++ include/miral/canonical_window_manager.h 2017-01-26 16:46:42 +0000 |
108 | @@ -31,8 +31,7 @@ |
109 | |
110 | explicit CanonicalWindowManagerPolicy(WindowManagerTools const& tools); |
111 | |
112 | - /// places the surfaces as requested |
113 | - auto place_new_surface( |
114 | + auto place_new_window( |
115 | ApplicationInfo const& app_info, |
116 | WindowSpecification const& request_parameters) |
117 | -> WindowSpecification override; |
118 | |
119 | === modified file 'include/miral/detail/mir_forward_compatibility.h' |
120 | --- include/miral/detail/mir_forward_compatibility.h 2016-09-23 13:59:34 +0000 |
121 | +++ include/miral/detail/mir_forward_compatibility.h 2017-01-26 16:46:42 +0000 |
122 | @@ -20,8 +20,50 @@ |
123 | #define MIRAL_MIR_FORWARD_COMPATIBILITY_H |
124 | |
125 | #include <mir_toolkit/version.h> |
126 | +#include <mir_toolkit/common.h> |
127 | #include <miral/detail/mir_features.h> |
128 | |
129 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
130 | +using MirWindowAttrib = MirSurfaceAttrib; |
131 | +auto const mir_window_attrib_type = mir_surface_attrib_type; |
132 | +auto const mir_window_attrib_state = mir_surface_attrib_state; |
133 | +auto const mir_window_attrib_swapinterval = mir_surface_attrib_swapinterval; |
134 | +auto const mir_window_attrib_focus = mir_surface_attrib_focus; |
135 | +auto const mir_window_attrib_dpi = mir_surface_attrib_dpi; |
136 | +auto const mir_window_attrib_visibility = mir_surface_attrib_visibility; |
137 | +auto const mir_window_attrib_preferred_orientation = mir_surface_attrib_preferred_orientation; |
138 | +auto const mir_window_attribs = mir_surface_attribs; |
139 | + |
140 | +using MirWindowType = MirSurfaceType; |
141 | +auto const mir_window_type_normal = mir_surface_type_normal; |
142 | +auto const mir_window_type_utility = mir_surface_type_utility; |
143 | +auto const mir_window_type_dialog = mir_surface_type_dialog; |
144 | +auto const mir_window_type_gloss = mir_surface_type_gloss; |
145 | +auto const mir_window_type_freestyle = mir_surface_type_freestyle; |
146 | +auto const mir_window_type_menu = mir_surface_type_menu; |
147 | +auto const mir_window_type_inputmethod = mir_surface_type_inputmethod; |
148 | +auto const mir_window_type_satellite = mir_surface_type_satellite; |
149 | +auto const mir_window_type_tip = mir_surface_type_tip; |
150 | +auto const mir_window_types = mir_surface_types; |
151 | + |
152 | +using MirWindowState = MirSurfaceState; |
153 | +auto const mir_window_state_unknown = mir_surface_state_unknown; |
154 | +auto const mir_window_state_restored = mir_surface_state_restored; |
155 | +auto const mir_window_state_minimized = mir_surface_state_minimized; |
156 | +auto const mir_window_state_maximized = mir_surface_state_maximized; |
157 | +auto const mir_window_state_vertmaximized = mir_surface_state_vertmaximized; |
158 | +auto const mir_window_state_fullscreen = mir_surface_state_fullscreen; |
159 | +auto const mir_window_state_horizmaximized = mir_surface_state_horizmaximized; |
160 | +auto const mir_window_state_hidden = mir_surface_state_hidden; |
161 | +auto const mir_window_states = mir_surface_states; |
162 | + |
163 | +typedef struct MirSurface MirWindow; |
164 | +typedef struct MirSurfaceParameters MirWindowParameters; |
165 | +typedef struct MirSurfacePlacementEvent MirWindowPlacementEvent; |
166 | +typedef struct MirSurfaceSpec MirWindowSpec; |
167 | +#endif |
168 | + |
169 | + |
170 | // Types that don't exist in earlier versions of Mir's toolkit |
171 | #if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 4, 0) |
172 | |
173 | |
174 | === modified file 'include/miral/toolkit/persistent_id.h' |
175 | --- include/miral/toolkit/persistent_id.h 2016-08-11 10:53:11 +0000 |
176 | +++ include/miral/toolkit/persistent_id.h 2017-01-26 16:46:42 +0000 |
177 | @@ -19,7 +19,13 @@ |
178 | #ifndef MIRAL_TOOLKIT_PERSISTENT_ID_H |
179 | #define MIRAL_TOOLKIT_PERSISTENT_ID_H |
180 | |
181 | +#include <miral/detail/mir_forward_compatibility.h> |
182 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
183 | #include <mir_toolkit/mir_surface.h> |
184 | +#else |
185 | +#include <mir_toolkit/mir_window.h> |
186 | +#include <mir_toolkit/mir_persistent_id.h> |
187 | +#endif |
188 | |
189 | #include <memory> |
190 | |
191 | @@ -32,7 +38,11 @@ |
192 | { |
193 | public: |
194 | explicit PersistentId(MirPersistentId* id) : self{id, deleter} {} |
195 | - explicit PersistentId(MirSurface* surface) : PersistentId{mir_surface_request_persistent_id_sync(surface)} {} |
196 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
197 | + explicit PersistentId(MirWindow* surface) : PersistentId{mir_surface_request_persistent_id_sync(surface)} {} |
198 | +#else |
199 | + explicit PersistentId(MirWindow* surface) : PersistentId{mir_window_request_persistent_id_sync(surface)} {} |
200 | +#endif |
201 | |
202 | auto c_str() const -> char const* { return mir_persistent_id_as_string(self.get()); } |
203 | |
204 | |
205 | === renamed file 'include/miral/toolkit/surface.h' => 'include/miral/toolkit/window.h' |
206 | --- include/miral/toolkit/surface.h 2016-09-13 17:09:04 +0000 |
207 | +++ include/miral/toolkit/window.h 2017-01-26 16:46:42 +0000 |
208 | @@ -1,5 +1,5 @@ |
209 | /* |
210 | - * Copyright © 2016 Canonical Ltd. |
211 | + * Copyright © 2016-2017 Canonical Ltd. |
212 | * |
213 | * This program is free software: you can redistribute it and/or modify it |
214 | * under the terms of the GNU General Public License version 3, |
215 | @@ -16,10 +16,17 @@ |
216 | * Authored by: Alan Griffiths <alan@octopull.co.uk> |
217 | */ |
218 | |
219 | -#ifndef MIRAL_TOOLKIT_SURFACE_H |
220 | -#define MIRAL_TOOLKIT_SURFACE_H |
221 | - |
222 | +#ifndef MIRAL_TOOLKIT_WINDOW_H |
223 | +#define MIRAL_TOOLKIT_WINDOW_H |
224 | + |
225 | +#include <miral/detail/mir_forward_compatibility.h> |
226 | + |
227 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
228 | #include <mir_toolkit/mir_surface.h> |
229 | +auto const mir_window_release_sync = mir_surface_release_sync; |
230 | +#else |
231 | +#include <mir_toolkit/mir_window.h> |
232 | +#endif |
233 | |
234 | #include <memory> |
235 | |
236 | @@ -27,23 +34,23 @@ |
237 | { |
238 | namespace toolkit |
239 | { |
240 | -/// Handle class for MirSurface - provides automatic reference counting. |
241 | -class Surface |
242 | +/// Handle class for MirWindow - provides automatic reference counting. |
243 | +class Window |
244 | { |
245 | public: |
246 | - Surface() = default; |
247 | - explicit Surface(MirSurface* spec) : self{spec, deleter} {} |
248 | - |
249 | - |
250 | - operator MirSurface*() const { return self.get(); } |
251 | + Window() = default; |
252 | + explicit Window(MirWindow* spec) : self{spec, deleter} {} |
253 | + |
254 | + |
255 | + operator MirWindow*() const { return self.get(); } |
256 | |
257 | void reset() { self.reset(); } |
258 | |
259 | private: |
260 | - static void deleter(MirSurface* surface) { mir_surface_release_sync(surface); } |
261 | - std::shared_ptr<MirSurface> self; |
262 | + static void deleter(MirWindow* window) { mir_window_release_sync(window); } |
263 | + std::shared_ptr<MirWindow> self; |
264 | }; |
265 | } |
266 | } |
267 | |
268 | -#endif //MIRAL_TOOLKIT_SURFACE_H |
269 | +#endif //MIRAL_TOOLKIT_WINDOW_H |
270 | |
271 | === renamed file 'include/miral/toolkit/surface_spec.h' => 'include/miral/toolkit/window_spec.h' |
272 | --- include/miral/toolkit/surface_spec.h 2016-11-30 08:22:39 +0000 |
273 | +++ include/miral/toolkit/window_spec.h 2017-01-26 16:46:42 +0000 |
274 | @@ -16,10 +16,11 @@ |
275 | * Authored by: Alan Griffiths <alan@octopull.co.uk> |
276 | */ |
277 | |
278 | -#ifndef MIRAL_TOOLKIT_SURFACE_SPEC_H |
279 | -#define MIRAL_TOOLKIT_SURFACE_SPEC_H |
280 | +#ifndef MIRAL_TOOLKIT_WINDOW_SPEC_H |
281 | +#define MIRAL_TOOLKIT_WINDOW_SPEC_H |
282 | |
283 | -#include <miral/toolkit/surface.h> |
284 | +#include <miral/toolkit/window.h> |
285 | +#include <miral/detail/mir_forward_compatibility.h> |
286 | |
287 | #include <mir_toolkit/mir_surface.h> |
288 | #include <mir_toolkit/mir_connection.h> |
289 | @@ -31,26 +32,38 @@ |
290 | { |
291 | namespace toolkit |
292 | { |
293 | -/// Handle class for MirSurfaceSpec - provides automatic reference counting, method chaining. |
294 | -class SurfaceSpec |
295 | +/// Handle class for MirWindowSpec - provides automatic reference counting, method chaining. |
296 | +class WindowSpec |
297 | { |
298 | public: |
299 | - explicit SurfaceSpec(MirSurfaceSpec* spec) : self{spec, deleter} {} |
300 | + explicit WindowSpec(MirWindowSpec* spec) : self{spec, deleter} {} |
301 | |
302 | - static auto for_normal_surface(MirConnection* connection, int width, int height, MirPixelFormat format) -> SurfaceSpec |
303 | + static auto for_normal_surface(MirConnection* connection, int width, int height, MirPixelFormat format) -> WindowSpec |
304 | { |
305 | - return SurfaceSpec{mir_connection_create_spec_for_normal_surface(connection, width, height, format)}; |
306 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
307 | + return WindowSpec{mir_connection_create_spec_for_normal_surface(connection, width, height, format)}; |
308 | +#else |
309 | + auto spec = WindowSpec{mir_create_normal_window_spec(connection, width, height)}; |
310 | + mir_window_spec_set_pixel_format(spec, format); |
311 | + return spec; |
312 | +#endif |
313 | } |
314 | |
315 | static auto for_menu(MirConnection* connection, |
316 | int width, |
317 | int height, |
318 | MirPixelFormat format, |
319 | - MirSurface* parent, |
320 | + MirWindow* parent, |
321 | MirRectangle* rect, |
322 | - MirEdgeAttachment edge) -> SurfaceSpec |
323 | + MirEdgeAttachment edge) -> WindowSpec |
324 | { |
325 | - return SurfaceSpec{mir_connection_create_spec_for_menu(connection, width, height, format, parent, rect, edge)}; |
326 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
327 | + return WindowSpec{mir_connection_create_spec_for_menu(connection, width, height, format, parent, rect, edge)}; |
328 | +#else |
329 | + auto spec = WindowSpec{mir_create_menu_window_spec(connection, width, height, parent, rect, edge)}; |
330 | + mir_window_spec_set_pixel_format(spec, format); |
331 | + return spec; |
332 | +#endif |
333 | } |
334 | |
335 | #if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0) |
336 | @@ -58,87 +71,143 @@ |
337 | int width, |
338 | int height, |
339 | MirPixelFormat format, |
340 | - MirSurface* parent, |
341 | + MirWindow* parent, |
342 | MirRectangle* rect, |
343 | - MirEdgeAttachment edge) -> SurfaceSpec |
344 | + MirEdgeAttachment edge) -> WindowSpec |
345 | { |
346 | - return SurfaceSpec{mir_connection_create_spec_for_tip(connection, width, height, format, parent, rect, edge)}; |
347 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
348 | + return WindowSpec{mir_connection_create_spec_for_tip(connection, width, height, format, parent, rect, edge)}; |
349 | +#else |
350 | + auto spec = WindowSpec{mir_create_tip_window_spec(connection, width, height, parent, rect, edge)}; |
351 | + mir_window_spec_set_pixel_format(spec, format); |
352 | + return spec; |
353 | +#endif |
354 | } |
355 | #endif |
356 | |
357 | static auto for_dialog(MirConnection* connection, |
358 | int width, |
359 | int height, |
360 | - MirPixelFormat format)-> SurfaceSpec |
361 | + MirPixelFormat format)-> WindowSpec |
362 | { |
363 | - return SurfaceSpec{mir_connection_create_spec_for_dialog(connection, width, height, format)}; |
364 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
365 | + return WindowSpec{mir_connection_create_spec_for_dialog(connection, width, height, format)}; |
366 | +#else |
367 | + auto spec = WindowSpec{mir_create_dialog_window_spec(connection, width, height)}; |
368 | + mir_window_spec_set_pixel_format(spec, format); |
369 | + return spec; |
370 | +#endif |
371 | } |
372 | |
373 | static auto for_dialog(MirConnection* connection, |
374 | int width, |
375 | int height, |
376 | MirPixelFormat format, |
377 | - MirSurface* parent) -> SurfaceSpec |
378 | + MirWindow* parent) -> WindowSpec |
379 | { |
380 | return for_dialog(connection, width, height, format).set_parent(parent); |
381 | } |
382 | |
383 | - static auto for_changes(MirConnection* connection) -> SurfaceSpec |
384 | + static auto for_changes(MirConnection* connection) -> WindowSpec |
385 | { |
386 | - return SurfaceSpec{mir_connection_create_spec_for_changes(connection)}; |
387 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
388 | + return WindowSpec{mir_connection_create_spec_for_changes(connection)}; |
389 | +#else |
390 | + return WindowSpec{mir_create_window_spec(connection)}; |
391 | +#endif |
392 | } |
393 | |
394 | - auto set_buffer_usage(MirBufferUsage usage) -> SurfaceSpec& |
395 | + auto set_buffer_usage(MirBufferUsage usage) -> WindowSpec& |
396 | { |
397 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
398 | mir_surface_spec_set_buffer_usage(*this, usage); |
399 | +#else |
400 | + mir_window_spec_set_buffer_usage(*this, usage); |
401 | +#endif |
402 | return *this; |
403 | } |
404 | |
405 | - auto set_type(MirSurfaceType type) -> SurfaceSpec& |
406 | + auto set_type(MirWindowType type) -> WindowSpec& |
407 | { |
408 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
409 | mir_surface_spec_set_type(*this, type); |
410 | +#else |
411 | + mir_window_spec_set_type(*this, type); |
412 | +#endif |
413 | return *this; |
414 | } |
415 | |
416 | - auto set_min_size(int min_width, int min_height) -> SurfaceSpec& |
417 | + auto set_min_size(int min_width, int min_height) -> WindowSpec& |
418 | { |
419 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
420 | mir_surface_spec_set_min_width(*this, min_width); |
421 | mir_surface_spec_set_min_height(*this, min_height); |
422 | +#else |
423 | + mir_window_spec_set_min_width(*this, min_width); |
424 | + mir_window_spec_set_min_height(*this, min_height); |
425 | +#endif |
426 | return *this; |
427 | } |
428 | |
429 | - auto set_max_size(int max_width, int max_height) -> SurfaceSpec& |
430 | + auto set_max_size(int max_width, int max_height) -> WindowSpec& |
431 | { |
432 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
433 | mir_surface_spec_set_max_width(*this, max_width); |
434 | mir_surface_spec_set_max_height(*this, max_height); |
435 | +#else |
436 | + mir_window_spec_set_max_width(*this, max_width); |
437 | + mir_window_spec_set_max_height(*this, max_height); |
438 | +#endif |
439 | return *this; |
440 | } |
441 | |
442 | - auto set_size_inc(int width_inc, int height_inc) -> SurfaceSpec& |
443 | + auto set_size_inc(int width_inc, int height_inc) -> WindowSpec& |
444 | { |
445 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
446 | mir_surface_spec_set_width_increment(*this, width_inc); |
447 | mir_surface_spec_set_height_increment(*this, height_inc); |
448 | +#else |
449 | + mir_window_spec_set_width_increment(*this, width_inc); |
450 | + mir_window_spec_set_height_increment(*this, height_inc); |
451 | +#endif |
452 | return *this; |
453 | } |
454 | |
455 | - auto set_size(int width, int height) -> SurfaceSpec& |
456 | + auto set_size(int width, int height) -> WindowSpec& |
457 | { |
458 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
459 | mir_surface_spec_set_width(*this, width); |
460 | mir_surface_spec_set_height(*this, height); |
461 | +#else |
462 | + mir_window_spec_set_width(*this, width); |
463 | + mir_window_spec_set_height(*this, height); |
464 | +#endif |
465 | return *this; |
466 | } |
467 | |
468 | - auto set_name(char const* name) -> SurfaceSpec& |
469 | + auto set_name(char const* name) -> WindowSpec& |
470 | { |
471 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
472 | mir_surface_spec_set_name(*this, name); |
473 | +#else |
474 | + mir_window_spec_set_name(*this, name); |
475 | +#endif |
476 | return *this; |
477 | } |
478 | |
479 | - auto set_event_handler(mir_surface_event_callback callback, void* context) -> SurfaceSpec& |
480 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
481 | + auto set_event_handler(mir_surface_event_callback callback, void* context) -> WindowSpec& |
482 | { |
483 | mir_surface_spec_set_event_handler(*this, callback, context); |
484 | return *this; |
485 | } |
486 | +#else |
487 | + auto set_event_handler(MirWindowEventCallback callback, void* context) -> WindowSpec& |
488 | + { |
489 | + mir_window_spec_set_event_handler(*this, callback, context); |
490 | + return *this; |
491 | + } |
492 | +#endif |
493 | |
494 | #if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0) |
495 | auto set_placement(const MirRectangle* rect, |
496 | @@ -146,42 +215,66 @@ |
497 | MirPlacementGravity surface_gravity, |
498 | MirPlacementHints placement_hints, |
499 | int offset_dx, |
500 | - int offset_dy) -> SurfaceSpec& |
501 | + int offset_dy) -> WindowSpec& |
502 | { |
503 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
504 | mir_surface_spec_set_placement(*this, rect, rect_gravity, surface_gravity, placement_hints, offset_dx, offset_dy); |
505 | +#else |
506 | + mir_window_spec_set_placement(*this, rect, rect_gravity, surface_gravity, placement_hints, offset_dx, offset_dy); |
507 | +#endif |
508 | return *this; |
509 | } |
510 | #endif |
511 | |
512 | - auto set_parent(MirSurface* parent) -> SurfaceSpec& |
513 | + auto set_parent(MirWindow* parent) -> WindowSpec& |
514 | { |
515 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
516 | mir_surface_spec_set_parent(*this, parent); |
517 | +#else |
518 | + mir_window_spec_set_parent(*this, parent); |
519 | +#endif |
520 | return *this; |
521 | } |
522 | |
523 | template<typename Context> |
524 | - void create_surface(void (*callback)(MirSurface*, Context*), Context* context) const |
525 | + void create_surface(void (*callback)(MirWindow*, Context*), Context* context) const |
526 | { |
527 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
528 | mir_surface_create(*this, reinterpret_cast<mir_surface_callback>(callback), context); |
529 | - } |
530 | - |
531 | - auto create_surface() const -> Surface |
532 | - { |
533 | - return Surface{mir_surface_create_sync(*this)}; |
534 | - } |
535 | - |
536 | - void apply_to(MirSurface* surface) const |
537 | - { |
538 | +#else |
539 | + mir_create_window(*this, reinterpret_cast<MirWindowCallback>(callback), context); |
540 | +#endif |
541 | + } |
542 | + |
543 | + auto create_surface() const -> Window |
544 | + { |
545 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
546 | + return Window{mir_surface_create_sync(*this)}; |
547 | +#else |
548 | + return Window{mir_create_window_sync(*this)}; |
549 | +#endif |
550 | + } |
551 | + |
552 | + void apply_to(MirWindow* surface) const |
553 | + { |
554 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
555 | mir_surface_apply_spec(surface, *this); |
556 | +#else |
557 | + mir_window_apply_spec(surface, *this); |
558 | +#endif |
559 | } |
560 | |
561 | - operator MirSurfaceSpec*() const { return self.get(); } |
562 | + operator MirWindowSpec*() const { return self.get(); } |
563 | |
564 | private: |
565 | - static void deleter(MirSurfaceSpec* spec) { mir_surface_spec_release(spec); } |
566 | - std::shared_ptr<MirSurfaceSpec> self; |
567 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
568 | + static void deleter(MirWindowSpec* spec) { mir_surface_spec_release(spec); } |
569 | +#else |
570 | + static void deleter(MirWindowSpec* spec) { mir_window_spec_release(spec); } |
571 | +#endif |
572 | + std::shared_ptr<MirWindowSpec> self; |
573 | }; |
574 | } |
575 | } |
576 | |
577 | -#endif //MIRAL_TOOLKIT_SURFACE_SPEC_H_H |
578 | +#endif //MIRAL_TOOLKIT_WINDOW_SPEC_H_H |
579 | |
580 | === modified file 'include/miral/window_info.h' |
581 | --- include/miral/window_info.h 2016-12-13 13:07:15 +0000 |
582 | +++ include/miral/window_info.h 2017-01-26 16:46:42 +0000 |
583 | @@ -41,7 +41,7 @@ |
584 | |
585 | bool can_be_active() const; |
586 | |
587 | - bool can_morph_to(MirSurfaceType new_type) const; |
588 | + bool can_morph_to(MirWindowType new_type) const; |
589 | |
590 | bool must_have_parent() const; |
591 | |
592 | @@ -49,7 +49,7 @@ |
593 | |
594 | bool is_visible() const; |
595 | |
596 | - static bool needs_titlebar(MirSurfaceType type); |
597 | + static bool needs_titlebar(MirWindowType type); |
598 | |
599 | void constrain_resize(mir::geometry::Point& requested_pos, mir::geometry::Size& requested_size) const; |
600 | |
601 | @@ -58,11 +58,11 @@ |
602 | auto name() const -> std::string; |
603 | void name(std::string const& name); |
604 | |
605 | - auto type() const -> MirSurfaceType; |
606 | - void type(MirSurfaceType type); |
607 | + auto type() const -> MirWindowType; |
608 | + void type(MirWindowType type); |
609 | |
610 | - auto state() const -> MirSurfaceState; |
611 | - void state(MirSurfaceState state); |
612 | + auto state() const -> MirWindowState; |
613 | + void state(MirWindowState state); |
614 | |
615 | auto restore_rect() const -> mir::geometry::Rectangle; |
616 | void restore_rect(mir::geometry::Rectangle const& restore_rect); |
617 | |
618 | === modified file 'include/miral/window_management_policy.h' |
619 | --- include/miral/window_management_policy.h 2016-12-05 09:46:35 +0000 |
620 | +++ include/miral/window_management_policy.h 2017-01-26 16:46:42 +0000 |
621 | @@ -23,6 +23,8 @@ |
622 | #include <mir/geometry/rectangles.h> |
623 | #include <mir_toolkit/event.h> |
624 | |
625 | +#include <miral/detail/mir_forward_compatibility.h> |
626 | + |
627 | namespace miral |
628 | { |
629 | class Window; |
630 | @@ -44,11 +46,11 @@ |
631 | |
632 | /** Customize initial window placement |
633 | * |
634 | - * @param app_info the application requesting a new surface |
635 | + * @param app_info the application requesting a new window |
636 | * @param requested_specification the requested specification (updated with default placement) |
637 | * @return the customized specification |
638 | */ |
639 | - virtual auto place_new_surface( |
640 | + virtual auto place_new_window( |
641 | ApplicationInfo const& app_info, |
642 | WindowSpecification const& requested_specification) -> WindowSpecification = 0; |
643 | |
644 | @@ -141,7 +143,7 @@ |
645 | * @param window_info the window |
646 | * @param state the new state |
647 | */ |
648 | - virtual void advise_state_change(WindowInfo const& window_info, MirSurfaceState state); |
649 | + virtual void advise_state_change(WindowInfo const& window_info, MirWindowState state); |
650 | |
651 | /** Notification that a window is about to move |
652 | * |
653 | |
654 | === modified file 'include/miral/window_specification.h' |
655 | --- include/miral/window_specification.h 2016-09-30 16:29:43 +0000 |
656 | +++ include/miral/window_specification.h 2017-01-26 16:46:42 +0000 |
657 | @@ -21,7 +21,7 @@ |
658 | |
659 | #include <mir_toolkit/common.h> |
660 | |
661 | -#include "miral/detail/mir_forward_compatibility.h" |
662 | +#include <miral/detail/mir_forward_compatibility.h> |
663 | |
664 | #include <mir/geometry/displacement.h> |
665 | #include <mir/geometry/rectangles.h> |
666 | @@ -76,8 +76,8 @@ |
667 | auto size() const -> mir::optional_value<Size> const&; |
668 | auto name() const -> mir::optional_value<std::string> const&; |
669 | auto output_id() const -> mir::optional_value<int> const&; |
670 | - auto type() const -> mir::optional_value<MirSurfaceType> const&; |
671 | - auto state() const -> mir::optional_value<MirSurfaceState> const&; |
672 | + auto type() const -> mir::optional_value<MirWindowType> const&; |
673 | + auto state() const -> mir::optional_value<MirWindowState> const&; |
674 | auto preferred_orientation() const -> mir::optional_value<MirOrientationMode> const&; |
675 | auto aux_rect() const -> mir::optional_value<Rectangle> const&; |
676 | auto placement_hints() const -> mir::optional_value<MirPlacementHints> const&; |
677 | @@ -104,8 +104,8 @@ |
678 | auto size() -> mir::optional_value<Size>&; |
679 | auto name() -> mir::optional_value<std::string>&; |
680 | auto output_id() -> mir::optional_value<int>&; |
681 | - auto type() -> mir::optional_value<MirSurfaceType>&; |
682 | - auto state() -> mir::optional_value<MirSurfaceState>&; |
683 | + auto type() -> mir::optional_value<MirWindowType>&; |
684 | + auto state() -> mir::optional_value<MirWindowState>&; |
685 | auto preferred_orientation() -> mir::optional_value<MirOrientationMode>&; |
686 | auto aux_rect() -> mir::optional_value<Rectangle>&; |
687 | auto placement_hints() -> mir::optional_value<MirPlacementHints>&; |
688 | |
689 | === modified file 'miral-kiosk/kiosk_window_manager.cpp' |
690 | --- miral-kiosk/kiosk_window_manager.cpp 2016-11-08 11:16:10 +0000 |
691 | +++ miral-kiosk/kiosk_window_manager.cpp 2017-01-26 16:46:42 +0000 |
692 | @@ -125,16 +125,16 @@ |
693 | |
694 | void KioskWindowManagerPolicy::advise_new_window(WindowInfo const& window_info) |
695 | { |
696 | - // We do this here, not in place_new_surface() so that clients get a resize event. |
697 | + // We do this here, not in place_new_window() so that clients get a resize event. |
698 | // This shouldn't be necessary, but works better with the gtk-mir backend. |
699 | if (maximize_root_windows && |
700 | - window_info.type() == mir_surface_type_normal && |
701 | + window_info.type() == mir_window_type_normal && |
702 | !window_info.parent() && |
703 | - window_info.state() == mir_surface_state_restored) |
704 | + window_info.state() == mir_window_state_restored) |
705 | { |
706 | WindowSpecification specification; |
707 | |
708 | - specification.state() = mir_surface_state_maximized; |
709 | + specification.state() = mir_window_state_maximized; |
710 | |
711 | tools.place_and_size_for_state(specification, window_info); |
712 | tools.modify_window(window_info.window(), specification); |
713 | |
714 | === modified file 'miral-kiosk/sw_splash.cpp' |
715 | --- miral-kiosk/sw_splash.cpp 2016-05-11 11:45:10 +0000 |
716 | +++ miral-kiosk/sw_splash.cpp 2017-01-26 16:46:42 +0000 |
717 | @@ -18,8 +18,14 @@ |
718 | |
719 | #include "sw_splash.h" |
720 | |
721 | +#include <miral/detail/mir_forward_compatibility.h> |
722 | + |
723 | #include <mir_toolkit/mir_connection.h> |
724 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
725 | #include <mir_toolkit/mir_surface.h> |
726 | +#else |
727 | +#include <mir_toolkit/mir_window.h> |
728 | +#endif |
729 | #include <mir_toolkit/mir_buffer_stream.h> |
730 | |
731 | #include <chrono> |
732 | @@ -59,9 +65,9 @@ |
733 | return *pixel_formats; |
734 | } |
735 | |
736 | -auto create_surface(MirConnection* connection, MirPixelFormat pixel_format) -> MirSurface* |
737 | +auto create_window(MirConnection* connection, MirPixelFormat pixel_format) -> MirWindow* |
738 | { |
739 | - |
740 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
741 | auto* spec = mir_connection_create_spec_for_normal_surface(connection, 42, 42, pixel_format); |
742 | |
743 | mir_surface_spec_set_name(spec, "splash"); |
744 | @@ -70,6 +76,17 @@ |
745 | |
746 | auto const surface = mir_surface_create_sync(spec); |
747 | mir_surface_spec_release(spec); |
748 | +#else |
749 | + auto* spec = mir_create_normal_window_spec(connection, 42, 42); |
750 | + |
751 | + mir_window_spec_set_name(spec, "splash"); |
752 | + mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software); |
753 | + mir_window_spec_set_fullscreen_on_output(spec, 0); |
754 | + mir_window_spec_set_pixel_format(spec, pixel_format); |
755 | + |
756 | + auto const surface = mir_create_window_sync(spec); |
757 | + mir_window_spec_release(spec); |
758 | +#endif |
759 | |
760 | return surface; |
761 | } |
762 | @@ -133,10 +150,14 @@ |
763 | return; |
764 | }; |
765 | |
766 | - auto const surface = create_surface(connection, pixel_format); |
767 | + auto const surface = create_window(connection, pixel_format); |
768 | |
769 | MirGraphicsRegion graphics_region; |
770 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
771 | MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface); |
772 | +#else |
773 | + MirBufferStream* buffer_stream = mir_window_get_buffer_stream(surface); |
774 | +#endif |
775 | |
776 | auto const time_limit = std::chrono::steady_clock::now() + std::chrono::seconds(2); |
777 | |
778 | @@ -154,5 +175,9 @@ |
779 | } |
780 | while (std::chrono::steady_clock::now() < time_limit); |
781 | |
782 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
783 | mir_surface_release_sync(surface); |
784 | +#else |
785 | + mir_window_release_sync(surface); |
786 | +#endif |
787 | } |
788 | |
789 | === modified file 'miral-shell/miral-screencast.sh' |
790 | --- miral-shell/miral-screencast.sh 2016-11-10 15:10:32 +0000 |
791 | +++ miral-shell/miral-screencast.sh 2017-01-26 16:46:42 +0000 |
792 | @@ -16,11 +16,13 @@ |
793 | echo " --height set the capture height [${height}]" |
794 | echo " --output set the output filename [${output}]" |
795 | echo " --socket set the mir socket [${socket}]" |
796 | + echo " --tmpfile specify the temporary work file" |
797 | exit 0 |
798 | elif [ "$1" == "--socket" ]; then shift; socket=$1 |
799 | elif [ "$1" == "--output" ]; then shift; output=$1 |
800 | elif [ "$1" == "--width" ]; then shift; width=$1 |
801 | elif [ "$1" == "--height" ]; then shift; height=$1 |
802 | + elif [ "$1" == "--tmpfile" ]; then shift; tempfile=$1 |
803 | fi |
804 | shift |
805 | done |
806 | @@ -36,7 +38,7 @@ |
807 | if [ -e ${output} ]; then echo "Output exists, moving to ${output}~"; mv ${output} ${output}~ ;fi |
808 | while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done |
809 | |
810 | -tempfile=$(mktemp) |
811 | +if [ ! -v tempfile ]; then tempfile=$(mktemp); fi |
812 | mirscreencast --size ${width} ${height} -m ${socket} -f ${tempfile}& mirscreencast_pid=$! |
813 | trap 'kill ${mirscreencast_pid}; rm -f -- "${tempfile}"; exit 0' INT TERM HUP EXIT |
814 | |
815 | |
816 | === modified file 'miral-shell/spinner/eglapp.cpp' |
817 | --- miral-shell/spinner/eglapp.cpp 2016-10-07 11:06:14 +0000 |
818 | +++ miral-shell/spinner/eglapp.cpp 2017-01-26 16:46:42 +0000 |
819 | @@ -18,6 +18,7 @@ |
820 | |
821 | #include "miregl.h" |
822 | |
823 | +#include <mir_toolkit/version.h> |
824 | |
825 | |
826 | float mir_eglapp_background_opacity = 1.0f; |
827 | @@ -31,6 +32,7 @@ |
828 | { |
829 | /* eglapps are interested in the screen size, so |
830 | use mir_connection_create_display_config */ |
831 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
832 | MirDisplayConfiguration* display_config = |
833 | mir_connection_create_display_config(connection); |
834 | |
835 | @@ -48,6 +50,25 @@ |
836 | } |
837 | |
838 | mir_display_config_destroy(display_config); |
839 | +#else |
840 | + MirDisplayConfig* display_config = |
841 | + mir_connection_create_display_configuration(connection); |
842 | + |
843 | + int const n = mir_display_config_get_num_outputs(display_config); |
844 | + |
845 | + for (int i = 0; i != n; ++i) |
846 | + { |
847 | + MirOutput const *const output = mir_display_config_get_output(display_config, i); |
848 | + if (mir_output_is_enabled(output) && |
849 | + mir_output_get_connection_state(output) == mir_output_connection_state_connected && |
850 | + mir_output_get_num_modes(output) && |
851 | + mir_output_get_current_mode_index(output) < (size_t)mir_output_get_num_modes(output)) |
852 | + { |
853 | + handler(output); |
854 | + } |
855 | + } |
856 | + mir_display_config_release(display_config); |
857 | +#endif |
858 | } |
859 | |
860 | MirPixelFormat select_pixel_format(MirConnection* connection) |
861 | @@ -72,7 +93,7 @@ |
862 | |
863 | std::vector<std::shared_ptr<MirEglSurface>> mir_eglapp_init(MirConnection* const connection) |
864 | { |
865 | - MirSurfaceParameters surfaceparm = |
866 | + MirWindowParameters surfaceparm = |
867 | { |
868 | "eglappsurface", |
869 | 0, 0, |
870 | @@ -108,6 +129,7 @@ |
871 | } |
872 | |
873 | // but normally, we're fullscreen on every active output |
874 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
875 | for_each_active_output(connection, [&](MirDisplayOutput const* output) |
876 | { |
877 | auto const& mode = output->modes[output->current_mode]; |
878 | @@ -120,6 +142,20 @@ |
879 | surfaceparm.output_id = output->output_id; |
880 | result.push_back(std::make_shared<MirEglSurface>(mir_egl_app, surfaceparm, swapinterval)); |
881 | }); |
882 | +#else |
883 | + for_each_active_output(connection, [&](MirOutput const* output) |
884 | + { |
885 | + auto const& mode = mir_output_get_current_mode(output); |
886 | + |
887 | + printf("Active output [%u] at (%d, %d) is %dx%d\n", |
888 | + mir_output_get_id(output), |
889 | + mir_output_get_position_x(output), mir_output_get_position_y(output), |
890 | + mir_output_mode_get_width(mode), mir_output_mode_get_height(mode)); |
891 | + |
892 | + surfaceparm.output_id = mir_output_get_id(output); |
893 | + result.push_back(std::make_shared<MirEglSurface>(mir_egl_app, surfaceparm, swapinterval)); |
894 | + }); |
895 | +#endif |
896 | |
897 | if (result.empty()) |
898 | throw std::runtime_error("No active outputs found."); |
899 | |
900 | === modified file 'miral-shell/spinner/miregl.cpp' |
901 | --- miral-shell/spinner/miregl.cpp 2016-09-16 16:07:56 +0000 |
902 | +++ miral-shell/spinner/miregl.cpp 2017-01-26 16:46:42 +0000 |
903 | @@ -15,6 +15,7 @@ |
904 | */ |
905 | |
906 | #include "miregl.h" |
907 | +#include <mir_toolkit/version.h> |
908 | |
909 | #include <cstring> |
910 | |
911 | @@ -25,7 +26,7 @@ |
912 | public: |
913 | MirEglApp(MirConnection* const connection, MirPixelFormat pixel_format); |
914 | |
915 | - EGLSurface create_surface(MirSurface* surface); |
916 | + EGLSurface create_surface(MirWindow* window); |
917 | |
918 | void make_current(EGLSurface eglsurface) const; |
919 | |
920 | @@ -58,19 +59,20 @@ |
921 | |
922 | namespace |
923 | { |
924 | -MirSurface* create_surface(MirConnection* const connection, MirSurfaceParameters const& surfaceparm) |
925 | +MirWindow* create_surface(MirConnection* const connection, MirWindowParameters const& parameters) |
926 | { |
927 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
928 | auto const spec = mir_connection_create_spec_for_normal_surface( |
929 | connection, |
930 | - surfaceparm.width, |
931 | - surfaceparm.height, |
932 | - surfaceparm.pixel_format); |
933 | - |
934 | - mir_surface_spec_set_name(spec, surfaceparm.name); |
935 | - mir_surface_spec_set_buffer_usage(spec, surfaceparm.buffer_usage); |
936 | - |
937 | - if (!surfaceparm.width && !surfaceparm.height) |
938 | - mir_surface_spec_set_fullscreen_on_output(spec, surfaceparm.output_id); |
939 | + parameters.width, |
940 | + parameters.height, |
941 | + parameters.pixel_format); |
942 | + |
943 | + mir_surface_spec_set_name(spec, parameters.name); |
944 | + mir_surface_spec_set_buffer_usage(spec, parameters.buffer_usage); |
945 | + |
946 | + if (!parameters.width && !parameters.height) |
947 | + mir_surface_spec_set_fullscreen_on_output(spec, parameters.output_id); |
948 | |
949 | auto const surface = mir_surface_create_sync(spec); |
950 | mir_surface_spec_release(spec); |
951 | @@ -78,17 +80,39 @@ |
952 | if (!mir_surface_is_valid(surface)) |
953 | throw std::runtime_error(std::string("Can't create a surface ") + mir_surface_get_error_message(surface)); |
954 | |
955 | - if (surfaceparm.output_id != mir_display_output_id_invalid) |
956 | + if (parameters.output_id != mir_display_output_id_invalid) |
957 | mir_surface_set_state(surface, mir_surface_state_fullscreen); |
958 | - |
959 | +#else |
960 | + auto const spec = mir_create_normal_window_spec( |
961 | + connection, |
962 | + parameters.width, |
963 | + parameters.height); |
964 | + |
965 | + mir_window_spec_set_pixel_format(spec, parameters.pixel_format); |
966 | + mir_window_spec_set_name(spec, parameters.name); |
967 | + mir_window_spec_set_buffer_usage(spec, parameters.buffer_usage); |
968 | + |
969 | + if (!parameters.width && !parameters.height) |
970 | + mir_window_spec_set_fullscreen_on_output(spec, parameters.output_id); |
971 | + |
972 | + auto const surface = mir_create_window_sync(spec); |
973 | + mir_window_spec_release(spec); |
974 | + |
975 | + if (!mir_window_is_valid(surface)) |
976 | + throw std::runtime_error(std::string("Can't create a surface ") + mir_window_get_error_message(surface)); |
977 | + |
978 | + if (parameters.output_id != mir_display_output_id_invalid) |
979 | + mir_window_set_state(surface, mir_window_state_fullscreen); |
980 | +#endif |
981 | return surface; |
982 | } |
983 | } |
984 | |
985 | -MirEglSurface::MirEglSurface(std::shared_ptr<MirEglApp> const& mir_egl_app, MirSurfaceParameters const& surfaceparm, int swapinterval) : |
986 | +MirEglSurface::MirEglSurface( |
987 | + std::shared_ptr<MirEglApp> const& mir_egl_app, MirWindowParameters const& parm, int swapinterval) : |
988 | mir_egl_app{mir_egl_app}, |
989 | - surface{create_surface(mir_egl_app->connection, surfaceparm)}, |
990 | - eglsurface{mir_egl_app->create_surface(surface)}, |
991 | + window{create_surface(mir_egl_app->connection, parm)}, |
992 | + eglsurface{mir_egl_app->create_surface(window)}, |
993 | width_{0}, |
994 | height_{0} |
995 | { |
996 | @@ -98,7 +122,11 @@ |
997 | MirEglSurface::~MirEglSurface() |
998 | { |
999 | mir_egl_app->destroy_surface(eglsurface); |
1000 | - mir_surface_release_sync(surface); |
1001 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
1002 | + mir_surface_release_sync(window); |
1003 | +#else |
1004 | + mir_window_release_sync(window); |
1005 | +#endif |
1006 | } |
1007 | |
1008 | void MirEglSurface::egl_make_current() |
1009 | @@ -173,7 +201,7 @@ |
1010 | EGL_HEIGHT, 1, |
1011 | EGL_NONE |
1012 | }; |
1013 | - |
1014 | + |
1015 | dummy_surface = eglCreatePbufferSurface(egldisplay, eglconfig, dummy_pbuffer_attribs); |
1016 | if (dummy_surface == EGL_NO_SURFACE) |
1017 | throw std::runtime_error("eglCreatePbufferSurface failed"); |
1018 | @@ -182,12 +210,19 @@ |
1019 | make_current(dummy_surface); |
1020 | } |
1021 | |
1022 | -EGLSurface MirEglApp::create_surface(MirSurface* surface) |
1023 | +EGLSurface MirEglApp::create_surface(MirWindow* window) |
1024 | { |
1025 | - auto const eglsurface = eglCreateWindowSurface( |
1026 | - egldisplay, |
1027 | - eglconfig, |
1028 | - (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(surface)), NULL); |
1029 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
1030 | + auto const eglsurface = eglCreateWindowSurface( |
1031 | + egldisplay, |
1032 | + eglconfig, |
1033 | + (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(window)), NULL); |
1034 | +#else |
1035 | + auto const eglsurface = eglCreateWindowSurface( |
1036 | + egldisplay, |
1037 | + eglconfig, |
1038 | + (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_window_get_buffer_stream(window)), NULL); |
1039 | +#endif |
1040 | |
1041 | if (eglsurface == EGL_NO_SURFACE) |
1042 | throw std::runtime_error("eglCreateWindowSurface failed"); |
1043 | |
1044 | === modified file 'miral-shell/spinner/miregl.h' |
1045 | --- miral-shell/spinner/miregl.h 2016-09-16 16:07:56 +0000 |
1046 | +++ miral-shell/spinner/miregl.h 2017-01-26 16:46:42 +0000 |
1047 | @@ -17,7 +17,7 @@ |
1048 | #ifndef UNITYSYSTEMCOMPOSITOR_MIREGL_H |
1049 | #define UNITYSYSTEMCOMPOSITOR_MIREGL_H |
1050 | |
1051 | -#include <mir_toolkit/common.h> |
1052 | +#include <miral/detail/mir_forward_compatibility.h> |
1053 | #include <mir_toolkit/client_types.h> |
1054 | #include "mir_toolkit/mir_client_library.h" |
1055 | |
1056 | @@ -37,7 +37,7 @@ |
1057 | public: |
1058 | MirEglSurface( |
1059 | std::shared_ptr<MirEglApp> const& mir_egl_app, |
1060 | - MirSurfaceParameters const& surfaceparm, |
1061 | + MirWindowParameters const& parm, |
1062 | int swapinterval); |
1063 | |
1064 | ~MirEglSurface(); |
1065 | @@ -50,7 +50,7 @@ |
1066 | swap_buffers(); |
1067 | } |
1068 | |
1069 | - MirSurface* mir_surface() { return surface; } |
1070 | + MirWindow* mir_window() { return window; } |
1071 | |
1072 | private: |
1073 | void egl_make_current(); |
1074 | @@ -60,7 +60,7 @@ |
1075 | unsigned int height() const; |
1076 | |
1077 | std::shared_ptr<MirEglApp> const mir_egl_app; |
1078 | - MirSurface* const surface; |
1079 | + MirWindow* const window; |
1080 | EGLSurface const eglsurface; |
1081 | int width_; |
1082 | int height_; |
1083 | |
1084 | === modified file 'miral-shell/tiling_window_manager.cpp' |
1085 | --- miral-shell/tiling_window_manager.cpp 2017-01-18 17:41:46 +0000 |
1086 | +++ miral-shell/tiling_window_manager.cpp 2017-01-26 16:46:42 +0000 |
1087 | @@ -108,7 +108,7 @@ |
1088 | } |
1089 | } |
1090 | |
1091 | -auto TilingWindowManagerPolicy::place_new_surface( |
1092 | +auto TilingWindowManagerPolicy::place_new_window( |
1093 | ApplicationInfo const& app_info, |
1094 | WindowSpecification const& request_parameters) |
1095 | -> WindowSpecification |
1096 | @@ -117,7 +117,7 @@ |
1097 | |
1098 | parameters.userdata() = app_info.userdata(); |
1099 | parameters.state() = parameters.state().is_set() ? |
1100 | - transform_set_state(parameters.state().value()) : mir_surface_state_restored; |
1101 | + transform_set_state(parameters.state().value()) : mir_window_state_restored; |
1102 | |
1103 | if (app_info.application() != spinner.session()) |
1104 | { |
1105 | @@ -147,13 +147,13 @@ |
1106 | |
1107 | void TilingWindowManagerPolicy::advise_new_window(WindowInfo const& window_info) |
1108 | { |
1109 | - if (window_info.type() == mir_surface_type_normal && |
1110 | + if (window_info.type() == mir_window_type_normal && |
1111 | !window_info.parent() && |
1112 | - window_info.state() == mir_surface_state_restored) |
1113 | + window_info.state() == mir_window_state_restored) |
1114 | { |
1115 | WindowSpecification specification; |
1116 | |
1117 | - specification.state() = mir_surface_state_maximized; |
1118 | + specification.state() = mir_window_state_maximized; |
1119 | |
1120 | tools.place_and_size_for_state(specification, window_info); |
1121 | constrain_size_and_place(specification, window_info.window(), tile_for(window_info)); |
1122 | @@ -229,17 +229,17 @@ |
1123 | reset(mods.top_left()); |
1124 | } |
1125 | |
1126 | -auto TilingWindowManagerPolicy::transform_set_state(MirSurfaceState value) |
1127 | --> MirSurfaceState |
1128 | +auto TilingWindowManagerPolicy::transform_set_state(MirWindowState value) |
1129 | +-> MirWindowState |
1130 | { |
1131 | switch (value) |
1132 | { |
1133 | default: |
1134 | - return mir_surface_state_restored; |
1135 | + return mir_window_state_restored; |
1136 | |
1137 | - case mir_surface_state_hidden: |
1138 | - case mir_surface_state_minimized: |
1139 | - return mir_surface_state_hidden; |
1140 | + case mir_window_state_hidden: |
1141 | + case mir_window_state_minimized: |
1142 | + return mir_window_state_hidden; |
1143 | } |
1144 | } |
1145 | |
1146 | @@ -285,15 +285,15 @@ |
1147 | switch (modifiers & modifier_mask) |
1148 | { |
1149 | case mir_input_event_modifier_alt: |
1150 | - toggle(mir_surface_state_maximized); |
1151 | + toggle(mir_window_state_maximized); |
1152 | return true; |
1153 | |
1154 | case mir_input_event_modifier_shift: |
1155 | - toggle(mir_surface_state_vertmaximized); |
1156 | + toggle(mir_window_state_vertmaximized); |
1157 | return true; |
1158 | |
1159 | case mir_input_event_modifier_ctrl: |
1160 | - toggle(mir_surface_state_horizmaximized); |
1161 | + toggle(mir_window_state_horizmaximized); |
1162 | return true; |
1163 | |
1164 | default: |
1165 | @@ -427,14 +427,14 @@ |
1166 | return consumes_event; |
1167 | } |
1168 | |
1169 | -void TilingWindowManagerPolicy::toggle(MirSurfaceState state) |
1170 | +void TilingWindowManagerPolicy::toggle(MirWindowState state) |
1171 | { |
1172 | if (auto window = tools.active_window()) |
1173 | { |
1174 | auto& window_info = tools.info_for(window); |
1175 | |
1176 | if (window_info.state() == state) |
1177 | - state = mir_surface_state_restored; |
1178 | + state = mir_window_state_restored; |
1179 | |
1180 | WindowSpecification mods; |
1181 | mods.state() = transform_set_state(state); |
1182 | |
1183 | === modified file 'miral-shell/tiling_window_manager.h' |
1184 | --- miral-shell/tiling_window_manager.h 2016-12-05 09:46:35 +0000 |
1185 | +++ miral-shell/tiling_window_manager.h 2017-01-26 16:46:42 +0000 |
1186 | @@ -54,7 +54,7 @@ |
1187 | |
1188 | ~TilingWindowManagerPolicy(); |
1189 | |
1190 | - auto place_new_surface( |
1191 | + auto place_new_window( |
1192 | miral::ApplicationInfo const& app_info, |
1193 | miral::WindowSpecification const& request_parameters) |
1194 | -> miral::WindowSpecification override; |
1195 | @@ -91,14 +91,14 @@ |
1196 | void click(Point cursor); |
1197 | void resize(Point cursor); |
1198 | void drag(Point cursor); |
1199 | - void toggle(MirSurfaceState state); |
1200 | + void toggle(MirWindowState state); |
1201 | |
1202 | miral::Application application_under(Point position); |
1203 | |
1204 | void update_tiles(Rectangles const& displays); |
1205 | void update_surfaces(miral::ApplicationInfo& info, Rectangle const& old_tile, Rectangle const& new_tile); |
1206 | |
1207 | - auto transform_set_state(MirSurfaceState value) -> MirSurfaceState; |
1208 | + auto transform_set_state(MirWindowState value) -> MirWindowState; |
1209 | |
1210 | static void clip_to_tile(miral::WindowSpecification& parameters, Rectangle const& tile); |
1211 | static void resize(miral::Window window, Point cursor, Point old_cursor, Rectangle bounds); |
1212 | |
1213 | === modified file 'miral-shell/titlebar_provider.cpp' |
1214 | --- miral-shell/titlebar_provider.cpp 2016-10-27 14:07:51 +0000 |
1215 | +++ miral-shell/titlebar_provider.cpp 2017-01-26 16:46:42 +0000 |
1216 | @@ -19,7 +19,7 @@ |
1217 | #include "titlebar_provider.h" |
1218 | #include "titlebar_config.h" |
1219 | |
1220 | -#include <miral/toolkit/surface_spec.h> |
1221 | +#include <miral/toolkit/window_spec.h> |
1222 | |
1223 | #include <mir_toolkit/mir_buffer_stream.h> |
1224 | |
1225 | @@ -38,7 +38,7 @@ |
1226 | { |
1227 | int const title_bar_height = 12; |
1228 | |
1229 | -void null_surface_callback(MirSurface*, void*) {} |
1230 | +void null_surface_callback(MirWindow*, void*) {} |
1231 | |
1232 | struct Printer |
1233 | { |
1234 | @@ -57,9 +57,13 @@ |
1235 | FT_Face face; |
1236 | }; |
1237 | |
1238 | -void paint_surface(MirSurface* surface, std::string const& title, int const intensity) |
1239 | +void paint_surface(MirWindow* surface, std::string const& title, int const intensity) |
1240 | { |
1241 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
1242 | MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface); |
1243 | +#else |
1244 | + MirBufferStream* buffer_stream = mir_window_get_buffer_stream(surface); |
1245 | +#endif |
1246 | |
1247 | // TODO sometimes buffer_stream is nullptr - find out why (and fix). |
1248 | // (Only observed when creating a lot of clients at once) |
1249 | @@ -204,10 +208,10 @@ |
1250 | |
1251 | buffer << std::shared_ptr<mir::scene::Surface>(window).get(); |
1252 | |
1253 | - auto const spec = SurfaceSpec::for_normal_surface( |
1254 | + auto const spec = WindowSpec::for_normal_surface( |
1255 | connection, window.size().width.as_int(), title_bar_height, mir_pixel_format_xrgb_8888) |
1256 | .set_buffer_usage(mir_buffer_usage_software) |
1257 | - .set_type(mir_surface_type_gloss) |
1258 | + .set_type(mir_window_type_gloss) |
1259 | .set_name(buffer.str().c_str()); |
1260 | |
1261 | std::lock_guard<decltype(mutex)> lock{mutex}; |
1262 | @@ -230,7 +234,7 @@ |
1263 | } |
1264 | else |
1265 | { |
1266 | - data->on_create = [this, title, intensity](MirSurface* surface) |
1267 | + data->on_create = [this, title, intensity](MirWindow* surface) |
1268 | { enqueue_work([this, surface, title, intensity]{ paint_surface(surface, title, intensity); }); }; |
1269 | } |
1270 | } |
1271 | @@ -244,7 +248,11 @@ |
1272 | { |
1273 | enqueue_work([surface] |
1274 | { |
1275 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
1276 | mir_surface_release(surface, &null_surface_callback, nullptr); |
1277 | +#else |
1278 | + mir_window_release(surface, &null_surface_callback, nullptr); |
1279 | +#endif |
1280 | }); |
1281 | } |
1282 | |
1283 | @@ -299,23 +307,23 @@ |
1284 | tools.raise_tree(window_info.parent()); |
1285 | } |
1286 | |
1287 | -void TitlebarProvider::advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state) |
1288 | +void TitlebarProvider::advise_state_change(miral::WindowInfo const& window_info, MirWindowState state) |
1289 | { |
1290 | if (auto titlebar = find_titlebar_window(window_info.window())) |
1291 | { |
1292 | miral::WindowSpecification modifications; |
1293 | switch (state) |
1294 | { |
1295 | - case mir_surface_state_maximized: |
1296 | - case mir_surface_state_vertmaximized: |
1297 | - case mir_surface_state_hidden: |
1298 | - case mir_surface_state_minimized: |
1299 | - case mir_surface_state_fullscreen: |
1300 | - modifications.state() = mir_surface_state_hidden; |
1301 | + case mir_window_state_maximized: |
1302 | + case mir_window_state_vertmaximized: |
1303 | + case mir_window_state_hidden: |
1304 | + case mir_window_state_minimized: |
1305 | + case mir_window_state_fullscreen: |
1306 | + modifications.state() = mir_window_state_hidden; |
1307 | break; |
1308 | |
1309 | default: |
1310 | - modifications.state() = mir_surface_state_restored; |
1311 | + modifications.state() = mir_window_state_restored; |
1312 | break; |
1313 | } |
1314 | |
1315 | @@ -338,10 +346,14 @@ |
1316 | TitlebarProvider::Data::~Data() |
1317 | { |
1318 | if (auto surface = titlebar.exchange(nullptr)) |
1319 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
1320 | mir_surface_release(surface, &null_surface_callback, nullptr); |
1321 | +#else |
1322 | + mir_window_release(surface, &null_surface_callback, nullptr); |
1323 | +#endif |
1324 | } |
1325 | |
1326 | -void TitlebarProvider::insert(MirSurface* surface, Data* data) |
1327 | +void TitlebarProvider::insert(MirWindow* surface, Data* data) |
1328 | { |
1329 | data->on_create(surface); |
1330 | data->titlebar = surface; |
1331 | @@ -401,4 +413,4 @@ |
1332 | void Worker::stop_work() |
1333 | { |
1334 | enqueue_work([this] { work_done = true; }); |
1335 | -} |
1336 | \ No newline at end of file |
1337 | +} |
1338 | |
1339 | === modified file 'miral-shell/titlebar_provider.h' |
1340 | --- miral-shell/titlebar_provider.h 2016-10-27 14:04:09 +0000 |
1341 | +++ miral-shell/titlebar_provider.h 2017-01-26 16:46:42 +0000 |
1342 | @@ -71,15 +71,15 @@ |
1343 | void destroy_titlebar_for(miral::Window const& window); |
1344 | void resize_titlebar_for(miral::WindowInfo const& window_info, mir::geometry::Size const& size); |
1345 | void advise_new_titlebar(miral::WindowInfo const& window_info); |
1346 | - void advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state); |
1347 | + void advise_state_change(miral::WindowInfo const& window_info, MirWindowState state); |
1348 | |
1349 | void stop(); |
1350 | |
1351 | private: |
1352 | struct Data |
1353 | { |
1354 | - std::atomic<MirSurface*> titlebar{nullptr}; |
1355 | - std::function<void(MirSurface* surface)> on_create{[](MirSurface*){}}; |
1356 | + std::atomic<MirWindow*> titlebar{nullptr}; |
1357 | + std::function<void(MirWindow* surface)> on_create{[](MirWindow*){}}; |
1358 | miral::Window window; |
1359 | |
1360 | ~Data(); |
1361 | @@ -97,7 +97,7 @@ |
1362 | SurfaceMap window_to_titlebar; |
1363 | TitleMap windows_awaiting_titlebar; |
1364 | |
1365 | - static void insert(MirSurface* surface, Data* data); |
1366 | + static void insert(MirWindow* surface, Data* data); |
1367 | Data* find_titlebar_data(miral::Window const& window); |
1368 | miral::Window find_titlebar_window(miral::Window const& window) const; |
1369 | void repaint_titlebar_for(miral::WindowInfo const& window_info); |
1370 | |
1371 | === modified file 'miral-shell/titlebar_window_manager.cpp' |
1372 | --- miral-shell/titlebar_window_manager.cpp 2016-10-27 14:04:09 +0000 |
1373 | +++ miral-shell/titlebar_window_manager.cpp 2017-01-26 16:46:42 +0000 |
1374 | @@ -109,7 +109,7 @@ |
1375 | } |
1376 | } |
1377 | } |
1378 | - |
1379 | + |
1380 | if (resizing && !is_resize_event) |
1381 | end_resize(); |
1382 | |
1383 | @@ -312,7 +312,7 @@ |
1384 | } |
1385 | } |
1386 | |
1387 | -void TitlebarWindowManagerPolicy::advise_state_change(WindowInfo const& window_info, MirSurfaceState state) |
1388 | +void TitlebarWindowManagerPolicy::advise_state_change(WindowInfo const& window_info, MirWindowState state) |
1389 | { |
1390 | CanonicalWindowManagerPolicy::advise_state_change(window_info, state); |
1391 | |
1392 | @@ -347,15 +347,15 @@ |
1393 | switch (modifiers) |
1394 | { |
1395 | case mir_input_event_modifier_alt: |
1396 | - toggle(mir_surface_state_maximized); |
1397 | + toggle(mir_window_state_maximized); |
1398 | return true; |
1399 | |
1400 | case mir_input_event_modifier_shift: |
1401 | - toggle(mir_surface_state_vertmaximized); |
1402 | + toggle(mir_window_state_vertmaximized); |
1403 | return true; |
1404 | |
1405 | case mir_input_event_modifier_ctrl: |
1406 | - toggle(mir_surface_state_horizmaximized); |
1407 | + toggle(mir_window_state_horizmaximized); |
1408 | return true; |
1409 | |
1410 | default: |
1411 | @@ -418,8 +418,8 @@ |
1412 | break; |
1413 | |
1414 | case KEY_UP: |
1415 | - if (window_info.state() != mir_surface_state_vertmaximized && |
1416 | - window_info.state() != mir_surface_state_maximized) |
1417 | + if (window_info.state() != mir_window_state_vertmaximized && |
1418 | + window_info.state() != mir_window_state_maximized) |
1419 | { |
1420 | modifications.top_left() = |
1421 | Point{active_window.top_left().x, active_display.top_left.y} + DeltaY{title_bar_height}; |
1422 | @@ -455,7 +455,7 @@ |
1423 | return false; |
1424 | } |
1425 | |
1426 | -void TitlebarWindowManagerPolicy::toggle(MirSurfaceState state) |
1427 | +void TitlebarWindowManagerPolicy::toggle(MirWindowState state) |
1428 | { |
1429 | if (auto const window = tools.active_window()) |
1430 | { |
1431 | @@ -463,7 +463,7 @@ |
1432 | |
1433 | WindowSpecification modifications; |
1434 | |
1435 | - modifications.state() = (info.state() == state) ? mir_surface_state_restored : state; |
1436 | + modifications.state() = (info.state() == state) ? mir_window_state_restored : state; |
1437 | tools.place_and_size_for_state(modifications, info); |
1438 | tools.modify_window(info, modifications); |
1439 | } |
1440 | @@ -558,14 +558,14 @@ |
1441 | } |
1442 | } |
1443 | |
1444 | -WindowSpecification TitlebarWindowManagerPolicy::place_new_surface( |
1445 | +WindowSpecification TitlebarWindowManagerPolicy::place_new_window( |
1446 | ApplicationInfo const& app_info, WindowSpecification const& request_parameters) |
1447 | { |
1448 | - auto parameters = CanonicalWindowManagerPolicy::place_new_surface(app_info, request_parameters); |
1449 | + auto parameters = CanonicalWindowManagerPolicy::place_new_window(app_info, request_parameters); |
1450 | |
1451 | bool const needs_titlebar = WindowInfo::needs_titlebar(parameters.type().value()); |
1452 | |
1453 | - if (parameters.state().value() != mir_surface_state_fullscreen && needs_titlebar) |
1454 | + if (parameters.state().value() != mir_window_state_fullscreen && needs_titlebar) |
1455 | parameters.top_left() = Point{parameters.top_left().value().x, parameters.top_left().value().y + DeltaY{title_bar_height}}; |
1456 | |
1457 | if (app_info.application() == titlebar_provider->session()) |
1458 | |
1459 | === modified file 'miral-shell/titlebar_window_manager.h' |
1460 | --- miral-shell/titlebar_window_manager.h 2016-09-28 11:42:35 +0000 |
1461 | +++ miral-shell/titlebar_window_manager.h 2017-01-26 16:46:42 +0000 |
1462 | @@ -37,7 +37,7 @@ |
1463 | TitlebarWindowManagerPolicy(miral::WindowManagerTools const& tools, SpinnerSplash const& spinner, miral::InternalClientLauncher const& launcher); |
1464 | ~TitlebarWindowManagerPolicy(); |
1465 | |
1466 | - virtual miral::WindowSpecification place_new_surface( |
1467 | + virtual miral::WindowSpecification place_new_window( |
1468 | miral::ApplicationInfo const& app_info, miral::WindowSpecification const& request_parameters) override; |
1469 | |
1470 | /** @name example event handling: |
1471 | @@ -60,7 +60,7 @@ |
1472 | void handle_window_ready(miral::WindowInfo& window_info) override; |
1473 | void advise_focus_lost(miral::WindowInfo const& info) override; |
1474 | void advise_focus_gained(miral::WindowInfo const& info) override; |
1475 | - void advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state) override; |
1476 | + void advise_state_change(miral::WindowInfo const& window_info, MirWindowState state) override; |
1477 | void advise_resize(miral::WindowInfo const& window_info, Size const& new_size) override; |
1478 | void advise_delete_window(miral::WindowInfo const& window_info) override; |
1479 | /** @} */ |
1480 | @@ -74,7 +74,7 @@ |
1481 | mir_input_event_modifier_meta; |
1482 | |
1483 | private: |
1484 | - void toggle(MirSurfaceState state); |
1485 | + void toggle(MirWindowState state); |
1486 | |
1487 | bool resize(miral::Window const& window, Point cursor, Point old_cursor); |
1488 | |
1489 | |
1490 | === modified file 'miral/CMakeLists.txt' |
1491 | --- miral/CMakeLists.txt 2016-12-13 13:07:15 +0000 |
1492 | +++ miral/CMakeLists.txt 2017-01-26 16:46:42 +0000 |
1493 | @@ -21,9 +21,10 @@ |
1494 | window_management_trace.cpp window_management_trace.h |
1495 | xcursor_loader.cpp xcursor_loader.h |
1496 | xcursor.c xcursor.h |
1497 | + both_versions.h |
1498 | ) |
1499 | |
1500 | -set_source_files_properties(xcursor.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_GNU_SOURCE") |
1501 | +set_source_files_properties(xcursor.c PROPERTIES COMPILE_DEFINITIONS _GNU_SOURCE) |
1502 | |
1503 | add_library(miral SHARED |
1504 | active_outputs.cpp ${CMAKE_SOURCE_DIR}/include/miral/active_outputs.h |
1505 | @@ -50,10 +51,10 @@ |
1506 | set_window_managment_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_managment_policy.h |
1507 | window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h |
1508 | window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h |
1509 | - ${CMAKE_SOURCE_DIR}/include/miral/toolkit/surface_spec.h |
1510 | + ${CMAKE_SOURCE_DIR}/include/miral/toolkit/window_spec.h |
1511 | ${CMAKE_SOURCE_DIR}/include/miral/toolkit/persistent_id.h |
1512 | ${CMAKE_SOURCE_DIR}/include/miral/toolkit/connection.h |
1513 | - ${CMAKE_SOURCE_DIR}/include/miral/toolkit/surface.h |
1514 | + ${CMAKE_SOURCE_DIR}/include/miral/toolkit/window.h |
1515 | ${CMAKE_SOURCE_DIR}/include/miral/detail/mir_forward_compatibility.h |
1516 | ) |
1517 | |
1518 | |
1519 | === modified file 'miral/active_outputs.cpp' |
1520 | --- miral/active_outputs.cpp 2016-12-13 13:07:15 +0000 |
1521 | +++ miral/active_outputs.cpp 2017-01-26 16:46:42 +0000 |
1522 | @@ -70,6 +70,11 @@ |
1523 | |
1524 | void base_configuration_updated(std::shared_ptr<mir::graphics::DisplayConfiguration const> const& ) override {} |
1525 | |
1526 | + void session_configuration_applied(std::shared_ptr<mir::frontend::Session> const&, |
1527 | + std::shared_ptr<mir::graphics::DisplayConfiguration> const&) override {} |
1528 | + |
1529 | + void session_configuration_removed(std::shared_ptr<mir::frontend::Session> const&) override {} |
1530 | + |
1531 | std::mutex mutex; |
1532 | std::vector<ActiveOutputsListener*> listeners; |
1533 | std::vector<Output> outputs; |
1534 | |
1535 | === modified file 'miral/basic_window_manager.cpp' |
1536 | --- miral/basic_window_manager.cpp 2017-01-18 17:41:46 +0000 |
1537 | +++ miral/basic_window_manager.cpp 2017-01-26 16:46:42 +0000 |
1538 | @@ -92,7 +92,7 @@ |
1539 | |
1540 | auto& session_info = info_for(session); |
1541 | |
1542 | - WindowSpecification const& spec = policy->place_new_surface(session_info, place_new_surface(session_info, params)); |
1543 | + WindowSpecification const& spec = policy->place_new_window(session_info, place_new_surface(session_info, params)); |
1544 | scene::SurfaceCreationParameters parameters; |
1545 | spec.update(parameters); |
1546 | auto const surface_id = build(session, parameters); |
1547 | @@ -112,7 +112,7 @@ |
1548 | if (parent) |
1549 | info_for(parent).add_child(window); |
1550 | |
1551 | - if (window_info.state() == mir_surface_state_fullscreen) |
1552 | + if (window_info.state() == mir_window_state_fullscreen) |
1553 | fullscreen_surfaces.insert(window_info.window()); |
1554 | |
1555 | policy->advise_new_window(window_info); |
1556 | @@ -282,35 +282,35 @@ |
1557 | int miral::BasicWindowManager::set_surface_attribute( |
1558 | std::shared_ptr<scene::Session> const& /*application*/, |
1559 | std::shared_ptr<scene::Surface> const& surface, |
1560 | - MirSurfaceAttrib attrib, |
1561 | + MirWindowAttrib attrib, |
1562 | int value) |
1563 | { |
1564 | WindowSpecification modification; |
1565 | switch (attrib) |
1566 | { |
1567 | - case mir_surface_attrib_type: |
1568 | - modification.type() = MirSurfaceType(value); |
1569 | + case mir_window_attrib_type: |
1570 | + modification.type() = MirWindowType(value); |
1571 | break; |
1572 | - case mir_surface_attrib_state: |
1573 | - modification.state() = MirSurfaceState(value); |
1574 | + case mir_window_attrib_state: |
1575 | + modification.state() = MirWindowState(value); |
1576 | break; |
1577 | |
1578 | - case mir_surface_attrib_preferred_orientation: |
1579 | + case mir_window_attrib_preferred_orientation: |
1580 | modification.preferred_orientation() = MirOrientationMode(value); |
1581 | break; |
1582 | |
1583 | - case mir_surface_attrib_visibility: |
1584 | - // The client really shouldn't be trying to set this. |
1585 | - // But, as the legacy API exists, we treat it as a query |
1586 | - return surface->query(mir_surface_attrib_visibility); |
1587 | - |
1588 | - case mir_surface_attrib_focus: |
1589 | - // The client really shouldn't be trying to set this. |
1590 | - // But, as the legacy API exists, we treat it as a query |
1591 | - return surface->query(mir_surface_attrib_focus); |
1592 | - |
1593 | - case mir_surface_attrib_swapinterval: |
1594 | - case mir_surface_attrib_dpi: |
1595 | + case mir_window_attrib_visibility: |
1596 | + // The client really shouldn't be trying to set this. |
1597 | + // But, as the legacy API exists, we treat it as a query |
1598 | + return surface->query(mir_window_attrib_visibility); |
1599 | + |
1600 | + case mir_window_attrib_focus: |
1601 | + // The client really shouldn't be trying to set this. |
1602 | + // But, as the legacy API exists, we treat it as a query |
1603 | + return surface->query(mir_window_attrib_focus); |
1604 | + |
1605 | + case mir_window_attrib_swapinterval: |
1606 | + case mir_window_attrib_dpi: |
1607 | default: |
1608 | return surface->configure(attrib, value); |
1609 | } |
1610 | @@ -324,13 +324,13 @@ |
1611 | |
1612 | switch (attrib) |
1613 | { |
1614 | - case mir_surface_attrib_type: |
1615 | + case mir_window_attrib_type: |
1616 | return info.type(); |
1617 | |
1618 | - case mir_surface_attrib_state: |
1619 | + case mir_window_attrib_state: |
1620 | return info.state(); |
1621 | |
1622 | - case mir_surface_attrib_preferred_orientation: |
1623 | + case mir_window_attrib_preferred_orientation: |
1624 | return info.preferred_orientation(); |
1625 | break; |
1626 | |
1627 | @@ -496,6 +496,11 @@ |
1628 | |
1629 | void miral::BasicWindowManager::raise_tree(Window const& root) |
1630 | { |
1631 | + auto const& info = info_for(root); |
1632 | + |
1633 | + if (auto parent = info.parent()) |
1634 | + raise_tree(parent); |
1635 | + |
1636 | std::vector<Window> windows; |
1637 | |
1638 | std::function<void(WindowInfo const& info)> const add_children = |
1639 | @@ -509,7 +514,7 @@ |
1640 | }; |
1641 | |
1642 | windows.push_back(root); |
1643 | - add_children(info_for(root)); |
1644 | + add_children(info); |
1645 | |
1646 | policy->advise_raise(windows); |
1647 | focus_controller->raise({begin(windows), end(windows)}); |
1648 | @@ -589,7 +594,7 @@ |
1649 | auto& window = window_info.window(); |
1650 | |
1651 | if (window_info.type() != window_info_tmp.type()) |
1652 | - std::shared_ptr<scene::Surface>(window)->configure(mir_surface_attrib_type, window_info.type()); |
1653 | + std::shared_ptr<scene::Surface>(window)->configure(mir_window_attrib_type, window_info.type()); |
1654 | |
1655 | if (window_info.parent() != window_info_tmp.parent()) |
1656 | { |
1657 | @@ -616,12 +621,12 @@ |
1658 | { |
1659 | switch (window_info.state()) |
1660 | { |
1661 | - case mir_surface_state_restored: |
1662 | - case mir_surface_state_hidden: |
1663 | + case mir_window_state_restored: |
1664 | + case mir_window_state_hidden: |
1665 | window_info.restore_rect({window.top_left(), window.size()}); |
1666 | break; |
1667 | |
1668 | - case mir_surface_state_vertmaximized: |
1669 | + case mir_window_state_vertmaximized: |
1670 | { |
1671 | auto restore_rect = window_info.restore_rect(); |
1672 | restore_rect.top_left.x = window.top_left().x; |
1673 | @@ -630,7 +635,7 @@ |
1674 | break; |
1675 | } |
1676 | |
1677 | - case mir_surface_state_horizmaximized: |
1678 | + case mir_window_state_horizmaximized: |
1679 | { |
1680 | auto restore_rect = window_info.restore_rect(); |
1681 | restore_rect.top_left.y = window.top_left().y; |
1682 | @@ -740,7 +745,7 @@ |
1683 | |
1684 | switch (new_state) |
1685 | { |
1686 | - case mir_surface_state_fullscreen: |
1687 | + case mir_window_state_fullscreen: |
1688 | if (modifications.output_id().is_set() && |
1689 | (!window_info.has_output_id() || modifications.output_id().value() != window_info.output_id())) |
1690 | break; |
1691 | @@ -758,19 +763,19 @@ |
1692 | // window_info.restore_rect() was cached on last state change, update to reflect current window position |
1693 | switch (window_info.state()) |
1694 | { |
1695 | - case mir_surface_state_restored: |
1696 | - case mir_surface_state_hidden: |
1697 | + case mir_window_state_restored: |
1698 | + case mir_window_state_hidden: |
1699 | restore_rect = {window.top_left(), window.size()}; |
1700 | break; |
1701 | |
1702 | - case mir_surface_state_vertmaximized: |
1703 | + case mir_window_state_vertmaximized: |
1704 | { |
1705 | restore_rect.top_left.x = window.top_left().x; |
1706 | restore_rect.size.width = window.size().width; |
1707 | break; |
1708 | } |
1709 | |
1710 | - case mir_surface_state_horizmaximized: |
1711 | + case mir_window_state_horizmaximized: |
1712 | { |
1713 | restore_rect.top_left.y = window.top_left().y; |
1714 | restore_rect.size.height= window.size().height; |
1715 | @@ -793,33 +798,33 @@ |
1716 | |
1717 | switch (new_state) |
1718 | { |
1719 | - case mir_surface_state_restored: |
1720 | + case mir_window_state_restored: |
1721 | rect = restore_rect; |
1722 | break; |
1723 | |
1724 | - case mir_surface_state_maximized: |
1725 | + case mir_window_state_maximized: |
1726 | rect = display_area; |
1727 | break; |
1728 | |
1729 | - case mir_surface_state_horizmaximized: |
1730 | + case mir_window_state_horizmaximized: |
1731 | rect.top_left = {display_area.top_left.x, restore_rect.top_left.y}; |
1732 | rect.size = {display_area.size.width, restore_rect.size.height}; |
1733 | break; |
1734 | |
1735 | - case mir_surface_state_vertmaximized: |
1736 | + case mir_window_state_vertmaximized: |
1737 | rect.top_left = {restore_rect.top_left.x, display_area.top_left.y}; |
1738 | rect.size = {restore_rect.size.width, display_area.size.height}; |
1739 | break; |
1740 | |
1741 | - case mir_surface_state_fullscreen: |
1742 | + case mir_window_state_fullscreen: |
1743 | { |
1744 | rect = fullscreen_rect_for(window_info); |
1745 | |
1746 | break; |
1747 | } |
1748 | |
1749 | - case mir_surface_state_hidden: |
1750 | - case mir_surface_state_minimized: |
1751 | + case mir_window_state_hidden: |
1752 | + case mir_window_state_minimized: |
1753 | default: |
1754 | return; |
1755 | } |
1756 | @@ -845,12 +850,12 @@ |
1757 | return r; |
1758 | } |
1759 | |
1760 | -void miral::BasicWindowManager::set_state(miral::WindowInfo& window_info, MirSurfaceState value) |
1761 | +void miral::BasicWindowManager::set_state(miral::WindowInfo& window_info, MirWindowState value) |
1762 | { |
1763 | auto const window = window_info.window(); |
1764 | auto const mir_surface = std::shared_ptr<scene::Surface>(window); |
1765 | |
1766 | - if (value != mir_surface_state_fullscreen) |
1767 | + if (value != mir_window_state_fullscreen) |
1768 | { |
1769 | fullscreen_surfaces.erase(window); |
1770 | } |
1771 | @@ -864,18 +869,18 @@ |
1772 | return; |
1773 | } |
1774 | |
1775 | - bool const was_hidden = window_info.state() == mir_surface_state_hidden || |
1776 | - window_info.state() == mir_surface_state_minimized; |
1777 | + bool const was_hidden = window_info.state() == mir_window_state_hidden || |
1778 | + window_info.state() == mir_window_state_minimized; |
1779 | |
1780 | policy->advise_state_change(window_info, value); |
1781 | window_info.state(value); |
1782 | |
1783 | - mir_surface->configure(mir_surface_attrib_state, value); |
1784 | + mir_surface->configure(mir_window_attrib_state, value); |
1785 | |
1786 | switch (value) |
1787 | { |
1788 | - case mir_surface_state_hidden: |
1789 | - case mir_surface_state_minimized: |
1790 | + case mir_window_state_hidden: |
1791 | + case mir_window_state_minimized: |
1792 | mir_surface->hide(); |
1793 | |
1794 | if (window == active_window()) |
1795 | @@ -885,8 +890,6 @@ |
1796 | { |
1797 | if (candidate == window) |
1798 | return true; |
1799 | - if (!std::shared_ptr<scene::Surface>(candidate)->visible()) |
1800 | - return true; |
1801 | auto const w = candidate; |
1802 | return !(select_active_window(w)); |
1803 | }); |
1804 | @@ -966,7 +969,7 @@ |
1805 | { |
1806 | if (std::shared_ptr<mir::scene::Surface> surface = child) |
1807 | { |
1808 | - if (surface->type() == mir_surface_type_dialog && surface->visible()) |
1809 | + if (surface->type() == mir_window_type_dialog && surface->visible()) |
1810 | return select_active_window(child); |
1811 | } |
1812 | } |
1813 | @@ -1009,43 +1012,43 @@ |
1814 | // Mir and Unity: Surfaces, input, and displays (v0.3) |
1815 | switch (window_info.type()) |
1816 | { |
1817 | - case mir_surface_type_normal: // regular |
1818 | - case mir_surface_type_utility: // floating regular |
1819 | - case mir_surface_type_dialog: // dialog |
1820 | - case mir_surface_type_satellite:// satellite |
1821 | - case mir_surface_type_freestyle:// freestyle |
1822 | + case mir_window_type_normal: // regular |
1823 | + case mir_window_type_utility: // floating regular |
1824 | + case mir_window_type_dialog: // dialog |
1825 | + case mir_window_type_satellite:// satellite |
1826 | + case mir_window_type_freestyle:// freestyle |
1827 | break; |
1828 | |
1829 | - case mir_surface_type_gloss: |
1830 | - case mir_surface_type_menu: |
1831 | - case mir_surface_type_inputmethod: |
1832 | - case mir_surface_type_tip: |
1833 | - case mir_surface_types: |
1834 | + case mir_window_type_gloss: |
1835 | + case mir_window_type_menu: |
1836 | + case mir_window_type_inputmethod: |
1837 | + case mir_window_type_tip: |
1838 | + case mir_window_types: |
1839 | return; |
1840 | } |
1841 | |
1842 | switch (window_info.state()) |
1843 | { |
1844 | - case mir_surface_state_restored: |
1845 | + case mir_window_state_restored: |
1846 | break; |
1847 | |
1848 | // "A vertically maximised window is anchored to the top and bottom of |
1849 | // the available workspace and can have any width." |
1850 | - case mir_surface_state_vertmaximized: |
1851 | + case mir_window_state_vertmaximized: |
1852 | movement.dy = DeltaY(0); |
1853 | break; |
1854 | |
1855 | // "A horizontally maximised window is anchored to the left and right of |
1856 | // the available workspace and can have any height" |
1857 | - case mir_surface_state_horizmaximized: |
1858 | + case mir_window_state_horizmaximized: |
1859 | movement.dx = DeltaX(0); |
1860 | break; |
1861 | |
1862 | // "A maximised window is anchored to the top, bottom, left and right of the |
1863 | // available workspace. For example, if the launcher is always-visible then |
1864 | // the left-edge of the window is anchored to the right-edge of the launcher." |
1865 | - case mir_surface_state_maximized: |
1866 | - case mir_surface_state_fullscreen: |
1867 | + case mir_window_state_maximized: |
1868 | + case mir_window_state_fullscreen: |
1869 | default: |
1870 | return; |
1871 | } |
1872 | @@ -1071,10 +1074,10 @@ |
1873 | -> WindowSpecification |
1874 | { |
1875 | if (!parameters.type().is_set()) |
1876 | - parameters.type() = mir_surface_type_normal; |
1877 | + parameters.type() = mir_window_type_normal; |
1878 | |
1879 | if (!parameters.state().is_set()) |
1880 | - parameters.state() = mir_surface_state_restored; |
1881 | + parameters.state() = mir_window_state_restored; |
1882 | |
1883 | auto const active_display_area = active_display(); |
1884 | auto const height = parameters.size().value().height.as_int(); |
1885 | @@ -1090,7 +1093,7 @@ |
1886 | display_layout->place_in_output(id, rect); |
1887 | parameters.top_left() = rect.top_left; |
1888 | parameters.size() = rect.size; |
1889 | - parameters.state() = mir_surface_state_fullscreen; |
1890 | + parameters.state() = mir_window_state_fullscreen; |
1891 | positioned = true; |
1892 | } |
1893 | else if (!has_parent) // No parent => client can't suggest positioning |
1894 | @@ -1157,19 +1160,19 @@ |
1895 | |
1896 | switch (parameters.state().value()) |
1897 | { |
1898 | - case mir_surface_state_fullscreen: |
1899 | - case mir_surface_state_maximized: |
1900 | + case mir_window_state_fullscreen: |
1901 | + case mir_window_state_maximized: |
1902 | parameters.top_left() = active_display_area.top_left; |
1903 | parameters.size() = active_display_area.size; |
1904 | break; |
1905 | |
1906 | - case mir_surface_state_vertmaximized: |
1907 | + case mir_window_state_vertmaximized: |
1908 | centred.y = active_display_area.top_left.y; |
1909 | parameters.top_left() = centred; |
1910 | parameters.size() = Size{parameters.size().value().width, active_display_area.size.height}; |
1911 | break; |
1912 | |
1913 | - case mir_surface_state_horizmaximized: |
1914 | + case mir_window_state_horizmaximized: |
1915 | centred.x = active_display_area.top_left.x; |
1916 | parameters.top_left() = centred; |
1917 | parameters.size() = Size{active_display_area.size.width, parameters.size().value().height}; |
1918 | @@ -1525,37 +1528,37 @@ |
1919 | |
1920 | switch (original_type) |
1921 | { |
1922 | - case mir_surface_type_normal: |
1923 | - case mir_surface_type_utility: |
1924 | - case mir_surface_type_dialog: |
1925 | - case mir_surface_type_satellite: |
1926 | - switch (target_type) |
1927 | - { |
1928 | - case mir_surface_type_normal: |
1929 | - case mir_surface_type_utility: |
1930 | - case mir_surface_type_dialog: |
1931 | - case mir_surface_type_satellite: |
1932 | - break; |
1933 | - |
1934 | - default: |
1935 | - BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change")); |
1936 | - } |
1937 | - |
1938 | - case mir_surface_type_menu: |
1939 | - switch (target_type) |
1940 | - { |
1941 | - case mir_surface_type_menu: |
1942 | - case mir_surface_type_satellite: |
1943 | - break; |
1944 | - |
1945 | - default: |
1946 | - BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change")); |
1947 | - } |
1948 | - |
1949 | - case mir_surface_type_gloss: |
1950 | - case mir_surface_type_freestyle: |
1951 | - case mir_surface_type_inputmethod: |
1952 | - case mir_surface_type_tip: |
1953 | + case mir_window_type_normal: |
1954 | + case mir_window_type_utility: |
1955 | + case mir_window_type_dialog: |
1956 | + case mir_window_type_satellite: |
1957 | + switch (target_type) |
1958 | + { |
1959 | + case mir_window_type_normal: |
1960 | + case mir_window_type_utility: |
1961 | + case mir_window_type_dialog: |
1962 | + case mir_window_type_satellite: |
1963 | + break; |
1964 | + |
1965 | + default: |
1966 | + BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change")); |
1967 | + } |
1968 | + |
1969 | + case mir_window_type_menu: |
1970 | + switch (target_type) |
1971 | + { |
1972 | + case mir_window_type_menu: |
1973 | + case mir_window_type_satellite: |
1974 | + break; |
1975 | + |
1976 | + default: |
1977 | + BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change")); |
1978 | + } |
1979 | + |
1980 | + case mir_window_type_gloss: |
1981 | + case mir_window_type_freestyle: |
1982 | + case mir_window_type_inputmethod: |
1983 | + case mir_window_type_tip: |
1984 | if (target_type != original_type) |
1985 | BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change")); |
1986 | break; |
1987 | @@ -1567,23 +1570,23 @@ |
1988 | |
1989 | switch (target_type) |
1990 | { |
1991 | - case mir_surface_type_normal: |
1992 | - case mir_surface_type_utility: |
1993 | + case mir_window_type_normal: |
1994 | + case mir_window_type_utility: |
1995 | if (modifications.parent().is_set() ? modifications.parent().value().lock() : window_info.parent()) |
1996 | - BOOST_THROW_EXCEPTION(std::runtime_error("Surface type must not have a parent")); |
1997 | + BOOST_THROW_EXCEPTION(std::runtime_error("Window type must not have a parent")); |
1998 | break; |
1999 | |
2000 | - case mir_surface_type_satellite: |
2001 | - case mir_surface_type_gloss: |
2002 | - case mir_surface_type_tip: |
2003 | + case mir_window_type_satellite: |
2004 | + case mir_window_type_gloss: |
2005 | + case mir_window_type_tip: |
2006 | if (modifications.parent().is_set() ? !modifications.parent().value().lock() : !window_info.parent()) |
2007 | - BOOST_THROW_EXCEPTION(std::runtime_error("Surface type must have a parent")); |
2008 | + BOOST_THROW_EXCEPTION(std::runtime_error("Window type must have a parent")); |
2009 | break; |
2010 | |
2011 | - case mir_surface_type_inputmethod: |
2012 | - case mir_surface_type_dialog: |
2013 | - case mir_surface_type_menu: |
2014 | - case mir_surface_type_freestyle: |
2015 | + case mir_window_type_inputmethod: |
2016 | + case mir_window_type_dialog: |
2017 | + case mir_window_type_menu: |
2018 | + case mir_window_type_freestyle: |
2019 | break; |
2020 | |
2021 | default: |
2022 | |
2023 | === modified file 'miral/basic_window_manager.h' |
2024 | --- miral/basic_window_manager.h 2016-12-20 15:34:11 +0000 |
2025 | +++ miral/basic_window_manager.h 2017-01-26 16:46:42 +0000 |
2026 | @@ -94,7 +94,7 @@ |
2027 | int set_surface_attribute( |
2028 | std::shared_ptr<mir::scene::Session> const& /*application*/, |
2029 | std::shared_ptr<mir::scene::Surface> const& surface, |
2030 | - MirSurfaceAttrib attrib, |
2031 | + MirWindowAttrib attrib, |
2032 | int value) override; |
2033 | |
2034 | auto count_applications() const -> unsigned int override; |
2035 | @@ -172,7 +172,7 @@ |
2036 | void erase(miral::WindowInfo const& info); |
2037 | void validate_modification_request(WindowSpecification const& modifications, WindowInfo const& window_info) const; |
2038 | void place_and_size(WindowInfo& root, Point const& new_pos, Size const& new_size); |
2039 | - void set_state(miral::WindowInfo& window_info, MirSurfaceState value); |
2040 | + void set_state(miral::WindowInfo& window_info, MirWindowState value); |
2041 | auto fullscreen_rect_for(WindowInfo const& window_info) const -> Rectangle; |
2042 | void remove_window(Application const& application, miral::WindowInfo const& info); |
2043 | }; |
2044 | |
2045 | === added file 'miral/both_versions.h' |
2046 | --- miral/both_versions.h 1970-01-01 00:00:00 +0000 |
2047 | +++ miral/both_versions.h 2017-01-26 16:46:42 +0000 |
2048 | @@ -0,0 +1,48 @@ |
2049 | +/* |
2050 | + * Copyright © 2017 Canonical Ltd. |
2051 | + * |
2052 | + * This program is free software: you can redistribute it and/or modify it |
2053 | + * under the terms of the GNU General Public License version 3, |
2054 | + * as published by the Free Software Foundation. |
2055 | + * |
2056 | + * This program is distributed in the hope that it will be useful, |
2057 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2058 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2059 | + * GNU General Public License for more details. |
2060 | + * |
2061 | + * You should have received a copy of the GNU General Public License |
2062 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2063 | + * |
2064 | + * Authored by: Alan Griffiths <alan@octopull.co.uk> |
2065 | + */ |
2066 | + |
2067 | +#ifndef MIRAL_BOTH_VERSIONS_H |
2068 | +#define MIRAL_BOTH_VERSIONS_H |
2069 | + |
2070 | +#include <mir/version.h> |
2071 | + |
2072 | +#if (MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 26, 0)) |
2073 | + #ifndef __clang__ |
2074 | + #define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\ |
2075 | + extern "C" __attribute__((alias(#new_sym))) void old_sym();\ |
2076 | + __asm__(".symver old_sym,old_sym@" #old_version);\ |
2077 | + __asm__(".symver new_sym,new_sym@@" #new_version); |
2078 | + #else |
2079 | + #define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\ |
2080 | + __asm__(".symver new_sym,old_sym@" #old_version);\ |
2081 | + __asm__(".symver new_sym,new_sym@@@" #new_version); |
2082 | + #endif |
2083 | +#else |
2084 | + #ifndef __clang__ |
2085 | + #define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\ |
2086 | + extern "C" __attribute__((alias(#old_sym))) void new_sym();\ |
2087 | + __asm__(".symver old_sym,old_sym@" #old_version);\ |
2088 | + __asm__(".symver new_sym,new_sym@@" #new_version); |
2089 | + #else |
2090 | +#define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\ |
2091 | + __asm__(".symver old_sym,old_sym@" #old_version);\ |
2092 | + __asm__(".symver old_sym,new_sym@@@" #new_version); |
2093 | + #endif |
2094 | +#endif |
2095 | + |
2096 | +#endif //MIRAL_BOTH_VERSIONS_H |
2097 | |
2098 | === modified file 'miral/canonical_window_manager.cpp' |
2099 | --- miral/canonical_window_manager.cpp 2017-01-18 17:41:46 +0000 |
2100 | +++ miral/canonical_window_manager.cpp 2017-01-26 16:46:42 +0000 |
2101 | @@ -30,7 +30,14 @@ |
2102 | { |
2103 | } |
2104 | |
2105 | -auto miral::CanonicalWindowManagerPolicy::place_new_surface( |
2106 | +#ifndef __clang__ |
2107 | +extern "C" __attribute__((alias("_ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE"))) void _ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE(); |
2108 | +__asm__(".symver _ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE,_ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE@MIRAL_1.0"); |
2109 | +#else |
2110 | +__asm__(".symver _ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE,_ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE@MIRAL_1.0"); |
2111 | +__asm__(".symver _ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE,_ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE@@@MIRAL_1.1"); |
2112 | +#endif |
2113 | +auto miral::CanonicalWindowManagerPolicy::place_new_window( |
2114 | miral::ApplicationInfo const& /*app_info*/, |
2115 | miral::WindowSpecification const& request_parameters) |
2116 | -> miral::WindowSpecification |
2117 | |
2118 | === modified file 'miral/coordinate_translator.cpp' |
2119 | --- miral/coordinate_translator.cpp 2016-11-14 10:49:35 +0000 |
2120 | +++ miral/coordinate_translator.cpp 2017-01-26 16:46:42 +0000 |
2121 | @@ -44,3 +44,8 @@ |
2122 | auto const& scene_surface = std::dynamic_pointer_cast<mir::scene::Surface>(surface); |
2123 | return scene_surface->top_left() + mir::geometry::Displacement{x, y}; |
2124 | } |
2125 | + |
2126 | +bool miral::CoordinateTranslator::translation_supported() const |
2127 | +{ |
2128 | + return enabled; |
2129 | +} |
2130 | |
2131 | === modified file 'miral/coordinate_translator.h' |
2132 | --- miral/coordinate_translator.h 2016-11-14 10:49:35 +0000 |
2133 | +++ miral/coordinate_translator.h 2017-01-26 16:46:42 +0000 |
2134 | @@ -23,6 +23,11 @@ |
2135 | |
2136 | #include <atomic> |
2137 | |
2138 | +#ifdef __clang__ |
2139 | +#pragma clang diagnostic push |
2140 | +#pragma clang diagnostic ignored "-Winconsistent-missing-override" |
2141 | +#endif |
2142 | + |
2143 | namespace miral |
2144 | { |
2145 | class CoordinateTranslator : public mir::scene::CoordinateTranslator |
2146 | @@ -34,9 +39,14 @@ |
2147 | auto surface_to_screen(std::shared_ptr<mir::frontend::Surface> surface, int32_t x, int32_t y) |
2148 | -> mir::geometry::Point override; |
2149 | |
2150 | + bool translation_supported() const; |
2151 | + |
2152 | private: |
2153 | std::atomic<bool> enabled{false}; |
2154 | }; |
2155 | } |
2156 | +#ifdef __clang__ |
2157 | +#pragma clang diagnostic pop |
2158 | +#endif |
2159 | |
2160 | #endif //MIRAL_COORDINATE_TRANSLATOR_H |
2161 | |
2162 | === modified file 'miral/keymap.cpp' |
2163 | --- miral/keymap.cpp 2016-10-20 07:34:53 +0000 |
2164 | +++ miral/keymap.cpp 2017-01-26 16:46:42 +0000 |
2165 | @@ -25,7 +25,10 @@ |
2166 | #include <mir/server.h> |
2167 | #include <mir/version.h> |
2168 | |
2169 | -#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 24, 1) |
2170 | +#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 26, 0) |
2171 | +#include <mir/input/keymap.h> |
2172 | +#include <mir/input/mir_keyboard_config.h> |
2173 | +#elif MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 24, 1) |
2174 | #include <mir/input/keymap.h> |
2175 | #include <mir/input/keyboard_configuration.h> |
2176 | #endif |
2177 | @@ -112,7 +115,11 @@ |
2178 | |
2179 | if (keyboard_config.is_set()) |
2180 | { |
2181 | +#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 26, 0) |
2182 | + keymap = keyboard_config.value().device_keymap(); |
2183 | +#else |
2184 | keymap = keyboard_config.value().device_keymap; |
2185 | +#endif |
2186 | } |
2187 | |
2188 | keymap.layout = layout; |
2189 | |
2190 | === modified file 'miral/symbols.map' |
2191 | --- miral/symbols.map 2016-12-13 13:07:15 +0000 |
2192 | +++ miral/symbols.map 2017-01-26 16:46:42 +0000 |
2193 | @@ -112,7 +112,6 @@ |
2194 | miral::WindowInfo::WindowInfo*; |
2195 | miral::WindowInfo::add_child*; |
2196 | miral::WindowInfo::can_be_active*; |
2197 | - miral::WindowInfo::can_morph_to*; |
2198 | miral::WindowInfo::children*; |
2199 | miral::WindowInfo::confine_pointer*; |
2200 | miral::WindowInfo::constrain_resize*; |
2201 | @@ -128,15 +127,12 @@ |
2202 | miral::WindowInfo::must_have_parent*; |
2203 | miral::WindowInfo::must_not_have_parent*; |
2204 | miral::WindowInfo::name*; |
2205 | - miral::WindowInfo::needs_titlebar*; |
2206 | miral::WindowInfo::operator*; |
2207 | miral::WindowInfo::output_id*; |
2208 | miral::WindowInfo::parent*; |
2209 | miral::WindowInfo::preferred_orientation*; |
2210 | miral::WindowInfo::remove_child*; |
2211 | miral::WindowInfo::restore_rect*; |
2212 | - miral::WindowInfo::state*; |
2213 | - miral::WindowInfo::type*; |
2214 | miral::WindowInfo::userdata*; |
2215 | miral::WindowInfo::width_inc*; |
2216 | miral::WindowInfo::window*; |
2217 | @@ -153,7 +149,6 @@ |
2218 | miral::WindowManagementPolicy::advise_new_window*; |
2219 | miral::WindowManagementPolicy::advise_raise*; |
2220 | miral::WindowManagementPolicy::advise_resize*; |
2221 | - miral::WindowManagementPolicy::advise_state_change*; |
2222 | miral::WindowManagementPolicy::operator*; |
2223 | miral::WindowManagerOptions::WindowManagerOptions*; |
2224 | miral::WindowManagerOptions::operator*; |
2225 | @@ -311,5 +306,46 @@ |
2226 | vtable?for?miral::toolkit::Surface; |
2227 | vtable?for?miral::toolkit::SurfaceSpec; |
2228 | }; |
2229 | +# miral::WindowInfo::can_morph_to*; |
2230 | + _ZNK5miral10WindowInfo12can_morph_toE14MirSurfaceType; |
2231 | + |
2232 | +# miral::WindowInfo::needs_titlebar*; |
2233 | + _ZN5miral10WindowInfo14needs_titlebarE14MirSurfaceType; |
2234 | + |
2235 | +# miral::WindowInfo::state*; |
2236 | + _ZNK5miral10WindowInfo5stateEv; |
2237 | + _ZN5miral10WindowInfo5stateE15MirSurfaceState; |
2238 | + |
2239 | +# miral::WindowInfo::type*; |
2240 | + _ZN5miral10WindowInfo4typeE14MirSurfaceType; |
2241 | + _ZNK5miral10WindowInfo4typeEv; |
2242 | + |
2243 | +# miral::WindowManagementPolicy::advise_state_change*; |
2244 | + _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE15MirSurfaceState; |
2245 | local: *; |
2246 | }; |
2247 | + |
2248 | +MIRAL_1.1 { |
2249 | +global: |
2250 | + # miral::WindowInfo::can_morph_to* |
2251 | + _ZNK5miral10WindowInfo12can_morph_toE13MirWindowType; |
2252 | + |
2253 | + #miral::WindowInfo::needs_titlebar*; |
2254 | + _ZN5miral10WindowInfo14needs_titlebarE13MirWindowType; |
2255 | + |
2256 | + # miral::WindowInfo::state*; |
2257 | + _ZNK5miral10WindowInfo5stateEv; |
2258 | + _ZN5miral10WindowInfo5stateE14MirWindowState; |
2259 | + |
2260 | + miral::WindowInfo::type*; |
2261 | + _ZN5miral10WindowInfo4typeE13MirWindowType; |
2262 | + _ZNK5miral10WindowInfo4typeEv; |
2263 | + |
2264 | + # miral::WindowManagementPolicy::advise_state_change*; |
2265 | + _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE14MirWindowState; |
2266 | + |
2267 | + extern "C++" { |
2268 | + miral::CanonicalWindowManagerPolicy::place_new_window*; |
2269 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::place_new_window*; |
2270 | + }; |
2271 | +} MIRAL_1.0; |
2272 | |
2273 | === modified file 'miral/window_info.cpp' |
2274 | --- miral/window_info.cpp 2016-12-13 13:07:15 +0000 |
2275 | +++ miral/window_info.cpp 2017-01-26 16:46:42 +0000 |
2276 | @@ -18,7 +18,10 @@ |
2277 | |
2278 | #include "miral/window_info.h" |
2279 | |
2280 | +#include "both_versions.h" |
2281 | + |
2282 | #include <mir/scene/surface.h> |
2283 | +#include <mir/version.h> |
2284 | |
2285 | #include <limits> |
2286 | |
2287 | @@ -41,8 +44,8 @@ |
2288 | |
2289 | Window window; |
2290 | std::string name; |
2291 | - MirSurfaceType type; |
2292 | - MirSurfaceState state; |
2293 | + MirWindowType type; |
2294 | + MirWindowState state; |
2295 | mir::geometry::Rectangle restore_rect; |
2296 | Window parent; |
2297 | std::vector <Window> children; |
2298 | @@ -64,8 +67,8 @@ |
2299 | miral::WindowInfo::Self::Self(Window window, WindowSpecification const& params) : |
2300 | window{window}, |
2301 | name{params.name().value()}, |
2302 | - type{optional_value_or_default(params.type(), mir_surface_type_normal)}, |
2303 | - state{optional_value_or_default(params.state(), mir_surface_state_restored)}, |
2304 | + type{optional_value_or_default(params.type(), mir_window_type_normal)}, |
2305 | + state{optional_value_or_default(params.state(), mir_window_state_restored)}, |
2306 | restore_rect{params.top_left().value(), params.size().value()}, |
2307 | min_width{optional_value_or_default(params.min_width())}, |
2308 | min_height{optional_value_or_default(params.min_height())}, |
2309 | @@ -86,8 +89,8 @@ |
2310 | } |
2311 | |
2312 | miral::WindowInfo::Self::Self() : |
2313 | - type{mir_surface_type_normal}, |
2314 | - state{mir_surface_state_unknown}, |
2315 | + type{mir_window_type_normal}, |
2316 | + state{mir_window_state_unknown}, |
2317 | preferred_orientation{mir_orientation_mode_any} |
2318 | { |
2319 | } |
2320 | @@ -123,17 +126,17 @@ |
2321 | { |
2322 | switch (type()) |
2323 | { |
2324 | - case mir_surface_type_normal: /**< AKA "regular" */ |
2325 | - case mir_surface_type_utility: /**< AKA "floating" */ |
2326 | - case mir_surface_type_dialog: |
2327 | - case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
2328 | - case mir_surface_type_freestyle: |
2329 | - case mir_surface_type_menu: |
2330 | - case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
2331 | + case mir_window_type_normal: /**< AKA "regular" */ |
2332 | + case mir_window_type_utility: /**< AKA "floating" */ |
2333 | + case mir_window_type_dialog: |
2334 | + case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
2335 | + case mir_window_type_freestyle: |
2336 | + case mir_window_type_menu: |
2337 | + case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
2338 | return true; |
2339 | |
2340 | - case mir_surface_type_gloss: |
2341 | - case mir_surface_type_tip: /**< AKA "tooltip" */ |
2342 | + case mir_window_type_gloss: |
2343 | + case mir_window_type_tip: /**< AKA "tooltip" */ |
2344 | default: |
2345 | // Cannot have input focus |
2346 | return false; |
2347 | @@ -144,10 +147,10 @@ |
2348 | { |
2349 | switch (type()) |
2350 | { |
2351 | - case mir_surface_type_overlay:; |
2352 | - case mir_surface_type_inputmethod: |
2353 | - case mir_surface_type_satellite: |
2354 | - case mir_surface_type_tip: |
2355 | + case mir_window_type_gloss:; |
2356 | + case mir_window_type_inputmethod: |
2357 | + case mir_window_type_satellite: |
2358 | + case mir_window_type_tip: |
2359 | return true; |
2360 | |
2361 | default: |
2362 | @@ -155,19 +158,22 @@ |
2363 | } |
2364 | } |
2365 | |
2366 | -bool miral::WindowInfo::can_morph_to(MirSurfaceType new_type) const |
2367 | +MIRAL_BOTH_VERSIONS( |
2368 | + _ZNK5miral10WindowInfo12can_morph_toE14MirSurfaceType, MIRAL_1.0, |
2369 | + _ZNK5miral10WindowInfo12can_morph_toE13MirWindowType, MIRAL_1.1) |
2370 | +bool miral::WindowInfo::can_morph_to(MirWindowType new_type) const |
2371 | { |
2372 | switch (new_type) |
2373 | { |
2374 | - case mir_surface_type_normal: |
2375 | - case mir_surface_type_utility: |
2376 | - case mir_surface_type_satellite: |
2377 | + case mir_window_type_normal: |
2378 | + case mir_window_type_utility: |
2379 | + case mir_window_type_satellite: |
2380 | switch (type()) |
2381 | { |
2382 | - case mir_surface_type_normal: |
2383 | - case mir_surface_type_utility: |
2384 | - case mir_surface_type_dialog: |
2385 | - case mir_surface_type_satellite: |
2386 | + case mir_window_type_normal: |
2387 | + case mir_window_type_utility: |
2388 | + case mir_window_type_dialog: |
2389 | + case mir_window_type_satellite: |
2390 | return true; |
2391 | |
2392 | default: |
2393 | @@ -175,14 +181,14 @@ |
2394 | } |
2395 | break; |
2396 | |
2397 | - case mir_surface_type_dialog: |
2398 | + case mir_window_type_dialog: |
2399 | switch (type()) |
2400 | { |
2401 | - case mir_surface_type_normal: |
2402 | - case mir_surface_type_utility: |
2403 | - case mir_surface_type_dialog: |
2404 | - case mir_surface_type_popover: |
2405 | - case mir_surface_type_satellite: |
2406 | + case mir_window_type_normal: |
2407 | + case mir_window_type_utility: |
2408 | + case mir_window_type_dialog: |
2409 | + case mir_window_type_menu: |
2410 | + case mir_window_type_satellite: |
2411 | return true; |
2412 | |
2413 | default: |
2414 | @@ -201,8 +207,8 @@ |
2415 | { |
2416 | switch (type()) |
2417 | { |
2418 | - case mir_surface_type_normal: |
2419 | - case mir_surface_type_utility: |
2420 | + case mir_window_type_normal: |
2421 | + case mir_window_type_utility: |
2422 | return true; |
2423 | |
2424 | default: |
2425 | @@ -214,8 +220,8 @@ |
2426 | { |
2427 | switch (state()) |
2428 | { |
2429 | - case mir_surface_state_hidden: |
2430 | - case mir_surface_state_minimized: |
2431 | + case mir_window_state_hidden: |
2432 | + case mir_window_state_minimized: |
2433 | return false; |
2434 | default: |
2435 | if (std::shared_ptr<mir::scene::Surface> surface = window()) |
2436 | @@ -312,19 +318,19 @@ |
2437 | |
2438 | switch (state()) |
2439 | { |
2440 | - case mir_surface_state_restored: |
2441 | + case mir_window_state_restored: |
2442 | break; |
2443 | |
2444 | // "A vertically maximised window is anchored to the top and bottom of |
2445 | // the available workspace and can have any width." |
2446 | - case mir_surface_state_vertmaximized: |
2447 | + case mir_window_state_vertmaximized: |
2448 | new_pos.y = self->window.top_left().y; |
2449 | new_size.height = self->window.size().height; |
2450 | break; |
2451 | |
2452 | // "A horizontally maximised window is anchored to the left and right of |
2453 | // the available workspace and can have any height" |
2454 | - case mir_surface_state_horizmaximized: |
2455 | + case mir_window_state_horizmaximized: |
2456 | new_pos.x = self->window.top_left().x; |
2457 | new_size.width = self->window.size().width; |
2458 | break; |
2459 | @@ -332,7 +338,7 @@ |
2460 | // "A maximised window is anchored to the top, bottom, left and right of the |
2461 | // available workspace. For example, if the launcher is always-visible then |
2462 | // the left-edge of the window is anchored to the right-edge of the launcher." |
2463 | - case mir_surface_state_maximized: |
2464 | + case mir_window_state_maximized: |
2465 | default: |
2466 | new_pos.x = self->window.top_left().x; |
2467 | new_pos.y = self->window.top_left().y; |
2468 | @@ -345,15 +351,18 @@ |
2469 | requested_size = new_size; |
2470 | } |
2471 | |
2472 | -bool miral::WindowInfo::needs_titlebar(MirSurfaceType type) |
2473 | +MIRAL_BOTH_VERSIONS( |
2474 | + _ZN5miral10WindowInfo14needs_titlebarE14MirSurfaceType, MIRAL_1.0, |
2475 | + _ZN5miral10WindowInfo14needs_titlebarE13MirWindowType, MIRAL_1.1) |
2476 | +bool miral::WindowInfo::needs_titlebar(MirWindowType type) |
2477 | { |
2478 | switch (type) |
2479 | { |
2480 | - case mir_surface_type_freestyle: |
2481 | - case mir_surface_type_menu: |
2482 | - case mir_surface_type_inputmethod: |
2483 | - case mir_surface_type_gloss: |
2484 | - case mir_surface_type_tip: |
2485 | + case mir_window_type_freestyle: |
2486 | + case mir_window_type_menu: |
2487 | + case mir_window_type_inputmethod: |
2488 | + case mir_window_type_gloss: |
2489 | + case mir_window_type_tip: |
2490 | // No decorations for these surface types |
2491 | return false; |
2492 | default: |
2493 | @@ -361,22 +370,28 @@ |
2494 | } |
2495 | } |
2496 | |
2497 | -auto miral::WindowInfo::type() const -> MirSurfaceType |
2498 | +auto miral::WindowInfo::type() const -> MirWindowType |
2499 | { |
2500 | return self->type; |
2501 | } |
2502 | |
2503 | -void miral::WindowInfo::type(MirSurfaceType type) |
2504 | +MIRAL_BOTH_VERSIONS( |
2505 | + _ZN5miral10WindowInfo4typeE14MirSurfaceType, MIRAL_1.0, |
2506 | + _ZN5miral10WindowInfo4typeE13MirWindowType, MIRAL_1.1) |
2507 | +void miral::WindowInfo::type(MirWindowType type) |
2508 | { |
2509 | self->type = type; |
2510 | } |
2511 | |
2512 | -auto miral::WindowInfo::state() const -> MirSurfaceState |
2513 | +auto miral::WindowInfo::state() const -> MirWindowState |
2514 | { |
2515 | return self->state; |
2516 | } |
2517 | |
2518 | -void miral::WindowInfo::state(MirSurfaceState state) |
2519 | +MIRAL_BOTH_VERSIONS( |
2520 | + _ZN5miral10WindowInfo5stateE15MirSurfaceState, MIRAL_1.0, |
2521 | + _ZN5miral10WindowInfo5stateE14MirWindowState, MIRAL_1.1) |
2522 | +void miral::WindowInfo::state(MirWindowState state) |
2523 | { |
2524 | self->state = state; |
2525 | } |
2526 | |
2527 | === modified file 'miral/window_management_policy.cpp' |
2528 | --- miral/window_management_policy.cpp 2016-08-10 11:48:02 +0000 |
2529 | +++ miral/window_management_policy.cpp 2017-01-26 16:46:42 +0000 |
2530 | @@ -17,6 +17,7 @@ |
2531 | */ |
2532 | |
2533 | #include "miral/window_management_policy.h" |
2534 | +#include "both_versions.h" |
2535 | |
2536 | void miral::WindowManagementPolicy::advise_begin() {} |
2537 | void miral::WindowManagementPolicy::advise_end() {} |
2538 | @@ -25,7 +26,11 @@ |
2539 | void miral::WindowManagementPolicy::advise_new_window(WindowInfo const& /*window_info*/) {} |
2540 | void miral::WindowManagementPolicy::advise_focus_lost(WindowInfo const& /*info*/) {} |
2541 | void miral::WindowManagementPolicy::advise_focus_gained(WindowInfo const& /*info*/) {} |
2542 | -void miral::WindowManagementPolicy::advise_state_change(WindowInfo const& /*window_info*/, MirSurfaceState /*state*/) {} |
2543 | + |
2544 | +MIRAL_BOTH_VERSIONS( |
2545 | + _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE15MirSurfaceState, MIRAL_1.0, |
2546 | + _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE14MirWindowState, MIRAL_1.1) |
2547 | +void miral::WindowManagementPolicy::advise_state_change(WindowInfo const& /*window_info*/, MirWindowState /*state*/) {} |
2548 | void miral::WindowManagementPolicy::advise_move_to(WindowInfo const& /*window_info*/, Point /*top_left*/) {} |
2549 | void miral::WindowManagementPolicy::advise_resize(WindowInfo const& /*window_info*/, Size const& /*new_size*/) {} |
2550 | void miral::WindowManagementPolicy::advise_delete_window(WindowInfo const& /*window_info*/) {} |
2551 | |
2552 | === modified file 'miral/window_management_trace.cpp' |
2553 | --- miral/window_management_trace.cpp 2016-12-05 09:46:35 +0000 |
2554 | +++ miral/window_management_trace.cpp 2017-01-26 16:46:42 +0000 |
2555 | @@ -29,9 +29,20 @@ |
2556 | |
2557 | #define MIR_LOG_COMPONENT "miral::Window Management" |
2558 | #include <mir/log.h> |
2559 | +#include <mir/report_exception.h> |
2560 | |
2561 | using mir::operator<<; |
2562 | |
2563 | +#define MIRAL_TRACE_EXCEPTION \ |
2564 | +catch (std::exception const& x)\ |
2565 | +{\ |
2566 | + std::stringstream out;\ |
2567 | + mir::report_exception(out);\ |
2568 | + mir::log_warning("%s throws %s", __func__, out.str().c_str());\ |
2569 | + throw;\ |
2570 | +} |
2571 | + |
2572 | + |
2573 | namespace |
2574 | { |
2575 | std::string const null_ptr{"(null)"}; |
2576 | @@ -273,7 +284,7 @@ |
2577 | return out.str(); |
2578 | } |
2579 | |
2580 | -auto dump_of(MirSurfaceState state) -> std::string |
2581 | +auto dump_of(MirWindowState state) -> std::string |
2582 | { |
2583 | std::stringstream out; |
2584 | out << state; |
2585 | @@ -304,95 +315,105 @@ |
2586 | } |
2587 | |
2588 | auto miral::WindowManagementTrace::count_applications() const -> unsigned int |
2589 | -{ |
2590 | +try { |
2591 | log_input(); |
2592 | auto const result = wrapped.count_applications(); |
2593 | mir::log_info("%s -> %d", __func__, result); |
2594 | trace_count++; |
2595 | return result; |
2596 | } |
2597 | +MIRAL_TRACE_EXCEPTION |
2598 | |
2599 | void miral::WindowManagementTrace::for_each_application(std::function<void(miral::ApplicationInfo&)> const& functor) |
2600 | -{ |
2601 | +try { |
2602 | log_input(); |
2603 | mir::log_info("%s", __func__); |
2604 | trace_count++; |
2605 | wrapped.for_each_application(functor); |
2606 | } |
2607 | +MIRAL_TRACE_EXCEPTION |
2608 | |
2609 | auto miral::WindowManagementTrace::find_application(std::function<bool(ApplicationInfo const& info)> const& predicate) |
2610 | -> Application |
2611 | -{ |
2612 | +try { |
2613 | log_input(); |
2614 | auto result = wrapped.find_application(predicate); |
2615 | mir::log_info("%s -> %s", __func__, dump_of(result).c_str()); |
2616 | trace_count++; |
2617 | return result; |
2618 | } |
2619 | +MIRAL_TRACE_EXCEPTION |
2620 | |
2621 | auto miral::WindowManagementTrace::info_for(std::weak_ptr<mir::scene::Session> const& session) const -> ApplicationInfo& |
2622 | -{ |
2623 | +try { |
2624 | log_input(); |
2625 | auto& result = wrapped.info_for(session); |
2626 | mir::log_info("%s -> %s", __func__, result.application()->name().c_str()); |
2627 | trace_count++; |
2628 | return result; |
2629 | } |
2630 | +MIRAL_TRACE_EXCEPTION |
2631 | |
2632 | auto miral::WindowManagementTrace::info_for(std::weak_ptr<mir::scene::Surface> const& surface) const -> WindowInfo& |
2633 | -{ |
2634 | +try { |
2635 | log_input(); |
2636 | auto& result = wrapped.info_for(surface); |
2637 | mir::log_info("%s -> %s", __func__, result.name().c_str()); |
2638 | trace_count++; |
2639 | return result; |
2640 | } |
2641 | +MIRAL_TRACE_EXCEPTION |
2642 | |
2643 | auto miral::WindowManagementTrace::info_for(Window const& window) const -> WindowInfo& |
2644 | -{ |
2645 | +try { |
2646 | log_input(); |
2647 | auto& result = wrapped.info_for(window); |
2648 | mir::log_info("%s -> %s", __func__, result.name().c_str()); |
2649 | trace_count++; |
2650 | return result; |
2651 | } |
2652 | +MIRAL_TRACE_EXCEPTION |
2653 | |
2654 | void miral::WindowManagementTrace::ask_client_to_close(miral::Window const& window) |
2655 | -{ |
2656 | +try { |
2657 | log_input(); |
2658 | mir::log_info("%s -> %s", __func__, dump_of(window).c_str()); |
2659 | trace_count++; |
2660 | wrapped.ask_client_to_close(window); |
2661 | } |
2662 | +MIRAL_TRACE_EXCEPTION |
2663 | |
2664 | void miral::WindowManagementTrace::force_close(miral::Window const& window) |
2665 | -{ |
2666 | +try { |
2667 | log_input(); |
2668 | mir::log_info("%s -> %s", __func__, dump_of(window).c_str()); |
2669 | trace_count++; |
2670 | wrapped.force_close(window); |
2671 | } |
2672 | +MIRAL_TRACE_EXCEPTION |
2673 | |
2674 | auto miral::WindowManagementTrace::active_window() const -> Window |
2675 | -{ |
2676 | +try { |
2677 | log_input(); |
2678 | auto result = wrapped.active_window(); |
2679 | mir::log_info("%s -> %s", __func__, dump_of(result).c_str()); |
2680 | trace_count++; |
2681 | return result; |
2682 | } |
2683 | +MIRAL_TRACE_EXCEPTION |
2684 | |
2685 | auto miral::WindowManagementTrace::select_active_window(Window const& hint) -> Window |
2686 | -{ |
2687 | +try { |
2688 | log_input(); |
2689 | auto result = wrapped.select_active_window(hint); |
2690 | mir::log_info("%s hint=%s -> %s", __func__, dump_of(hint).c_str(), dump_of(result).c_str()); |
2691 | trace_count++; |
2692 | return result; |
2693 | } |
2694 | +MIRAL_TRACE_EXCEPTION |
2695 | |
2696 | auto miral::WindowManagementTrace::window_at(mir::geometry::Point cursor) const -> Window |
2697 | -{ |
2698 | +try { |
2699 | log_input(); |
2700 | auto result = wrapped.window_at(cursor); |
2701 | std::stringstream out; |
2702 | @@ -401,9 +422,10 @@ |
2703 | trace_count++; |
2704 | return result; |
2705 | } |
2706 | +MIRAL_TRACE_EXCEPTION |
2707 | |
2708 | auto miral::WindowManagementTrace::active_display() -> mir::geometry::Rectangle const |
2709 | -{ |
2710 | +try { |
2711 | log_input(); |
2712 | auto result = wrapped.active_display(); |
2713 | std::stringstream out; |
2714 | @@ -412,35 +434,39 @@ |
2715 | trace_count++; |
2716 | return result; |
2717 | } |
2718 | +MIRAL_TRACE_EXCEPTION |
2719 | |
2720 | auto miral::WindowManagementTrace::info_for_window_id(std::string const& id) const -> WindowInfo& |
2721 | -{ |
2722 | +try { |
2723 | log_input(); |
2724 | auto& result = wrapped.info_for_window_id(id); |
2725 | mir::log_info("%s id=%s -> %s", __func__, id.c_str(), dump_of(result).c_str()); |
2726 | trace_count++; |
2727 | return result; |
2728 | } |
2729 | +MIRAL_TRACE_EXCEPTION |
2730 | |
2731 | auto miral::WindowManagementTrace::id_for_window(Window const& window) const -> std::string |
2732 | -{ |
2733 | +try { |
2734 | log_input(); |
2735 | auto result = wrapped.id_for_window(window); |
2736 | mir::log_info("%s window=%s -> %s", __func__, dump_of(window).c_str(), result.c_str()); |
2737 | trace_count++; |
2738 | return result; |
2739 | } |
2740 | +MIRAL_TRACE_EXCEPTION |
2741 | |
2742 | void miral::WindowManagementTrace::place_and_size_for_state( |
2743 | WindowSpecification& modifications, WindowInfo const& window_info) const |
2744 | -{ |
2745 | +try { |
2746 | log_input(); |
2747 | mir::log_info("%s modifications=%s window_info=%s", __func__, dump_of(modifications).c_str(), dump_of(window_info).c_str()); |
2748 | wrapped.place_and_size_for_state(modifications, window_info); |
2749 | } |
2750 | +MIRAL_TRACE_EXCEPTION |
2751 | |
2752 | void miral::WindowManagementTrace::drag_active_window(mir::geometry::Displacement movement) |
2753 | -{ |
2754 | +try { |
2755 | log_input(); |
2756 | std::stringstream out; |
2757 | out << movement; |
2758 | @@ -448,79 +474,89 @@ |
2759 | trace_count++; |
2760 | wrapped.drag_active_window(movement); |
2761 | } |
2762 | +MIRAL_TRACE_EXCEPTION |
2763 | |
2764 | void miral::WindowManagementTrace::focus_next_application() |
2765 | -{ |
2766 | +try { |
2767 | log_input(); |
2768 | mir::log_info("%s", __func__); |
2769 | trace_count++; |
2770 | wrapped.focus_next_application(); |
2771 | } |
2772 | +MIRAL_TRACE_EXCEPTION |
2773 | |
2774 | void miral::WindowManagementTrace::focus_next_within_application() |
2775 | -{ |
2776 | +try { |
2777 | log_input(); |
2778 | mir::log_info("%s", __func__); |
2779 | trace_count++; |
2780 | wrapped.focus_next_within_application(); |
2781 | } |
2782 | +MIRAL_TRACE_EXCEPTION |
2783 | |
2784 | void miral::WindowManagementTrace::raise_tree(miral::Window const& root) |
2785 | -{ |
2786 | +try { |
2787 | log_input(); |
2788 | mir::log_info("%s root=%s", __func__, dump_of(root).c_str()); |
2789 | trace_count++; |
2790 | wrapped.raise_tree(root); |
2791 | } |
2792 | +MIRAL_TRACE_EXCEPTION |
2793 | |
2794 | void miral::WindowManagementTrace::modify_window( |
2795 | miral::WindowInfo& window_info, miral::WindowSpecification const& modifications) |
2796 | -{ |
2797 | +try { |
2798 | log_input(); |
2799 | mir::log_info("%s window_info=%s, modifications=%s", |
2800 | __func__, dump_of(window_info).c_str(), dump_of(modifications).c_str()); |
2801 | trace_count++; |
2802 | wrapped.modify_window(window_info, modifications); |
2803 | } |
2804 | +MIRAL_TRACE_EXCEPTION |
2805 | |
2806 | void miral::WindowManagementTrace::invoke_under_lock(std::function<void()> const& callback) |
2807 | -{ |
2808 | +try { |
2809 | mir::log_info("%s", __func__); |
2810 | wrapped.invoke_under_lock(callback); |
2811 | } |
2812 | +MIRAL_TRACE_EXCEPTION |
2813 | |
2814 | -auto miral::WindowManagementTrace::place_new_surface( |
2815 | +auto miral::WindowManagementTrace::place_new_window( |
2816 | ApplicationInfo const& app_info, |
2817 | WindowSpecification const& requested_specification) -> WindowSpecification |
2818 | -{ |
2819 | - auto const result = policy->place_new_surface(app_info, requested_specification); |
2820 | +try { |
2821 | + auto const result = policy->place_new_window(app_info, requested_specification); |
2822 | mir::log_info("%s app_info=%s, requested_specification=%s -> %s", |
2823 | __func__, dump_of(app_info).c_str(), dump_of(requested_specification).c_str(), dump_of(result).c_str()); |
2824 | return result; |
2825 | } |
2826 | +MIRAL_TRACE_EXCEPTION |
2827 | |
2828 | void miral::WindowManagementTrace::handle_window_ready(miral::WindowInfo& window_info) |
2829 | -{ |
2830 | +try { |
2831 | mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str()); |
2832 | policy->handle_window_ready(window_info); |
2833 | } |
2834 | +MIRAL_TRACE_EXCEPTION |
2835 | |
2836 | void miral::WindowManagementTrace::handle_modify_window( |
2837 | miral::WindowInfo& window_info, miral::WindowSpecification const& modifications) |
2838 | -{ |
2839 | +try { |
2840 | mir::log_info("%s window_info=%s, modifications=%s", |
2841 | __func__, dump_of(window_info).c_str(), dump_of(modifications).c_str()); |
2842 | policy->handle_modify_window(window_info, modifications); |
2843 | } |
2844 | +MIRAL_TRACE_EXCEPTION |
2845 | |
2846 | void miral::WindowManagementTrace::handle_raise_window(miral::WindowInfo& window_info) |
2847 | -{ |
2848 | +try { |
2849 | mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str()); |
2850 | policy->handle_raise_window(window_info); |
2851 | } |
2852 | +MIRAL_TRACE_EXCEPTION |
2853 | |
2854 | bool miral::WindowManagementTrace::handle_keyboard_event(MirKeyboardEvent const* event) |
2855 | -{ |
2856 | +try { |
2857 | log_input = [event, this] |
2858 | { |
2859 | mir::log_info("handle_keyboard_event event=%s", dump_of(event).c_str()); |
2860 | @@ -529,9 +565,10 @@ |
2861 | |
2862 | return policy->handle_keyboard_event(event); |
2863 | } |
2864 | +MIRAL_TRACE_EXCEPTION |
2865 | |
2866 | bool miral::WindowManagementTrace::handle_touch_event(MirTouchEvent const* event) |
2867 | -{ |
2868 | +try { |
2869 | log_input = [event, this] |
2870 | { |
2871 | mir::log_info("handle_touch_event event=%s", dump_of(event).c_str()); |
2872 | @@ -540,9 +577,10 @@ |
2873 | |
2874 | return policy->handle_touch_event(event); |
2875 | } |
2876 | +MIRAL_TRACE_EXCEPTION |
2877 | |
2878 | bool miral::WindowManagementTrace::handle_pointer_event(MirPointerEvent const* event) |
2879 | -{ |
2880 | +try { |
2881 | log_input = [event, this] |
2882 | { |
2883 | mir::log_info("handle_pointer_event event=%s", dump_of(event).c_str()); |
2884 | @@ -551,87 +589,101 @@ |
2885 | |
2886 | return policy->handle_pointer_event(event); |
2887 | } |
2888 | +MIRAL_TRACE_EXCEPTION |
2889 | |
2890 | auto miral::WindowManagementTrace::confirm_inherited_move(WindowInfo const& window_info, Displacement movement) |
2891 | -> Rectangle |
2892 | -{ |
2893 | +try { |
2894 | std::stringstream out; |
2895 | out << movement; |
2896 | mir::log_info("%s window_info=%s, movement=%s", __func__, dump_of(window_info).c_str(), out.str().c_str()); |
2897 | |
2898 | return policy->confirm_inherited_move(window_info, movement); |
2899 | } |
2900 | +MIRAL_TRACE_EXCEPTION |
2901 | |
2902 | void miral::WindowManagementTrace::advise_begin() |
2903 | -{ |
2904 | +try { |
2905 | log_input = []{}; |
2906 | trace_count.store(0); |
2907 | policy->advise_begin(); |
2908 | } |
2909 | +MIRAL_TRACE_EXCEPTION |
2910 | |
2911 | void miral::WindowManagementTrace::advise_end() |
2912 | -{ |
2913 | +try { |
2914 | if (trace_count.load() > 0) |
2915 | mir::log_info("===="); |
2916 | policy->advise_end(); |
2917 | } |
2918 | +MIRAL_TRACE_EXCEPTION |
2919 | |
2920 | void miral::WindowManagementTrace::advise_new_app(miral::ApplicationInfo& application) |
2921 | -{ |
2922 | +try { |
2923 | mir::log_info("%s application=%s", __func__, dump_of(application).c_str()); |
2924 | policy->advise_new_app(application); |
2925 | } |
2926 | +MIRAL_TRACE_EXCEPTION |
2927 | |
2928 | void miral::WindowManagementTrace::advise_delete_app(miral::ApplicationInfo const& application) |
2929 | -{ |
2930 | +try { |
2931 | mir::log_info("%s application=%s", __func__, dump_of(application).c_str()); |
2932 | policy->advise_delete_app(application); |
2933 | } |
2934 | +MIRAL_TRACE_EXCEPTION |
2935 | |
2936 | void miral::WindowManagementTrace::advise_new_window(miral::WindowInfo const& window_info) |
2937 | -{ |
2938 | +try { |
2939 | mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str()); |
2940 | policy->advise_new_window(window_info); |
2941 | } |
2942 | +MIRAL_TRACE_EXCEPTION |
2943 | |
2944 | void miral::WindowManagementTrace::advise_focus_lost(miral::WindowInfo const& window_info) |
2945 | -{ |
2946 | +try { |
2947 | mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str()); |
2948 | policy->advise_focus_lost(window_info); |
2949 | } |
2950 | +MIRAL_TRACE_EXCEPTION |
2951 | |
2952 | void miral::WindowManagementTrace::advise_focus_gained(miral::WindowInfo const& window_info) |
2953 | -{ |
2954 | +try { |
2955 | mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str()); |
2956 | policy->advise_focus_gained(window_info); |
2957 | } |
2958 | +MIRAL_TRACE_EXCEPTION |
2959 | |
2960 | -void miral::WindowManagementTrace::advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state) |
2961 | -{ |
2962 | +void miral::WindowManagementTrace::advise_state_change(miral::WindowInfo const& window_info, MirWindowState state) |
2963 | +try { |
2964 | mir::log_info("%s window_info=%s, state=%s", __func__, dump_of(window_info).c_str(), dump_of(state).c_str()); |
2965 | policy->advise_state_change(window_info, state); |
2966 | } |
2967 | +MIRAL_TRACE_EXCEPTION |
2968 | |
2969 | void miral::WindowManagementTrace::advise_move_to(miral::WindowInfo const& window_info, mir::geometry::Point top_left) |
2970 | -{ |
2971 | +try { |
2972 | mir::log_info("%s window_info=%s, top_left=%s", __func__, dump_of(window_info).c_str(), dump_of(top_left).c_str()); |
2973 | policy->advise_move_to(window_info, top_left); |
2974 | } |
2975 | +MIRAL_TRACE_EXCEPTION |
2976 | |
2977 | void miral::WindowManagementTrace::advise_resize(miral::WindowInfo const& window_info, mir::geometry::Size const& new_size) |
2978 | -{ |
2979 | +try { |
2980 | mir::log_info("%s window_info=%s, new_size=%s", __func__, dump_of(window_info).c_str(), dump_of(new_size).c_str()); |
2981 | policy->advise_resize(window_info, new_size); |
2982 | } |
2983 | +MIRAL_TRACE_EXCEPTION |
2984 | |
2985 | void miral::WindowManagementTrace::advise_delete_window(miral::WindowInfo const& window_info) |
2986 | -{ |
2987 | +try { |
2988 | mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str()); |
2989 | policy->advise_delete_window(window_info); |
2990 | } |
2991 | +MIRAL_TRACE_EXCEPTION |
2992 | |
2993 | void miral::WindowManagementTrace::advise_raise(std::vector<miral::Window> const& windows) |
2994 | -{ |
2995 | +try { |
2996 | mir::log_info("%s window_info=%s", __func__, dump_of(windows).c_str()); |
2997 | policy->advise_raise(windows); |
2998 | } |
2999 | +MIRAL_TRACE_EXCEPTION |
3000 | |
3001 | === modified file 'miral/window_management_trace.h' |
3002 | --- miral/window_management_trace.h 2016-12-05 09:46:35 +0000 |
3003 | +++ miral/window_management_trace.h 2017-01-26 16:46:42 +0000 |
3004 | @@ -71,7 +71,7 @@ |
3005 | |
3006 | virtual void invoke_under_lock(std::function<void()> const& callback) override; |
3007 | |
3008 | - virtual auto place_new_surface( |
3009 | + virtual auto place_new_window( |
3010 | ApplicationInfo const& app_info, |
3011 | WindowSpecification const& requested_specification) -> WindowSpecification override; |
3012 | virtual void handle_window_ready(WindowInfo& window_info) override; |
3013 | @@ -103,7 +103,7 @@ |
3014 | |
3015 | virtual void advise_focus_gained(WindowInfo const& window_info) override; |
3016 | |
3017 | - virtual void advise_state_change(WindowInfo const& window_info, MirSurfaceState state) override; |
3018 | + virtual void advise_state_change(WindowInfo const& window_info, MirWindowState state) override; |
3019 | |
3020 | virtual void advise_move_to(WindowInfo const& window_info, Point top_left) override; |
3021 | |
3022 | |
3023 | === modified file 'miral/window_specification.cpp' |
3024 | --- miral/window_specification.cpp 2016-10-25 15:07:46 +0000 |
3025 | +++ miral/window_specification.cpp 2017-01-26 16:46:42 +0000 |
3026 | @@ -37,8 +37,8 @@ |
3027 | mir::optional_value<BufferUsage> buffer_usage; |
3028 | mir::optional_value<std::string> name; |
3029 | mir::optional_value<int> output_id; |
3030 | - mir::optional_value<MirSurfaceType> type; |
3031 | - mir::optional_value<MirSurfaceState> state; |
3032 | + mir::optional_value<MirWindowType> type; |
3033 | + mir::optional_value<MirWindowState> state; |
3034 | mir::optional_value<MirOrientationMode> preferred_orientation; |
3035 | mir::optional_value<BufferStreamId> content_id; |
3036 | mir::optional_value<Rectangle> aux_rect; |
3037 | @@ -403,12 +403,12 @@ |
3038 | return self->output_id; |
3039 | } |
3040 | |
3041 | -auto miral::WindowSpecification::type() const -> mir::optional_value<MirSurfaceType> const& |
3042 | +auto miral::WindowSpecification::type() const -> mir::optional_value<MirWindowType> const& |
3043 | { |
3044 | return self->type; |
3045 | } |
3046 | |
3047 | -auto miral::WindowSpecification::state() const -> mir::optional_value<MirSurfaceState> const& |
3048 | +auto miral::WindowSpecification::state() const -> mir::optional_value<MirWindowState> const& |
3049 | { |
3050 | return self->state; |
3051 | } |
3052 | @@ -533,12 +533,12 @@ |
3053 | return self->output_id; |
3054 | } |
3055 | |
3056 | -auto miral::WindowSpecification::type() -> mir::optional_value<MirSurfaceType>& |
3057 | +auto miral::WindowSpecification::type() -> mir::optional_value<MirWindowType>& |
3058 | { |
3059 | return self->type; |
3060 | } |
3061 | |
3062 | -auto miral::WindowSpecification::state() -> mir::optional_value<MirSurfaceState>& |
3063 | +auto miral::WindowSpecification::state() -> mir::optional_value<MirWindowState>& |
3064 | { |
3065 | return self->state; |
3066 | } |
3067 | |
3068 | === modified file 'scripts/process_doxygen_xml.py' |
3069 | --- scripts/process_doxygen_xml.py 2016-12-13 13:07:15 +0000 |
3070 | +++ scripts/process_doxygen_xml.py 2017-01-26 16:46:42 +0000 |
3071 | @@ -83,17 +83,360 @@ |
3072 | |
3073 | OLD_STANZAS = '''MIRAL_1.0 { |
3074 | global: |
3075 | + extern "C++" { |
3076 | + miral::ActiveOutputsListener::?ActiveOutputsListener*; |
3077 | + miral::ActiveOutputsListener::ActiveOutputsListener*; |
3078 | + miral::ActiveOutputsListener::advise_output_begin*; |
3079 | + miral::ActiveOutputsListener::advise_output_create*; |
3080 | + miral::ActiveOutputsListener::advise_output_delete*; |
3081 | + miral::ActiveOutputsListener::advise_output_end*; |
3082 | + miral::ActiveOutputsListener::advise_output_update*; |
3083 | + miral::ActiveOutputsListener::operator*; |
3084 | + miral::ActiveOutputsMonitor::?ActiveOutputsMonitor*; |
3085 | + miral::ActiveOutputsMonitor::ActiveOutputsMonitor*; |
3086 | + miral::ActiveOutputsMonitor::add_listener*; |
3087 | + miral::ActiveOutputsMonitor::delete_listener*; |
3088 | + miral::ActiveOutputsMonitor::operator*; |
3089 | + miral::ActiveOutputsMonitor::process_outputs*; |
3090 | + miral::AddInitCallback::?AddInitCallback*; |
3091 | + miral::AddInitCallback::AddInitCallback*; |
3092 | + miral::AddInitCallback::operator*; |
3093 | + miral::AppendEventFilter::AppendEventFilter*; |
3094 | + miral::AppendEventFilter::operator*; |
3095 | + miral::ApplicationAuthorizer::?ApplicationAuthorizer*; |
3096 | + miral::ApplicationAuthorizer::ApplicationAuthorizer*; |
3097 | + miral::ApplicationAuthorizer::operator*; |
3098 | + miral::ApplicationCredentials::ApplicationCredentials*; |
3099 | + miral::ApplicationCredentials::gid*; |
3100 | + miral::ApplicationCredentials::pid*; |
3101 | + miral::ApplicationCredentials::uid*; |
3102 | + miral::ApplicationInfo::?ApplicationInfo*; |
3103 | + miral::ApplicationInfo::ApplicationInfo*; |
3104 | + miral::ApplicationInfo::add_window*; |
3105 | + miral::ApplicationInfo::application*; |
3106 | + miral::ApplicationInfo::name*; |
3107 | + miral::ApplicationInfo::operator*; |
3108 | + miral::ApplicationInfo::remove_window*; |
3109 | + miral::ApplicationInfo::userdata*; |
3110 | + miral::ApplicationInfo::windows*; |
3111 | + miral::BasicSetApplicationAuthorizer::?BasicSetApplicationAuthorizer*; |
3112 | + miral::BasicSetApplicationAuthorizer::BasicSetApplicationAuthorizer*; |
3113 | + miral::BasicSetApplicationAuthorizer::operator*; |
3114 | + miral::BasicSetApplicationAuthorizer::the_application_authorizer*; |
3115 | + miral::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy*; |
3116 | + miral::CanonicalWindowManagerPolicy::advise_focus_gained*; |
3117 | + miral::CanonicalWindowManagerPolicy::confirm_inherited_move*; |
3118 | + miral::CanonicalWindowManagerPolicy::handle_modify_window*; |
3119 | + miral::CanonicalWindowManagerPolicy::handle_raise_window*; |
3120 | + miral::CanonicalWindowManagerPolicy::handle_window_ready*; |
3121 | + miral::CanonicalWindowManagerPolicy::place_new_surface*; |
3122 | + miral::CommandLineOption::?CommandLineOption*; |
3123 | + miral::CommandLineOption::CommandLineOption*; |
3124 | + miral::CommandLineOption::operator*; |
3125 | + miral::CursorTheme::?CursorTheme*; |
3126 | + miral::CursorTheme::CursorTheme*; |
3127 | + miral::CursorTheme::operator*; |
3128 | + miral::DebugExtension::DebugExtension*; |
3129 | + miral::DebugExtension::disable*; |
3130 | + miral::DebugExtension::enable*; |
3131 | + miral::DebugExtension::operator*; |
3132 | + miral::InternalClientLauncher::?InternalClientLauncher*; |
3133 | + miral::InternalClientLauncher::InternalClientLauncher*; |
3134 | + miral::InternalClientLauncher::launch*; |
3135 | + miral::InternalClientLauncher::operator*; |
3136 | + miral::Keymap::?Keymap*; |
3137 | + miral::Keymap::Keymap*; |
3138 | + miral::Keymap::operator*; |
3139 | + miral::Keymap::set_keymap*; |
3140 | + miral::MirRunner::?MirRunner*; |
3141 | + miral::MirRunner::MirRunner*; |
3142 | + miral::MirRunner::add_start_callback*; |
3143 | + miral::MirRunner::add_stop_callback*; |
3144 | + miral::MirRunner::run_with*; |
3145 | + miral::MirRunner::set_exception_handler*; |
3146 | + miral::MirRunner::stop*; |
3147 | + miral::Output::?Output*; |
3148 | + miral::Output::Output*; |
3149 | + miral::Output::connected*; |
3150 | + miral::Output::extents*; |
3151 | + miral::Output::form_factor*; |
3152 | + miral::Output::is_same_output*; |
3153 | + miral::Output::operator*; |
3154 | + miral::Output::orientation*; |
3155 | + miral::Output::physical_size_mm*; |
3156 | + miral::Output::pixel_format*; |
3157 | + miral::Output::power_mode*; |
3158 | + miral::Output::refresh_rate*; |
3159 | + miral::Output::scale*; |
3160 | + miral::Output::type*; |
3161 | + miral::Output::used*; |
3162 | + miral::Output::valid*; |
3163 | + miral::SetCommandLineHandler::?SetCommandLineHandler*; |
3164 | + miral::SetCommandLineHandler::SetCommandLineHandler*; |
3165 | + miral::SetCommandLineHandler::operator*; |
3166 | + miral::SetTerminator::?SetTerminator*; |
3167 | + miral::SetTerminator::SetTerminator*; |
3168 | + miral::SetTerminator::operator*; |
3169 | + miral::SetWindowManagmentPolicy::?SetWindowManagmentPolicy*; |
3170 | + miral::SetWindowManagmentPolicy::SetWindowManagmentPolicy*; |
3171 | + miral::SetWindowManagmentPolicy::operator*; |
3172 | + miral::StartupInternalClient::?StartupInternalClient*; |
3173 | + miral::StartupInternalClient::StartupInternalClient*; |
3174 | + miral::StartupInternalClient::operator*; |
3175 | + miral::Window::?Window*; |
3176 | + miral::Window::Window*; |
3177 | + miral::Window::application*; |
3178 | + miral::Window::move_to*; |
3179 | + miral::Window::operator*; |
3180 | + miral::Window::resize*; |
3181 | + miral::Window::size*; |
3182 | + miral::Window::top_left*; |
3183 | + miral::WindowInfo::?WindowInfo*; |
3184 | + miral::WindowInfo::WindowInfo*; |
3185 | + miral::WindowInfo::add_child*; |
3186 | + miral::WindowInfo::can_be_active*; |
3187 | + miral::WindowInfo::children*; |
3188 | + miral::WindowInfo::confine_pointer*; |
3189 | + miral::WindowInfo::constrain_resize*; |
3190 | + miral::WindowInfo::has_output_id*; |
3191 | + miral::WindowInfo::height_inc*; |
3192 | + miral::WindowInfo::is_visible*; |
3193 | + miral::WindowInfo::max_aspect*; |
3194 | + miral::WindowInfo::max_height*; |
3195 | + miral::WindowInfo::max_width*; |
3196 | + miral::WindowInfo::min_aspect*; |
3197 | + miral::WindowInfo::min_height*; |
3198 | + miral::WindowInfo::min_width*; |
3199 | + miral::WindowInfo::must_have_parent*; |
3200 | + miral::WindowInfo::must_not_have_parent*; |
3201 | + miral::WindowInfo::name*; |
3202 | + miral::WindowInfo::operator*; |
3203 | + miral::WindowInfo::output_id*; |
3204 | + miral::WindowInfo::parent*; |
3205 | + miral::WindowInfo::preferred_orientation*; |
3206 | + miral::WindowInfo::remove_child*; |
3207 | + miral::WindowInfo::restore_rect*; |
3208 | + miral::WindowInfo::userdata*; |
3209 | + miral::WindowInfo::width_inc*; |
3210 | + miral::WindowInfo::window*; |
3211 | + miral::WindowManagementPolicy::?WindowManagementPolicy*; |
3212 | + miral::WindowManagementPolicy::WindowManagementPolicy*; |
3213 | + miral::WindowManagementPolicy::advise_begin*; |
3214 | + miral::WindowManagementPolicy::advise_delete_app*; |
3215 | + miral::WindowManagementPolicy::advise_delete_window*; |
3216 | + miral::WindowManagementPolicy::advise_end*; |
3217 | + miral::WindowManagementPolicy::advise_focus_gained*; |
3218 | + miral::WindowManagementPolicy::advise_focus_lost*; |
3219 | + miral::WindowManagementPolicy::advise_move_to*; |
3220 | + miral::WindowManagementPolicy::advise_new_app*; |
3221 | + miral::WindowManagementPolicy::advise_new_window*; |
3222 | + miral::WindowManagementPolicy::advise_raise*; |
3223 | + miral::WindowManagementPolicy::advise_resize*; |
3224 | + miral::WindowManagementPolicy::operator*; |
3225 | + miral::WindowManagerOptions::WindowManagerOptions*; |
3226 | + miral::WindowManagerOptions::operator*; |
3227 | + miral::WindowManagerTools::?WindowManagerTools*; |
3228 | + miral::WindowManagerTools::WindowManagerTools*; |
3229 | + miral::WindowManagerTools::active_display*; |
3230 | + miral::WindowManagerTools::active_window*; |
3231 | + miral::WindowManagerTools::ask_client_to_close*; |
3232 | + miral::WindowManagerTools::count_applications*; |
3233 | + miral::WindowManagerTools::drag_active_window*; |
3234 | + miral::WindowManagerTools::find_application*; |
3235 | + miral::WindowManagerTools::focus_next_application*; |
3236 | + miral::WindowManagerTools::focus_next_within_application*; |
3237 | + miral::WindowManagerTools::for_each_application*; |
3238 | + miral::WindowManagerTools::force_close*; |
3239 | + miral::WindowManagerTools::id_for_window*; |
3240 | + miral::WindowManagerTools::info_for*; |
3241 | + miral::WindowManagerTools::info_for_window_id*; |
3242 | + miral::WindowManagerTools::invoke_under_lock*; |
3243 | + miral::WindowManagerTools::modify_window*; |
3244 | + miral::WindowManagerTools::operator*; |
3245 | + miral::WindowManagerTools::place_and_size_for_state*; |
3246 | + miral::WindowManagerTools::raise_tree*; |
3247 | + miral::WindowManagerTools::select_active_window*; |
3248 | + miral::WindowManagerTools::window_at*; |
3249 | + miral::WindowSpecification::?WindowSpecification*; |
3250 | + miral::WindowSpecification::WindowSpecification*; |
3251 | + miral::WindowSpecification::aux_rect*; |
3252 | + miral::WindowSpecification::aux_rect_placement_gravity*; |
3253 | + miral::WindowSpecification::aux_rect_placement_offset*; |
3254 | + miral::WindowSpecification::confine_pointer*; |
3255 | + miral::WindowSpecification::height_inc*; |
3256 | + miral::WindowSpecification::input_mode*; |
3257 | + miral::WindowSpecification::input_shape*; |
3258 | + miral::WindowSpecification::max_aspect*; |
3259 | + miral::WindowSpecification::max_height*; |
3260 | + miral::WindowSpecification::max_width*; |
3261 | + miral::WindowSpecification::min_aspect*; |
3262 | + miral::WindowSpecification::min_height*; |
3263 | + miral::WindowSpecification::min_width*; |
3264 | + miral::WindowSpecification::name*; |
3265 | + miral::WindowSpecification::operator*; |
3266 | + miral::WindowSpecification::output_id*; |
3267 | + miral::WindowSpecification::parent*; |
3268 | + miral::WindowSpecification::placement_hints*; |
3269 | + miral::WindowSpecification::preferred_orientation*; |
3270 | + miral::WindowSpecification::shell_chrome*; |
3271 | + miral::WindowSpecification::size*; |
3272 | + miral::WindowSpecification::state*; |
3273 | + miral::WindowSpecification::top_left*; |
3274 | + miral::WindowSpecification::type*; |
3275 | + miral::WindowSpecification::update*; |
3276 | + miral::WindowSpecification::userdata*; |
3277 | + miral::WindowSpecification::width_inc*; |
3278 | + miral::WindowSpecification::window_placement_gravity*; |
3279 | + miral::apply_lifecycle_state_to*; |
3280 | + miral::display_configuration_options*; |
3281 | + miral::equivalent_display_area*; |
3282 | + miral::kill*; |
3283 | + miral::name_of*; |
3284 | + miral::operator*; |
3285 | + miral::pid_of*; |
3286 | + miral::toolkit::Connection::Connection*; |
3287 | + miral::toolkit::Surface::Surface*; |
3288 | + non-virtual?thunk?to?miral::ActiveOutputsListener::?ActiveOutputsListener*; |
3289 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_begin*; |
3290 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_create*; |
3291 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_delete*; |
3292 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_end*; |
3293 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_update*; |
3294 | + non-virtual?thunk?to?miral::ApplicationAuthorizer::?ApplicationAuthorizer*; |
3295 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::advise_focus_gained*; |
3296 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::confirm_inherited_move*; |
3297 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_modify_window*; |
3298 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_raise_window*; |
3299 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_window_ready*; |
3300 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::place_new_surface*; |
3301 | + non-virtual?thunk?to?miral::WindowManagementPolicy::?WindowManagementPolicy*; |
3302 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_begin*; |
3303 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_delete_app*; |
3304 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_delete_window*; |
3305 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_end*; |
3306 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_focus_gained*; |
3307 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_focus_lost*; |
3308 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_move_to*; |
3309 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_new_app*; |
3310 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_new_window*; |
3311 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_raise*; |
3312 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_resize*; |
3313 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_state_change*; |
3314 | + typeinfo?for?miral::ActiveOutputsListener; |
3315 | + typeinfo?for?miral::ActiveOutputsMonitor; |
3316 | + typeinfo?for?miral::AddInitCallback; |
3317 | + typeinfo?for?miral::AppendEventFilter; |
3318 | + typeinfo?for?miral::ApplicationAuthorizer; |
3319 | + typeinfo?for?miral::ApplicationCredentials; |
3320 | + typeinfo?for?miral::ApplicationInfo; |
3321 | + typeinfo?for?miral::BasicSetApplicationAuthorizer; |
3322 | + typeinfo?for?miral::CanonicalWindowManagerPolicy; |
3323 | + typeinfo?for?miral::CommandLineOption; |
3324 | + typeinfo?for?miral::CursorTheme; |
3325 | + typeinfo?for?miral::DebugExtension; |
3326 | + typeinfo?for?miral::InternalClientLauncher; |
3327 | + typeinfo?for?miral::Keymap; |
3328 | + typeinfo?for?miral::MirRunner; |
3329 | + typeinfo?for?miral::Output; |
3330 | + typeinfo?for?miral::Output::PhysicalSizeMM; |
3331 | + typeinfo?for?miral::SetCommandLineHandler; |
3332 | + typeinfo?for?miral::SetTerminator; |
3333 | + typeinfo?for?miral::SetWindowManagmentPolicy; |
3334 | + typeinfo?for?miral::StartupInternalClient; |
3335 | + typeinfo?for?miral::Window; |
3336 | + typeinfo?for?miral::WindowInfo; |
3337 | + typeinfo?for?miral::WindowManagementPolicy; |
3338 | + typeinfo?for?miral::WindowManagerOption; |
3339 | + typeinfo?for?miral::WindowManagerOptions; |
3340 | + typeinfo?for?miral::WindowManagerTools; |
3341 | + typeinfo?for?miral::WindowSpecification; |
3342 | + typeinfo?for?miral::WindowSpecification::AspectRatio; |
3343 | + typeinfo?for?miral::toolkit::Connection; |
3344 | + typeinfo?for?miral::toolkit::PersistentId; |
3345 | + typeinfo?for?miral::toolkit::Surface; |
3346 | + typeinfo?for?miral::toolkit::SurfaceSpec; |
3347 | + vtable?for?miral::ActiveOutputsListener; |
3348 | + vtable?for?miral::ActiveOutputsMonitor; |
3349 | + vtable?for?miral::AddInitCallback; |
3350 | + vtable?for?miral::AppendEventFilter; |
3351 | + vtable?for?miral::ApplicationAuthorizer; |
3352 | + vtable?for?miral::ApplicationCredentials; |
3353 | + vtable?for?miral::ApplicationInfo; |
3354 | + vtable?for?miral::BasicSetApplicationAuthorizer; |
3355 | + vtable?for?miral::CanonicalWindowManagerPolicy; |
3356 | + vtable?for?miral::CommandLineOption; |
3357 | + vtable?for?miral::CursorTheme; |
3358 | + vtable?for?miral::DebugExtension; |
3359 | + vtable?for?miral::InternalClientLauncher; |
3360 | + vtable?for?miral::Keymap; |
3361 | + vtable?for?miral::MirRunner; |
3362 | + vtable?for?miral::Output; |
3363 | + vtable?for?miral::Output::PhysicalSizeMM; |
3364 | + vtable?for?miral::SetCommandLineHandler; |
3365 | + vtable?for?miral::SetTerminator; |
3366 | + vtable?for?miral::SetWindowManagmentPolicy; |
3367 | + vtable?for?miral::StartupInternalClient; |
3368 | + vtable?for?miral::Window; |
3369 | + vtable?for?miral::WindowInfo; |
3370 | + vtable?for?miral::WindowManagementPolicy; |
3371 | + vtable?for?miral::WindowManagerOption; |
3372 | + vtable?for?miral::WindowManagerOptions; |
3373 | + vtable?for?miral::WindowManagerTools; |
3374 | + vtable?for?miral::WindowSpecification; |
3375 | + vtable?for?miral::WindowSpecification::AspectRatio; |
3376 | + vtable?for?miral::toolkit::Connection; |
3377 | + vtable?for?miral::toolkit::PersistentId; |
3378 | + vtable?for?miral::toolkit::Surface; |
3379 | + vtable?for?miral::toolkit::SurfaceSpec; |
3380 | + }; |
3381 | +# miral::WindowInfo::can_morph_to*; |
3382 | + _ZNK5miral10WindowInfo12can_morph_toE14MirSurfaceType; |
3383 | + |
3384 | +# miral::WindowInfo::needs_titlebar*; |
3385 | + _ZN5miral10WindowInfo14needs_titlebarE14MirSurfaceType; |
3386 | + |
3387 | +# miral::WindowInfo::state*; |
3388 | + _ZNK5miral10WindowInfo5stateEv; |
3389 | + _ZN5miral10WindowInfo5stateE15MirSurfaceState; |
3390 | + |
3391 | +# miral::WindowInfo::type*; |
3392 | + _ZN5miral10WindowInfo4typeE14MirSurfaceType; |
3393 | + _ZNK5miral10WindowInfo4typeEv; |
3394 | + |
3395 | +# miral::WindowManagementPolicy::advise_state_change*; |
3396 | + _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE15MirSurfaceState; |
3397 | +local: *; |
3398 | +}; |
3399 | + |
3400 | +MIRAL_1.1 { |
3401 | +global: |
3402 | + # miral::WindowInfo::can_morph_to* |
3403 | + _ZNK5miral10WindowInfo12can_morph_toE13MirWindowType; |
3404 | + |
3405 | + #miral::WindowInfo::needs_titlebar*; |
3406 | + _ZN5miral10WindowInfo14needs_titlebarE13MirWindowType; |
3407 | + |
3408 | + # miral::WindowInfo::state*; |
3409 | + _ZNK5miral10WindowInfo5stateEv; |
3410 | + _ZN5miral10WindowInfo5stateE14MirWindowState; |
3411 | + |
3412 | + miral::WindowInfo::type*; |
3413 | + _ZN5miral10WindowInfo4typeE13MirWindowType; |
3414 | + _ZNK5miral10WindowInfo4typeEv; |
3415 | + |
3416 | + # miral::WindowManagementPolicy::advise_state_change*; |
3417 | + _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE14MirWindowState; |
3418 | + |
3419 | extern "C++" {''' |
3420 | |
3421 | END_NEW_STANZA = ''' }; |
3422 | -local: *; |
3423 | -};''' |
3424 | +} MIRAL_1.0;''' |
3425 | |
3426 | def _print_report(): |
3427 | print OLD_STANZAS |
3428 | for symbol in sorted(SYMBOLS['public']): |
3429 | formatted_symbol = ' {};'.format(symbol) |
3430 | - if formatted_symbol not in OLD_STANZAS: |
3431 | + if formatted_symbol not in OLD_STANZAS and 'miral::toolkit::' not in formatted_symbol: |
3432 | print formatted_symbol |
3433 | print END_NEW_STANZA |
3434 | |
3435 | |
3436 | === modified file 'test/CMakeLists.txt' |
3437 | --- test/CMakeLists.txt 2016-11-29 10:33:42 +0000 |
3438 | +++ test/CMakeLists.txt 2017-01-26 16:46:42 +0000 |
3439 | @@ -1,11 +1,11 @@ |
3440 | -if (MIRTEST_VERSION VERSION_LESS 0.25) |
3441 | +if (MIRTEST_VERSION VERSION_LESS 0.26) |
3442 | # Mir used mix struct and class in public test headers (fixed -r 3606 in lp:mir) |
3443 | check_cxx_compiler_flag(-Wno-mismatched-tags MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS) |
3444 | if (MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS) |
3445 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-mismatched-tags") |
3446 | endif() |
3447 | |
3448 | - if (NOT MIRTEST_VERSION VERSION_LESS 0.24) |
3449 | + if (MIRTEST_VERSION VERSION_EQUAL 0.24) |
3450 | # Mir 0.24 shipped with inconsistent override use in mirtest/mir/test/doubles/stub_session.h (lp:1609612) |
3451 | check_cxx_compiler_flag(-Wno-inconsistent-missing-override MIRAL_COMPILE_WITH_W_NO_INCONSISTENT_MISSING_OVERRIDE) |
3452 | if (MIRAL_COMPILE_WITH_W_NO_INCONSISTENT_MISSING_OVERRIDE) |
3453 | @@ -13,11 +13,13 @@ |
3454 | endif() |
3455 | endif() |
3456 | |
3457 | - # Mir uses "C" linkage to avoid name-mangling some functions that are not |
3458 | - # intended not for C compatibility (lp:1615587) (fixed -r 3668 in lp:mir) |
3459 | - check_cxx_compiler_flag(-Wno-return-type-c-linkage MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE) |
3460 | - if (MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE) |
3461 | - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage") |
3462 | + if (MIRTEST_VERSION VERSION_LESS 0.25) |
3463 | + # Mir uses "C" linkage to avoid name-mangling some functions that are not |
3464 | + # intended not for C compatibility (lp:1615587) (fixed -r 3668 in lp:mir) |
3465 | + check_cxx_compiler_flag(-Wno-return-type-c-linkage MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE) |
3466 | + if (MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE) |
3467 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage") |
3468 | + endif() |
3469 | endif() |
3470 | endif() |
3471 | |
3472 | @@ -52,6 +54,7 @@ |
3473 | test_window_manager_tools.h |
3474 | display_reconfiguration.cpp |
3475 | active_window.cpp |
3476 | + raise_tree.cpp |
3477 | ) |
3478 | |
3479 | target_link_libraries(miral-test |
3480 | |
3481 | === modified file 'test/active_window.cpp' |
3482 | --- test/active_window.cpp 2016-11-30 17:01:17 +0000 |
3483 | +++ test/active_window.cpp 2017-01-26 16:46:42 +0000 |
3484 | @@ -18,8 +18,8 @@ |
3485 | |
3486 | #include "test_server.h" |
3487 | |
3488 | -#include <miral/toolkit/surface.h> |
3489 | -#include <miral/toolkit/surface_spec.h> |
3490 | +#include <miral/toolkit/window.h> |
3491 | +#include <miral/toolkit/window_spec.h> |
3492 | #include <mir_toolkit/mir_buffer_stream.h> |
3493 | #include <mir_toolkit/version.h> |
3494 | |
3495 | @@ -30,9 +30,9 @@ |
3496 | #include <gtest/gtest.h> |
3497 | |
3498 | using namespace testing; |
3499 | -using namespace miral; |
3500 | using namespace miral::toolkit; |
3501 | using namespace std::chrono_literals; |
3502 | +using miral::WindowManagerTools; |
3503 | |
3504 | namespace |
3505 | { |
3506 | @@ -46,10 +46,15 @@ |
3507 | signal.wait_for(100ms); |
3508 | } |
3509 | |
3510 | - static void raise_signal_on_focus_change(MirSurface* /*surface*/, MirEvent const* event, void* context) |
3511 | + static void raise_signal_on_focus_change(MirWindow* /*surface*/, MirEvent const* event, void* context) |
3512 | { |
3513 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
3514 | if (mir_event_get_type(event) == mir_event_type_surface && |
3515 | mir_surface_event_get_attribute(mir_event_get_surface_event(event)) == mir_surface_attrib_focus) |
3516 | +#else |
3517 | + if (mir_event_get_type(event) == mir_event_type_window && |
3518 | + mir_window_event_get_attribute(mir_event_get_window_event(event)) == mir_window_attrib_focus) |
3519 | +#endif |
3520 | { |
3521 | ((FocusChangeSync*)context)->signal.raise(); |
3522 | } |
3523 | @@ -61,55 +66,67 @@ |
3524 | mir::test::Signal signal; |
3525 | }; |
3526 | |
3527 | -struct ActiveWindow : public TestServer |
3528 | +struct ActiveWindow : public miral::TestServer |
3529 | { |
3530 | FocusChangeSync sync1; |
3531 | FocusChangeSync sync2; |
3532 | |
3533 | - auto create_surface(Connection const& connection, char const* name, FocusChangeSync& sync) -> Surface |
3534 | + auto create_surface(Connection const& connection, char const* name, FocusChangeSync& sync) -> Window |
3535 | { |
3536 | - auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3537 | + auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3538 | .set_buffer_usage(mir_buffer_usage_software) |
3539 | .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync) |
3540 | .set_name(name); |
3541 | |
3542 | - Surface const surface{spec.create_surface()}; |
3543 | + Window const surface{spec.create_surface()}; |
3544 | |
3545 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
3546 | sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); }); |
3547 | +#else |
3548 | + sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(surface)); }); |
3549 | +#endif |
3550 | EXPECT_TRUE(sync.signal_raised()); |
3551 | |
3552 | return surface; |
3553 | } |
3554 | |
3555 | #if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0) |
3556 | - auto create_tip(Connection const& connection, char const* name, Surface const& parent, FocusChangeSync& sync) -> Surface |
3557 | + auto create_tip(Connection const& connection, char const* name, Window const& parent, FocusChangeSync& sync) -> Window |
3558 | { |
3559 | MirRectangle aux_rect{10, 10, 10, 10}; |
3560 | - auto const spec = SurfaceSpec::for_tip(connection, 50, 50, mir_pixel_format_argb_8888, parent, &aux_rect, mir_edge_attachment_any) |
3561 | + auto const spec = WindowSpec::for_tip(connection, 50, 50, mir_pixel_format_argb_8888, parent, &aux_rect, mir_edge_attachment_any) |
3562 | .set_buffer_usage(mir_buffer_usage_software) |
3563 | .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync) |
3564 | .set_name(name); |
3565 | |
3566 | - Surface const surface{spec.create_surface()}; |
3567 | + Window const surface{spec.create_surface()}; |
3568 | |
3569 | // Expect this to timeout: A tip should not receive focus |
3570 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
3571 | sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); }); |
3572 | +#else |
3573 | + sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(surface)); }); |
3574 | +#endif |
3575 | EXPECT_FALSE(sync.signal_raised()); |
3576 | |
3577 | return surface; |
3578 | } |
3579 | #endif |
3580 | |
3581 | - auto create_dialog(Connection const& connection, char const* name, Surface const& parent, FocusChangeSync& sync) -> Surface |
3582 | + auto create_dialog(Connection const& connection, char const* name, Window const& parent, FocusChangeSync& sync) -> Window |
3583 | { |
3584 | - auto const spec = SurfaceSpec::for_dialog(connection, 50, 50, mir_pixel_format_argb_8888, parent) |
3585 | + auto const spec = WindowSpec::for_dialog(connection, 50, 50, mir_pixel_format_argb_8888, parent) |
3586 | .set_buffer_usage(mir_buffer_usage_software) |
3587 | .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync) |
3588 | .set_name(name); |
3589 | |
3590 | - Surface const surface{spec.create_surface()}; |
3591 | + Window const surface{spec.create_surface()}; |
3592 | |
3593 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
3594 | sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); }); |
3595 | +#else |
3596 | + sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(surface)); }); |
3597 | +#endif |
3598 | EXPECT_TRUE(sync.signal_raised()); |
3599 | |
3600 | return surface; |
3601 | @@ -155,7 +172,11 @@ |
3602 | auto const connection = connect_client(test_name); |
3603 | auto const surface = create_surface(connection, test_name, sync1); |
3604 | |
3605 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
3606 | sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); }); |
3607 | +#else |
3608 | + sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); }); |
3609 | +#endif |
3610 | |
3611 | EXPECT_TRUE(sync1.signal_raised()); |
3612 | assert_no_active_window(); |
3613 | @@ -166,9 +187,15 @@ |
3614 | char const* const test_name = __PRETTY_FUNCTION__; |
3615 | auto const connection = connect_client(test_name); |
3616 | auto const surface = create_surface(connection, test_name, sync1); |
3617 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
3618 | sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); }); |
3619 | |
3620 | sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_restored); }); |
3621 | +#else |
3622 | + sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); }); |
3623 | + |
3624 | + sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_restored); }); |
3625 | +#endif |
3626 | EXPECT_TRUE(sync1.signal_raised()); |
3627 | |
3628 | assert_active_window_is(test_name); |
3629 | @@ -193,7 +220,11 @@ |
3630 | auto const first_surface = create_surface(connection, test_name, sync1); |
3631 | auto const surface = create_surface(connection, another_name, sync2); |
3632 | |
3633 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
3634 | sync2.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); }); |
3635 | +#else |
3636 | + sync2.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); }); |
3637 | +#endif |
3638 | |
3639 | EXPECT_TRUE(sync2.signal_raised()); |
3640 | assert_active_window_is(test_name); |
3641 | @@ -207,11 +238,17 @@ |
3642 | auto const first_surface = create_surface(connection, test_name, sync1); |
3643 | auto const surface = create_surface(connection, another_name, sync2); |
3644 | |
3645 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
3646 | sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); }); |
3647 | |
3648 | // Expect this to timeout |
3649 | sync2.exec([&]{ mir_surface_set_state(surface, mir_surface_state_restored); }); |
3650 | +#else |
3651 | + sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); }); |
3652 | |
3653 | + // Expect this to timeout |
3654 | + sync2.exec([&]{ mir_window_set_state(surface, mir_window_state_restored); }); |
3655 | +#endif |
3656 | EXPECT_THAT(sync2.signal_raised(), Eq(false)); |
3657 | assert_active_window_is(test_name); |
3658 | } |
3659 | @@ -271,7 +308,7 @@ |
3660 | |
3661 | auto const parent = create_surface(connection, test_name, sync1); |
3662 | |
3663 | - Window parent_window; |
3664 | + miral::Window parent_window; |
3665 | invoke_tools([&](WindowManagerTools& tools){ parent_window = tools.active_window(); }); |
3666 | |
3667 | // Steal the focus |
3668 | @@ -299,7 +336,7 @@ |
3669 | |
3670 | auto const parent = create_surface(connection, test_name, sync1); |
3671 | |
3672 | - Window parent_window; |
3673 | + miral::Window parent_window; |
3674 | invoke_tools([&](WindowManagerTools& tools){ parent_window = tools.active_window(); }); |
3675 | |
3676 | auto const dialog = create_dialog(connection, dialog_name, parent, sync2); |
3677 | |
3678 | === modified file 'test/display_reconfiguration.cpp' |
3679 | --- test/display_reconfiguration.cpp 2016-11-10 17:25:38 +0000 |
3680 | +++ test/display_reconfiguration.cpp 2017-01-26 16:46:42 +0000 |
3681 | @@ -51,9 +51,9 @@ |
3682 | void create_fullscreen_window() |
3683 | { |
3684 | mir::scene::SurfaceCreationParameters creation_parameters; |
3685 | - creation_parameters.type = mir_surface_type_normal; |
3686 | + creation_parameters.type = mir_window_type_normal; |
3687 | creation_parameters.size = initial_window_size; |
3688 | - creation_parameters.state = mir_surface_state_fullscreen; |
3689 | + creation_parameters.state = mir_window_state_fullscreen; |
3690 | creation_parameters.output_id = mir::graphics::DisplayConfigurationOutputId{0}; |
3691 | |
3692 | EXPECT_CALL(*window_manager_policy, advise_new_window(_)) |
3693 | @@ -77,9 +77,9 @@ |
3694 | create_fullscreen_window(); |
3695 | |
3696 | WindowSpecification mods; |
3697 | - mods.state() = mir_surface_state_hidden; |
3698 | + mods.state() = mir_window_state_hidden; |
3699 | window_manager_tools.modify_window(window, mods); |
3700 | - mods.state() = mir_surface_state_fullscreen; |
3701 | + mods.state() = mir_window_state_fullscreen; |
3702 | window_manager_tools.modify_window(window, mods); |
3703 | |
3704 | Rectangle const new_display{display_area.top_left+as_displacement({display_width, Height{0}}), display_area.size}; |
3705 | |
3706 | === modified file 'test/drag_active_window.cpp' |
3707 | --- test/drag_active_window.cpp 2016-11-07 12:09:04 +0000 |
3708 | +++ test/drag_active_window.cpp 2017-01-26 16:46:42 +0000 |
3709 | @@ -36,7 +36,7 @@ |
3710 | |
3711 | auto const null_window = Window{}; |
3712 | |
3713 | -struct DragActiveWindow : TestWindowManagerTools, WithParamInterface<MirSurfaceType> |
3714 | +struct DragActiveWindow : TestWindowManagerTools, WithParamInterface<MirWindowType> |
3715 | { |
3716 | Size const initial_parent_size{600, 400}; |
3717 | |
3718 | @@ -48,7 +48,7 @@ |
3719 | basic_window_manager.add_session(session); |
3720 | } |
3721 | |
3722 | - void create_window_of_type(MirSurfaceType type) |
3723 | + void create_window_of_type(MirWindowType type) |
3724 | { |
3725 | mir::scene::SurfaceCreationParameters creation_parameters; |
3726 | creation_parameters.type = type; |
3727 | |
3728 | === modified file 'test/modify_window_state.cpp' |
3729 | --- test/modify_window_state.cpp 2016-11-07 12:09:11 +0000 |
3730 | +++ test/modify_window_state.cpp 2017-01-26 16:46:42 +0000 |
3731 | @@ -36,7 +36,7 @@ |
3732 | |
3733 | auto const null_window = Window{}; |
3734 | |
3735 | -struct ModifyWindowState : TestWindowManagerTools, WithParamInterface<MirSurfaceType> |
3736 | +struct ModifyWindowState : TestWindowManagerTools, WithParamInterface<MirWindowType> |
3737 | { |
3738 | Size const initial_parent_size{600, 400}; |
3739 | |
3740 | @@ -48,7 +48,7 @@ |
3741 | basic_window_manager.add_session(session); |
3742 | } |
3743 | |
3744 | - void create_window_of_type(MirSurfaceType type) |
3745 | + void create_window_of_type(MirWindowType type) |
3746 | { |
3747 | mir::scene::SurfaceCreationParameters creation_parameters; |
3748 | creation_parameters.type = type; |
3749 | @@ -72,11 +72,11 @@ |
3750 | |
3751 | TEST_P(ForNormalSurface, state) |
3752 | { |
3753 | - auto const original_state = mir_surface_state_restored; |
3754 | - auto const new_state = MirSurfaceState(GetParam()); |
3755 | - auto const state_is_visible = (new_state != mir_surface_state_minimized) && (new_state != mir_surface_state_hidden); |
3756 | + auto const original_state = mir_window_state_restored; |
3757 | + auto const new_state = MirWindowState(GetParam()); |
3758 | + auto const state_is_visible = (new_state != mir_window_state_minimized) && (new_state != mir_window_state_hidden); |
3759 | |
3760 | - create_window_of_type(mir_surface_type_normal); |
3761 | + create_window_of_type(mir_window_type_normal); |
3762 | auto const& info = window_manager_tools.info_for(window); |
3763 | |
3764 | WindowSpecification mods; |
3765 | @@ -95,13 +95,13 @@ |
3766 | } |
3767 | |
3768 | INSTANTIATE_TEST_CASE_P(ModifyWindowState, ForNormalSurface, ::testing::Values( |
3769 | -// mir_surface_state_unknown, |
3770 | - mir_surface_state_restored, |
3771 | - mir_surface_state_minimized, |
3772 | - mir_surface_state_maximized, |
3773 | - mir_surface_state_vertmaximized, |
3774 | - mir_surface_state_fullscreen, |
3775 | - mir_surface_state_horizmaximized, |
3776 | - mir_surface_state_hidden |
3777 | -// mir_surface_states |
3778 | +// mir_window_state_unknown, |
3779 | + mir_window_state_restored, |
3780 | + mir_window_state_minimized, |
3781 | + mir_window_state_maximized, |
3782 | + mir_window_state_vertmaximized, |
3783 | + mir_window_state_fullscreen, |
3784 | + mir_window_state_horizmaximized, |
3785 | + mir_window_state_hidden |
3786 | +// mir_window_states |
3787 | )); |
3788 | |
3789 | === modified file 'test/persistent_surface_store.cpp' |
3790 | --- test/persistent_surface_store.cpp 2016-11-23 09:51:02 +0000 |
3791 | +++ test/persistent_surface_store.cpp 2017-01-26 16:46:42 +0000 |
3792 | @@ -17,8 +17,8 @@ |
3793 | */ |
3794 | |
3795 | #include <miral/toolkit/persistent_id.h> |
3796 | -#include <miral/toolkit/surface.h> |
3797 | -#include <miral/toolkit/surface_spec.h> |
3798 | +#include <miral/toolkit/window.h> |
3799 | +#include <miral/toolkit/window_spec.h> |
3800 | |
3801 | #include <miral/application_info.h> |
3802 | |
3803 | @@ -49,10 +49,10 @@ |
3804 | using namespace miral::toolkit; |
3805 | |
3806 | auto const connection = connect_client(test_name); |
3807 | - auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3808 | + auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3809 | .set_name(test_name); |
3810 | |
3811 | - Surface const surface{spec.create_surface()}; |
3812 | + Window const surface{spec.create_surface()}; |
3813 | |
3814 | miral::toolkit::PersistentId client_surface_id{surface}; |
3815 | |
3816 | @@ -71,10 +71,10 @@ |
3817 | using namespace miral::toolkit; |
3818 | |
3819 | auto const connection = connect_client(test_name); |
3820 | - auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3821 | + auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3822 | .set_name(test_name); |
3823 | |
3824 | - Surface const surface{spec.create_surface()}; |
3825 | + Window const surface{spec.create_surface()}; |
3826 | |
3827 | miral::toolkit::PersistentId client_surface_id{surface}; |
3828 | |
3829 | @@ -93,10 +93,10 @@ |
3830 | using namespace miral::toolkit; |
3831 | |
3832 | auto const connection = connect_client(test_name); |
3833 | - auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3834 | + auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3835 | .set_name(test_name); |
3836 | |
3837 | - Surface const surface{spec.create_surface()}; |
3838 | + Window const surface{spec.create_surface()}; |
3839 | |
3840 | miral::toolkit::PersistentId client_surface_id{surface}; |
3841 | |
3842 | @@ -112,10 +112,10 @@ |
3843 | using namespace miral::toolkit; |
3844 | |
3845 | auto const connection = connect_client(test_name); |
3846 | - auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3847 | + auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3848 | .set_name(test_name); |
3849 | |
3850 | - Surface const surface{spec.create_surface()}; |
3851 | + Window const surface{spec.create_surface()}; |
3852 | |
3853 | miral::toolkit::PersistentId client_surface_id{surface}; |
3854 | |
3855 | @@ -133,10 +133,10 @@ |
3856 | using namespace miral::toolkit; |
3857 | |
3858 | auto const connection = connect_client(test_name); |
3859 | - auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3860 | + auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888) |
3861 | .set_name(test_name); |
3862 | |
3863 | - Surface const surface{spec.create_surface()}; |
3864 | + Window const surface{spec.create_surface()}; |
3865 | |
3866 | miral::toolkit::PersistentId client_surface_id{surface}; |
3867 | |
3868 | |
3869 | === added file 'test/raise_tree.cpp' |
3870 | --- test/raise_tree.cpp 1970-01-01 00:00:00 +0000 |
3871 | +++ test/raise_tree.cpp 2017-01-26 16:46:42 +0000 |
3872 | @@ -0,0 +1,95 @@ |
3873 | +/* |
3874 | + * Copyright © 2017 Canonical Ltd. |
3875 | + * |
3876 | + * This program is free software: you can redistribute it and/or modify it |
3877 | + * under the terms of the GNU General Public License version 3, |
3878 | + * as published by the Free Software Foundation. |
3879 | + * |
3880 | + * This program is distributed in the hope that it will be useful, |
3881 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3882 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3883 | + * GNU General Public License for more details. |
3884 | + * |
3885 | + * You should have received a copy of the GNU General Public License |
3886 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3887 | + * |
3888 | + * Authored by: Alan Griffiths <alan@octopull.co.uk> |
3889 | + */ |
3890 | + |
3891 | +#include "test_window_manager_tools.h" |
3892 | + |
3893 | +using namespace miral; |
3894 | +using namespace testing; |
3895 | +namespace mt = mir::test; |
3896 | + |
3897 | +namespace |
3898 | +{ |
3899 | +X const display_left{0}; |
3900 | +Y const display_top{0}; |
3901 | +Width const display_width{640}; |
3902 | +Height const display_height{480}; |
3903 | + |
3904 | +Rectangle const display_area{{display_left, display_top}, {display_width, display_height}}; |
3905 | + |
3906 | +struct RaiseTree : TestWindowManagerTools |
3907 | +{ |
3908 | + Size const initial_parent_size{600, 400}; |
3909 | + Size const initial_child_size{300, 300}; |
3910 | + Rectangle const rectangle_away_from_rhs{{20, 20}, {20, 20}}; |
3911 | + Rectangle const rectangle_near_rhs{{590, 20}, {10, 20}}; |
3912 | + Rectangle const rectangle_away_from_bottom{{20, 20}, {20, 20}}; |
3913 | + Rectangle const rectangle_near_bottom{{20, 380}, {20, 20}}; |
3914 | + Rectangle const rectangle_near_both_sides{{0, 20}, {600, 20}}; |
3915 | + Rectangle const rectangle_near_both_sides_and_bottom{{0, 380}, {600, 20}}; |
3916 | + Rectangle const rectangle_near_all_sides{{0, 20}, {600, 380}}; |
3917 | + Rectangle const rectangle_near_both_bottom_right{{400, 380}, {200, 20}}; |
3918 | + |
3919 | + Window parent; |
3920 | + Window child; |
3921 | + Window another_window; |
3922 | + |
3923 | + WindowSpecification modification; |
3924 | + |
3925 | + void SetUp() override |
3926 | + { |
3927 | + basic_window_manager.add_display(display_area); |
3928 | + |
3929 | + mir::scene::SurfaceCreationParameters creation_parameters; |
3930 | + basic_window_manager.add_session(session); |
3931 | + |
3932 | + EXPECT_CALL(*window_manager_policy, advise_new_window(_)) |
3933 | + .WillOnce(Invoke([this](WindowInfo const& window_info){ parent = window_info.window(); })) |
3934 | + .WillOnce(Invoke([this](WindowInfo const& window_info){ child = window_info.window(); })) |
3935 | + .WillOnce(Invoke([this](WindowInfo const& window_info){ another_window = window_info.window(); })); |
3936 | + |
3937 | + creation_parameters.size = initial_parent_size; |
3938 | + basic_window_manager.add_surface(session, creation_parameters, &create_surface); |
3939 | + |
3940 | + creation_parameters.type = mir_window_type_menu; |
3941 | + creation_parameters.parent = parent; |
3942 | + creation_parameters.size = initial_child_size; |
3943 | + basic_window_manager.add_surface(session, creation_parameters, &create_surface); |
3944 | + |
3945 | + creation_parameters.type = mir_window_type_normal; |
3946 | + creation_parameters.parent.reset(); |
3947 | + creation_parameters.size = display_area.size; |
3948 | + basic_window_manager.add_surface(session, creation_parameters, &create_surface); |
3949 | + |
3950 | + // Clear the expectations used to capture parent & child |
3951 | + Mock::VerifyAndClearExpectations(window_manager_policy); |
3952 | + } |
3953 | +}; |
3954 | +} |
3955 | + |
3956 | +TEST_F(RaiseTree, when_parent_is_raised_child_is_raised) |
3957 | +{ |
3958 | + EXPECT_CALL(*window_manager_policy, advise_raise(ElementsAre(parent, child))); |
3959 | + basic_window_manager.raise_tree(parent); |
3960 | +} |
3961 | + |
3962 | +TEST_F(RaiseTree, when_child_is_raised_parent_is_raised) |
3963 | +{ |
3964 | + EXPECT_CALL(*window_manager_policy, advise_raise(ElementsAre(parent, child))); |
3965 | + EXPECT_CALL(*window_manager_policy, advise_raise(ElementsAre(child))); |
3966 | + basic_window_manager.raise_tree(child); |
3967 | +} |
3968 | |
3969 | === modified file 'test/select_active_window.cpp' |
3970 | --- test/select_active_window.cpp 2016-10-10 14:53:39 +0000 |
3971 | +++ test/select_active_window.cpp 2017-01-26 16:46:42 +0000 |
3972 | @@ -82,13 +82,13 @@ |
3973 | { |
3974 | mir::scene::SurfaceCreationParameters creation_parameters; |
3975 | creation_parameters.name = "parent"; |
3976 | - creation_parameters.type = mir_surface_type_normal; |
3977 | + creation_parameters.type = mir_window_type_normal; |
3978 | creation_parameters.size = Size{600, 400}; |
3979 | |
3980 | auto parent = create_window(creation_parameters); |
3981 | |
3982 | creation_parameters.name = "dialog"; |
3983 | - creation_parameters.type = mir_surface_type_dialog; |
3984 | + creation_parameters.type = mir_window_type_dialog; |
3985 | creation_parameters.parent = parent; |
3986 | |
3987 | auto dialog = create_window(creation_parameters); |
3988 | @@ -102,22 +102,22 @@ |
3989 | { |
3990 | mir::scene::SurfaceCreationParameters creation_parameters; |
3991 | creation_parameters.name = "parent"; |
3992 | - creation_parameters.type = mir_surface_type_normal; |
3993 | + creation_parameters.type = mir_window_type_normal; |
3994 | creation_parameters.size = Size{600, 400}; |
3995 | |
3996 | auto parent = create_window(creation_parameters); |
3997 | |
3998 | creation_parameters.name = "dialog"; |
3999 | - creation_parameters.type = mir_surface_type_dialog; |
4000 | + creation_parameters.type = mir_window_type_dialog; |
4001 | creation_parameters.parent = parent; |
4002 | |
4003 | auto dialog = create_window(creation_parameters); |
4004 | |
4005 | WindowSpecification mods; |
4006 | - mods.state() = mir_surface_state_hidden; |
4007 | + mods.state() = mir_window_state_hidden; |
4008 | basic_window_manager.modify_window(basic_window_manager.info_for(dialog), mods); |
4009 | |
4010 | auto actual = basic_window_manager.select_active_window(parent); |
4011 | EXPECT_THAT(actual, Eq(parent)) |
4012 | << "actual=" << actual << ", expected=" << parent; |
4013 | -} |
4014 | \ No newline at end of file |
4015 | +} |
4016 | |
4017 | === modified file 'test/test_window_manager_tools.h' |
4018 | --- test/test_window_manager_tools.h 2016-10-10 14:53:39 +0000 |
4019 | +++ test/test_window_manager_tools.h 2017-01-26 16:46:42 +0000 |
4020 | @@ -74,11 +74,11 @@ |
4021 | |
4022 | struct StubSurface : mir::test::doubles::StubSurface |
4023 | { |
4024 | - StubSurface(std::string name, MirSurfaceType type, mir::geometry::Point top_left, mir::geometry::Size size) : |
4025 | + StubSurface(std::string name, MirWindowType type, mir::geometry::Point top_left, mir::geometry::Size size) : |
4026 | name_{name}, type_{type}, top_left_{top_left}, size_{size} {} |
4027 | |
4028 | std::string name() const override { return name_; }; |
4029 | - MirSurfaceType type() const { return type_; } |
4030 | + MirWindowType type() const override { return type_; } |
4031 | |
4032 | mir::geometry::Point top_left() const override { return top_left_; } |
4033 | void move_to(mir::geometry::Point const& top_left) override { top_left_ = top_left; } |
4034 | @@ -86,25 +86,25 @@ |
4035 | mir::geometry::Size size() const override { return size_; } |
4036 | void resize(mir::geometry::Size const& size) override { size_ = size; } |
4037 | |
4038 | - auto state() const -> MirSurfaceState override { return state_; } |
4039 | - auto configure(MirSurfaceAttrib attrib, int value) -> int override { |
4040 | + auto state() const -> MirWindowState override { return state_; } |
4041 | + auto configure(MirWindowAttrib attrib, int value) -> int override { |
4042 | switch (attrib) |
4043 | { |
4044 | - case mir_surface_attrib_state: |
4045 | - state_ = MirSurfaceState(value); |
4046 | + case mir_window_attrib_state: |
4047 | + state_ = MirWindowState(value); |
4048 | return state_; |
4049 | default: |
4050 | return value; |
4051 | } |
4052 | } |
4053 | |
4054 | - bool visible() const override { return state() != mir_surface_state_hidden; } |
4055 | + bool visible() const override { return state() != mir_window_state_hidden; } |
4056 | |
4057 | std::string name_; |
4058 | - MirSurfaceType type_; |
4059 | + MirWindowType type_; |
4060 | mir::geometry::Point top_left_; |
4061 | mir::geometry::Size size_; |
4062 | - MirSurfaceState state_ = mir_surface_state_restored; |
4063 | + MirWindowState state_ = mir_window_state_restored; |
4064 | }; |
4065 | |
4066 | struct StubStubSession : mir::test::doubles::StubSession |
4067 | @@ -133,13 +133,14 @@ |
4068 | { |
4069 | using miral::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy; |
4070 | |
4071 | - bool handle_touch_event(MirTouchEvent const* /*event*/) override { return false; } |
4072 | - bool handle_pointer_event(MirPointerEvent const* /*event*/) override { return false; } |
4073 | - bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) override { return false; } |
4074 | + bool handle_touch_event(MirTouchEvent const* /*event*/) { return false; } |
4075 | + bool handle_pointer_event(MirPointerEvent const* /*event*/) { return false; } |
4076 | + bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) { return false; } |
4077 | |
4078 | MOCK_METHOD1(advise_new_window, void (miral::WindowInfo const& window_info)); |
4079 | MOCK_METHOD2(advise_move_to, void(miral::WindowInfo const& window_info, mir::geometry::Point top_left)); |
4080 | MOCK_METHOD2(advise_resize, void(miral::WindowInfo const& window_info, mir::geometry::Size const& new_size)); |
4081 | + MOCK_METHOD1(advise_raise, void(std::vector<miral::Window> const&)); |
4082 | }; |
4083 | |
4084 | struct TestWindowManagerTools : testing::Test |
4085 | @@ -158,7 +159,7 @@ |
4086 | mir::test::fake_shared(persistent_surface_store), |
4087 | [this](miral::WindowManagerTools const& tools) -> std::unique_ptr<miral::WindowManagementPolicy> |
4088 | { |
4089 | - auto policy = std::make_unique<MockWindowManagerPolicy>(tools); |
4090 | + auto policy = std::make_unique<testing::NiceMock<MockWindowManagerPolicy>>(tools); |
4091 | window_manager_policy = policy.get(); |
4092 | window_manager_tools = tools; |
4093 | return std::move(policy); |
4094 | |
4095 | === modified file 'test/window_placement.cpp' |
4096 | --- test/window_placement.cpp 2016-09-19 12:04:12 +0000 |
4097 | +++ test/window_placement.cpp 2017-01-26 16:46:42 +0000 |
4098 | @@ -73,7 +73,7 @@ |
4099 | creation_parameters.size = initial_parent_size; |
4100 | basic_window_manager.add_surface(session, creation_parameters, &create_surface); |
4101 | |
4102 | - creation_parameters.type = mir_surface_type_menu; |
4103 | + creation_parameters.type = mir_window_type_menu; |
4104 | creation_parameters.parent = parent; |
4105 | creation_parameters.size = initial_child_size; |
4106 | basic_window_manager.add_surface(session, creation_parameters, &create_surface); |
4107 | @@ -121,12 +121,12 @@ |
4108 | ASSERT_THAT(parent, Ne(null_window)); |
4109 | ASSERT_THAT(parent.size(), Eq(initial_parent_size)); |
4110 | ASSERT_THAT(basic_window_manager.info_for(parent).children(), ElementsAre(child)); |
4111 | - ASSERT_THAT(basic_window_manager.info_for(parent).type(), Eq(mir_surface_type_normal)); |
4112 | + ASSERT_THAT(basic_window_manager.info_for(parent).type(), Eq(mir_window_type_normal)); |
4113 | |
4114 | ASSERT_THAT(child, Ne(null_window)); |
4115 | ASSERT_THAT(child.size(), Eq(initial_child_size)); |
4116 | ASSERT_THAT(basic_window_manager.info_for(child).parent(), Eq(parent)); |
4117 | - ASSERT_THAT(basic_window_manager.info_for(child).type(), Eq(mir_surface_type_menu)); |
4118 | + ASSERT_THAT(basic_window_manager.info_for(child).type(), Eq(mir_window_type_menu)); |
4119 | } |
4120 | |
4121 | |
4122 | |
4123 | === modified file 'test/window_placement_anchors_to_parent.cpp' |
4124 | --- test/window_placement_anchors_to_parent.cpp 2016-09-19 14:06:02 +0000 |
4125 | +++ test/window_placement_anchors_to_parent.cpp 2017-01-26 16:46:42 +0000 |
4126 | @@ -71,7 +71,7 @@ |
4127 | creation_parameters.size = parent_size; |
4128 | basic_window_manager.add_surface(session, creation_parameters, &create_surface); |
4129 | |
4130 | - creation_parameters.type = mir_surface_type_tip; |
4131 | + creation_parameters.type = mir_window_type_tip; |
4132 | creation_parameters.parent = parent; |
4133 | creation_parameters.size = initial_child_size; |
4134 | basic_window_manager.add_surface(session, creation_parameters, &create_surface); |
4135 | |
4136 | === modified file 'test/window_placement_client_api.cpp' |
4137 | --- test/window_placement_client_api.cpp 2016-09-15 13:50:33 +0000 |
4138 | +++ test/window_placement_client_api.cpp 2017-01-26 16:46:42 +0000 |
4139 | @@ -17,13 +17,19 @@ |
4140 | */ |
4141 | |
4142 | #include <mir/version.h> |
4143 | +#include <mir_toolkit/version.h> |
4144 | |
4145 | #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0) |
4146 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
4147 | #include <mir_toolkit/events/surface_placement.h> |
4148 | +#else |
4149 | +#include <mir_toolkit/events/window_placement.h> |
4150 | +#endif |
4151 | #endif |
4152 | |
4153 | -#include <miral/toolkit/surface_spec.h> |
4154 | -#include <miral/toolkit/surface.h> |
4155 | +#include <miral/detail/mir_forward_compatibility.h> |
4156 | +#include <miral/toolkit/window_spec.h> |
4157 | +#include <miral/toolkit/window.h> |
4158 | |
4159 | #include <mir/test/signal.h> |
4160 | #include "test_server.h" |
4161 | @@ -50,7 +56,7 @@ |
4162 | char const* const test_name = __PRETTY_FUNCTION__; |
4163 | |
4164 | connection = connect_client(test_name); |
4165 | - auto spec = SurfaceSpec::for_normal_surface(connection, 400, 400, mir_pixel_format_argb_8888) |
4166 | + auto spec = WindowSpec::for_normal_surface(connection, 400, 400, mir_pixel_format_argb_8888) |
4167 | .set_name(test_name); |
4168 | |
4169 | parent = spec.create_surface(); |
4170 | @@ -66,13 +72,17 @@ |
4171 | } |
4172 | |
4173 | Connection connection; |
4174 | - Surface parent; |
4175 | - Surface child; |
4176 | + Window parent; |
4177 | + Window child; |
4178 | }; |
4179 | } |
4180 | |
4181 | #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0) |
4182 | |
4183 | +#if MIR_CLIENT_VERSION == MIR_VERSION_NUMBER(3, 4, 0) |
4184 | +auto const mir_event_type_window_placement = mir_event_type_surface_placement; |
4185 | +#endif |
4186 | + |
4187 | namespace |
4188 | { |
4189 | struct CheckPlacement |
4190 | @@ -80,21 +90,30 @@ |
4191 | CheckPlacement(int left, int top, unsigned int width, unsigned int height) : |
4192 | expected{left, top, width, height} {} |
4193 | |
4194 | - void check(MirSurfacePlacementEvent const* placement_event) |
4195 | + void check(MirWindowPlacementEvent const* placement_event) |
4196 | { |
4197 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).top, Eq(expected.top)); |
4198 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).left, Eq(expected.left)); |
4199 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).height, Eq(expected.height)); |
4200 | - EXPECT_THAT(mir_surface_placement_get_relative_position(placement_event).width, Eq(expected.width)); |
4201 | +#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0) |
4202 | + auto relative_position = mir_surface_placement_get_relative_position(placement_event); |
4203 | +#else |
4204 | + auto relative_position = mir_window_placement_get_relative_position(placement_event); |
4205 | +#endif |
4206 | + EXPECT_THAT(relative_position.top, Eq(expected.top)); |
4207 | + EXPECT_THAT(relative_position.left, Eq(expected.left)); |
4208 | + EXPECT_THAT(relative_position.height, Eq(expected.height)); |
4209 | + EXPECT_THAT(relative_position.width, Eq(expected.width)); |
4210 | |
4211 | received.raise(); |
4212 | } |
4213 | |
4214 | - static void callback(MirSurface* /*surface*/, MirEvent const* event, void* context) |
4215 | + static void callback(MirWindow* /*surface*/, MirEvent const* event, void* context) |
4216 | { |
4217 | - if (mir_event_get_type(event) == mir_event_type_surface_placement) |
4218 | + if (mir_event_get_type(event) == mir_event_type_window_placement) |
4219 | { |
4220 | +#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0) |
4221 | auto const placement_event = mir_event_get_surface_placement_event(event); |
4222 | +#else |
4223 | + auto const placement_event = mir_event_get_window_placement_event(event); |
4224 | +#endif |
4225 | static_cast<CheckPlacement*>(context)->check(placement_event); |
4226 | } |
4227 | } |
4228 | @@ -123,7 +142,7 @@ |
4229 | MirRectangle aux_rect{10, 20, 3, 4}; |
4230 | CheckPlacement expected{aux_rect.left+(int)aux_rect.width, aux_rect.top, dx, dy}; |
4231 | |
4232 | - auto const spec = SurfaceSpec:: |
4233 | + auto const spec = WindowSpec:: |
4234 | for_menu(connection, dx, dy, mir_pixel_format_argb_8888, parent, &aux_rect, mir_edge_attachment_any) |
4235 | .set_event_handler(&CheckPlacement::callback, &expected) |
4236 | .set_name(test_name); |
4237 | @@ -136,7 +155,7 @@ |
4238 | MirRectangle aux_rect{50, 60, 5, 7}; |
4239 | CheckPlacement expected{aux_rect.left-dx, aux_rect.top, dx, dy}; |
4240 | |
4241 | - auto const spec = SurfaceSpec::for_changes(connection) |
4242 | + auto const spec = WindowSpec::for_changes(connection) |
4243 | .set_event_handler(&CheckPlacement::callback, &expected) |
4244 | .set_placement(&aux_rect, mir_placement_gravity_northwest, mir_placement_gravity_northeast, mir_placement_hints_flip_x, 0, 0); |
4245 |
The hack for generating backward-compatible synonyms fails to account for the case of building against earlier versions of Mir. In which case it fails to generate forward-compatible synonyms.
That is, MirAL 1.1 built against Mir 0.25 is not ABI compatible with MirAL 1.1 built against Mir 0.26.