Merge lp:~alan-griffiths/mir/server-support-for-client-initiates-move into lp:mir
- server-support-for-client-initiates-move
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Alan Griffiths |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4143 |
Proposed branch: | lp:~alan-griffiths/mir/server-support-for-client-initiates-move |
Merge into: | lp:mir |
Diff against target: |
1792 lines (+444/-630) 34 files modified
examples/CMakeLists.txt (+0/-2) examples/server_example_basic_window_manager.cpp (+8/-0) examples/server_example_basic_window_manager.h (+8/-1) examples/server_example_window_management_info.cpp (+0/-373) examples/server_example_window_management_info.h (+0/-105) include/server/mir/shell/abstract_shell.h (+5/-0) include/server/mir/shell/basic_window_manager.h (+14/-2) include/server/mir/shell/canonical_window_manager.h (+5/-1) include/server/mir/shell/shell.h (+5/-0) include/server/mir/shell/shell_wrapper.h (+5/-0) include/server/mir/shell/system_compositor_window_manager.h (+5/-0) include/server/mir/shell/window_management_info.h (+3/-3) include/server/mir/shell/window_manager.h (+5/-0) include/test/mir/test/doubles/mock_window_manager.h (+1/-0) src/include/server/mir/frontend/shell.h (+9/-7) src/server/CMakeLists.txt (+1/-0) src/server/frontend/CMakeLists.txt (+1/-0) src/server/frontend/session_mediator.cpp (+15/-2) src/server/frontend/shell_wrapper.cpp (+4/-14) src/server/frontend/shell_wrapper.h (+5/-9) src/server/shell/CMakeLists.txt (+3/-3) src/server/shell/abstract_shell.cpp (+8/-0) src/server/shell/basic_window_manager.cpp (+32/-6) src/server/shell/frontend_shell.cpp (+30/-18) src/server/shell/frontend_shell.h (+5/-9) src/server/shell/shell_wrapper.cpp (+8/-0) src/server/shell/system_compositor_window_manager.cpp (+7/-0) src/server/shell/window_management_info.cpp (+72/-0) src/server/symbols.map (+144/-63) tests/acceptance-tests/CMakeLists.txt (+0/-8) tests/acceptance-tests/client_mediated_user_gestures.cpp (+28/-2) tests/acceptance-tests/test_client_cursor_api.cpp (+3/-0) tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp (+3/-0) tests/include/mir/test/doubles/mock_shell.h (+2/-2) |
To merge this branch: | bzr merge lp:~alan-griffiths/mir/server-support-for-client-initiates-move |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Approve | |
Kevin DuBois (community) | Approve | ||
Review via email: mp+321470@code.launchpad.net |
Commit message
Server support for mir_window_
Description of the change
Server support for mir_window_
To test this I had to make some classes public (msh::BasicWind
So these classes are both published and deprecated. Cleanup to follow, hopefully soon.
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4135
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4136
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4137
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Kevin DuBois (kdub) wrote : | # |
'StreamPainter' isn't a useful interface anymore, can probably be removed.
should this be comment out?
963 +// policy-
Alan Griffiths (alan-griffiths) wrote : | # |
> 'StreamPainter' isn't a useful interface anymore, can probably be removed.
Reworking the code to remove it is beyond the scope of *this* MP.
In fact, I think it pointless as this code is superseded by miral, we just haven't quite reached the point where we can integrate that work.
> should this be comment out?
> 963 +// policy-
Replaced with an English version.
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4139
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Alan Griffiths (alan-griffiths) wrote : | # |
^ Seems like a CI glitch...
10:48:46 error: device offline
10:48:46 error: device offline
10:48:46 error: device offline
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4139
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'examples/CMakeLists.txt' |
2 | --- examples/CMakeLists.txt 2017-02-15 07:38:33 +0000 |
3 | +++ examples/CMakeLists.txt 2017-04-04 10:15:32 +0000 |
4 | @@ -28,8 +28,6 @@ |
5 | server_example_input_filter.cpp |
6 | server_example_host_lifecycle_event.cpp |
7 | server_example_window_management.cpp |
8 | - server_example_window_management_info.cpp |
9 | - server_example_window_management_info.h |
10 | server_example_custom_compositor.cpp |
11 | server_example_adorning_compositor.cpp |
12 | server_example_cursor_images.cpp |
13 | |
14 | === modified file 'examples/server_example_basic_window_manager.cpp' |
15 | --- examples/server_example_basic_window_manager.cpp 2017-03-08 16:16:44 +0000 |
16 | +++ examples/server_example_basic_window_manager.cpp 2017-04-04 10:15:32 +0000 |
17 | @@ -144,6 +144,14 @@ |
18 | // Not supported in example servers |
19 | } |
20 | |
21 | +void me::BasicWindowManager::handle_request_move( |
22 | + std::shared_ptr<scene::Session> const& /*session*/, |
23 | + std::shared_ptr<scene::Surface> const& /*surface*/, |
24 | + uint64_t /*timestamp*/) |
25 | +{ |
26 | + // Not supported in example servers |
27 | +} |
28 | + |
29 | int me::BasicWindowManager::set_surface_attribute( |
30 | std::shared_ptr<scene::Session> const& /*session*/, |
31 | std::shared_ptr<scene::Surface> const& surface, |
32 | |
33 | === modified file 'examples/server_example_basic_window_manager.h' |
34 | --- examples/server_example_basic_window_manager.h 2017-03-08 12:59:36 +0000 |
35 | +++ examples/server_example_basic_window_manager.h 2017-04-04 10:15:32 +0000 |
36 | @@ -19,7 +19,7 @@ |
37 | #ifndef MIR_EXAMPLE_BASIC_WINDOW_MANAGER_H_ |
38 | #define MIR_EXAMPLE_BASIC_WINDOW_MANAGER_H_ |
39 | |
40 | -#include "server_example_window_management_info.h" |
41 | +#include "mir/shell/window_management_info.h" |
42 | |
43 | #include "mir/geometry/rectangles.h" |
44 | #include "mir/shell/abstract_shell.h" |
45 | @@ -36,6 +36,8 @@ |
46 | namespace examples |
47 | { |
48 | using shell::SurfaceSet; |
49 | +using shell::SurfaceInfo; |
50 | +using shell::SessionInfo; |
51 | |
52 | /// The interface through which the policy instructs the controller. |
53 | /// These functions assume that the BasicWindowManager data structures can be accessed freely. |
54 | @@ -179,6 +181,11 @@ |
55 | std::shared_ptr<scene::Surface> const& surface, |
56 | uint64_t timestamp) override; |
57 | |
58 | + void handle_request_move( |
59 | + std::shared_ptr<scene::Session> const& session, |
60 | + std::shared_ptr<scene::Surface> const& surface, |
61 | + uint64_t timestamp) override; |
62 | + |
63 | int set_surface_attribute( |
64 | std::shared_ptr<scene::Session> const& /*session*/, |
65 | std::shared_ptr<scene::Surface> const& surface, |
66 | |
67 | === removed file 'examples/server_example_window_management_info.cpp' |
68 | --- examples/server_example_window_management_info.cpp 2017-01-30 08:13:20 +0000 |
69 | +++ examples/server_example_window_management_info.cpp 1970-01-01 00:00:00 +0000 |
70 | @@ -1,373 +0,0 @@ |
71 | -/* |
72 | - * Copyright © 2015 Canonical Ltd. |
73 | - * |
74 | - * This program is free software: you can redistribute it and/or modify it |
75 | - * under the terms of the GNU General Public License version 3, |
76 | - * as published by the Free Software Foundation. |
77 | - * |
78 | - * This program is distributed in the hope that it will be useful, |
79 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
80 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
81 | - * GNU General Public License for more details. |
82 | - * |
83 | - * You should have received a copy of the GNU General Public License |
84 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
85 | - * |
86 | - * Authored by: Alan Griffiths <alan@octopull.co.uk> |
87 | - */ |
88 | - |
89 | -#include "server_example_window_management_info.h" |
90 | - |
91 | -#include "mir/scene/surface.h" |
92 | -#include "mir/scene/surface_creation_parameters.h" |
93 | -#include "mir/scene/session.h" |
94 | - |
95 | -#include "mir/graphics/buffer.h" |
96 | -#include "mir/renderer/sw/pixel_source.h" |
97 | - |
98 | -#include <atomic> |
99 | - |
100 | -namespace me = mir::examples; |
101 | -namespace ms = mir::scene; |
102 | -namespace mg = mir::graphics; |
103 | -namespace mrs = mir::renderer::software; |
104 | -using namespace mir::geometry; |
105 | - |
106 | -me::SurfaceInfo::SurfaceInfo( |
107 | - std::shared_ptr<scene::Session> const& session, |
108 | - std::shared_ptr<scene::Surface> const& surface, |
109 | - scene::SurfaceCreationParameters const& params) : |
110 | - type{surface->type()}, |
111 | - state{surface->state()}, |
112 | - restore_rect{surface->top_left(), surface->size()}, |
113 | - session{session}, |
114 | - parent{params.parent}, |
115 | - min_width{params.min_width.is_set() ? params.min_width.value() : Width{}}, |
116 | - min_height{params.min_height.is_set() ? params.min_height.value() : Height{}}, |
117 | - max_width{params.max_width.is_set() ? params.max_width.value() : Width{std::numeric_limits<int>::max()}}, |
118 | - max_height{params.max_height.is_set() ? params.max_height.value() : Height{std::numeric_limits<int>::max()}}, |
119 | - width_inc{params.width_inc}, |
120 | - height_inc{params.height_inc}, |
121 | - min_aspect{params.min_aspect}, |
122 | - max_aspect{params.max_aspect} |
123 | -{ |
124 | - if (params.output_id != mir::graphics::DisplayConfigurationOutputId{0}) |
125 | - output_id = params.output_id; |
126 | -} |
127 | - |
128 | -bool me::SurfaceInfo::can_be_active() const |
129 | -{ |
130 | - switch (type) |
131 | - { |
132 | - case mir_window_type_normal: /**< AKA "regular" */ |
133 | - case mir_window_type_utility: /**< AKA "floating" */ |
134 | - case mir_window_type_dialog: |
135 | - case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */ |
136 | - case mir_window_type_freestyle: |
137 | - case mir_window_type_menu: |
138 | - case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */ |
139 | - return true; |
140 | - |
141 | - case mir_window_type_gloss: |
142 | - case mir_window_type_tip: /**< AKA "tooltip" */ |
143 | - default: |
144 | - // Cannot have input focus |
145 | - return false; |
146 | - } |
147 | -} |
148 | - |
149 | -bool me::SurfaceInfo::must_have_parent() const |
150 | -{ |
151 | - switch (type) |
152 | - { |
153 | - case mir_window_type_gloss:; |
154 | - case mir_window_type_inputmethod: |
155 | - case mir_window_type_satellite: |
156 | - case mir_window_type_tip: |
157 | - return true; |
158 | - |
159 | - default: |
160 | - return false; |
161 | - } |
162 | -} |
163 | - |
164 | -bool me::SurfaceInfo::can_morph_to(MirWindowType new_type) const |
165 | -{ |
166 | - switch (new_type) |
167 | - { |
168 | - case mir_window_type_normal: |
169 | - case mir_window_type_utility: |
170 | - case mir_window_type_satellite: |
171 | - switch (type) |
172 | - { |
173 | - case mir_window_type_normal: |
174 | - case mir_window_type_utility: |
175 | - case mir_window_type_dialog: |
176 | - case mir_window_type_satellite: |
177 | - return true; |
178 | - |
179 | - default: |
180 | - break; |
181 | - } |
182 | - break; |
183 | - |
184 | - case mir_window_type_dialog: |
185 | - switch (type) |
186 | - { |
187 | - case mir_window_type_normal: |
188 | - case mir_window_type_utility: |
189 | - case mir_window_type_dialog: |
190 | - case mir_window_type_menu: |
191 | - case mir_window_type_satellite: |
192 | - return true; |
193 | - |
194 | - default: |
195 | - break; |
196 | - } |
197 | - break; |
198 | - |
199 | - default: |
200 | - break; |
201 | - } |
202 | - |
203 | - return false; |
204 | -} |
205 | - |
206 | -bool me::SurfaceInfo::must_not_have_parent() const |
207 | -{ |
208 | - switch (type) |
209 | - { |
210 | - case mir_window_type_normal: |
211 | - case mir_window_type_utility: |
212 | - return true; |
213 | - |
214 | - default: |
215 | - return false; |
216 | - } |
217 | -} |
218 | - |
219 | -bool me::SurfaceInfo::is_visible() const |
220 | -{ |
221 | - switch (state) |
222 | - { |
223 | - case mir_window_state_hidden: |
224 | - case mir_window_state_minimized: |
225 | - return false; |
226 | - default: |
227 | - break; |
228 | - } |
229 | - return true; |
230 | -} |
231 | - |
232 | -struct mir::examples::SurfaceInfo::StreamPainter |
233 | -{ |
234 | - virtual void paint(int) = 0; |
235 | - virtual ~StreamPainter() = default; |
236 | - StreamPainter() = default; |
237 | - StreamPainter(StreamPainter const&) = delete; |
238 | - StreamPainter& operator=(StreamPainter const&) = delete; |
239 | -}; |
240 | - |
241 | -struct mir::examples::SurfaceInfo::AllocatingPainter |
242 | - : mir::examples::SurfaceInfo::StreamPainter |
243 | -{ |
244 | - AllocatingPainter( |
245 | - std::shared_ptr<frontend::BufferStream> const& buffer_stream, |
246 | - std::shared_ptr<scene::Session> const& session, |
247 | - Size size) : |
248 | - buffer_stream(buffer_stream), |
249 | - session(session), |
250 | - properties({ |
251 | - size, |
252 | - buffer_stream->pixel_format(), |
253 | - mg::BufferUsage::software |
254 | - }), |
255 | - front_buffer(session->create_buffer(properties)), |
256 | - back_buffer(session->create_buffer(properties)) |
257 | - { |
258 | - } |
259 | - |
260 | - void paint(int intensity) override |
261 | - { |
262 | - auto buffer = session->get_buffer(back_buffer); |
263 | - |
264 | - auto const format = buffer->pixel_format(); |
265 | - auto const sz = buffer->size().height.as_int() * |
266 | - buffer->size().width.as_int() * MIR_BYTES_PER_PIXEL(format); |
267 | - std::vector<unsigned char> pixels(sz, intensity); |
268 | - if (auto pixel_source = dynamic_cast<mrs::PixelSource*>(buffer->native_buffer_base())) |
269 | - pixel_source->write(pixels.data(), sz); |
270 | - buffer_stream->submit_buffer(buffer); |
271 | - |
272 | - std::swap(front_buffer, back_buffer); |
273 | - } |
274 | - |
275 | - ~AllocatingPainter() |
276 | - { |
277 | - session->destroy_buffer(front_buffer); |
278 | - session->destroy_buffer(back_buffer); |
279 | - } |
280 | - |
281 | - std::shared_ptr<frontend::BufferStream> const buffer_stream; |
282 | - std::shared_ptr<scene::Session> const session; |
283 | - mg::BufferProperties properties; |
284 | - mg::BufferID front_buffer; |
285 | - mg::BufferID back_buffer; |
286 | -}; |
287 | - |
288 | -void mir::examples::SurfaceInfo::init_titlebar( |
289 | - std::shared_ptr<scene::Session> const& session, |
290 | - std::shared_ptr<scene::Surface> const& surface) |
291 | -{ |
292 | - auto stream = surface->primary_buffer_stream(); |
293 | - stream_painter = std::make_shared<AllocatingPainter>(stream, session, surface->size()); |
294 | -} |
295 | - |
296 | -void mir::examples::SurfaceInfo::paint_titlebar(int intensity) |
297 | -{ |
298 | - stream_painter->paint(intensity); |
299 | -} |
300 | - |
301 | -void me::SurfaceInfo::constrain_resize( |
302 | - std::shared_ptr<ms::Surface> const& surface, |
303 | - Point& requested_pos, |
304 | - Size& requested_size, |
305 | - bool const left_resize, |
306 | - bool const top_resize, |
307 | - Rectangle const& /*bounds*/) const |
308 | -{ |
309 | - Point new_pos = requested_pos; |
310 | - Size new_size = requested_size; |
311 | - |
312 | - if (min_aspect.is_set()) |
313 | - { |
314 | - auto const ar = min_aspect.value(); |
315 | - |
316 | - auto const error = new_size.height.as_int()*long(ar.width) - new_size.width.as_int()*long(ar.height); |
317 | - |
318 | - if (error > 0) |
319 | - { |
320 | - // Add (denominator-1) to numerator to ensure rounding up |
321 | - auto const width_correction = (error+(ar.height-1))/ar.height; |
322 | - auto const height_correction = (error+(ar.width-1))/ar.width; |
323 | - |
324 | - if (width_correction < height_correction) |
325 | - { |
326 | - new_size.width = new_size.width + DeltaX(width_correction); |
327 | - } |
328 | - else |
329 | - { |
330 | - new_size.height = new_size.height - DeltaY(height_correction); |
331 | - } |
332 | - } |
333 | - } |
334 | - |
335 | - if (max_aspect.is_set()) |
336 | - { |
337 | - auto const ar = max_aspect.value(); |
338 | - |
339 | - auto const error = new_size.width.as_int()*long(ar.height) - new_size.height.as_int()*long(ar.width); |
340 | - |
341 | - if (error > 0) |
342 | - { |
343 | - // Add (denominator-1) to numerator to ensure rounding up |
344 | - auto const height_correction = (error+(ar.width-1))/ar.width; |
345 | - auto const width_correction = (error+(ar.height-1))/ar.height; |
346 | - |
347 | - if (width_correction < height_correction) |
348 | - { |
349 | - new_size.width = new_size.width - DeltaX(width_correction); |
350 | - } |
351 | - else |
352 | - { |
353 | - new_size.height = new_size.height + DeltaY(height_correction); |
354 | - } |
355 | - } |
356 | - } |
357 | - |
358 | - if (min_width > new_size.width) |
359 | - new_size.width = min_width; |
360 | - |
361 | - if (min_height > new_size.height) |
362 | - new_size.height = min_height; |
363 | - |
364 | - if (max_width < new_size.width) |
365 | - new_size.width = max_width; |
366 | - |
367 | - if (max_height < new_size.height) |
368 | - new_size.height = max_height; |
369 | - |
370 | - if (width_inc.is_set()) |
371 | - { |
372 | - auto const width = new_size.width.as_int() - min_width.as_int(); |
373 | - auto inc = width_inc.value().as_int(); |
374 | - if (width % inc) |
375 | - new_size.width = min_width + DeltaX{inc*(((2L*width + inc)/2)/inc)}; |
376 | - } |
377 | - |
378 | - if (height_inc.is_set()) |
379 | - { |
380 | - auto const height = new_size.height.as_int() - min_height.as_int(); |
381 | - auto inc = height_inc.value().as_int(); |
382 | - if (height % inc) |
383 | - new_size.height = min_height + DeltaY{inc*(((2L*height + inc)/2)/inc)}; |
384 | - } |
385 | - |
386 | - if (left_resize) |
387 | - new_pos.x += new_size.width - requested_size.width; |
388 | - |
389 | - if (top_resize) |
390 | - new_pos.y += new_size.height - requested_size.height; |
391 | - |
392 | - // placeholder - constrain onscreen |
393 | - |
394 | - switch (state) |
395 | - { |
396 | - case mir_window_state_restored: |
397 | - break; |
398 | - |
399 | - // "A vertically maximised surface is anchored to the top and bottom of |
400 | - // the available workspace and can have any width." |
401 | - case mir_window_state_vertmaximized: |
402 | - new_pos.y = surface->top_left().y; |
403 | - new_size.height = surface->size().height; |
404 | - break; |
405 | - |
406 | - // "A horizontally maximised surface is anchored to the left and right of |
407 | - // the available workspace and can have any height" |
408 | - case mir_window_state_horizmaximized: |
409 | - new_pos.x = surface->top_left().x; |
410 | - new_size.width = surface->size().width; |
411 | - break; |
412 | - |
413 | - // "A maximised surface is anchored to the top, bottom, left and right of the |
414 | - // available workspace. For example, if the launcher is always-visible then |
415 | - // the left-edge of the surface is anchored to the right-edge of the launcher." |
416 | - case mir_window_state_maximized: |
417 | - default: |
418 | - new_pos.x = surface->top_left().x; |
419 | - new_pos.y = surface->top_left().y; |
420 | - new_size.width = surface->size().width; |
421 | - new_size.height = surface->size().height; |
422 | - break; |
423 | - } |
424 | - |
425 | - requested_pos = new_pos; |
426 | - requested_size = new_size; |
427 | -} |
428 | - |
429 | -bool me::SurfaceInfo::needs_titlebar(MirWindowType type) |
430 | -{ |
431 | - switch (type) |
432 | - { |
433 | - case mir_window_type_freestyle: |
434 | - case mir_window_type_menu: |
435 | - case mir_window_type_inputmethod: |
436 | - case mir_window_type_gloss: |
437 | - case mir_window_type_tip: |
438 | - // No decorations for these surface types |
439 | - return false; |
440 | - default: |
441 | - return true; |
442 | - } |
443 | -} |
444 | |
445 | === removed file 'examples/server_example_window_management_info.h' |
446 | --- examples/server_example_window_management_info.h 2017-01-18 02:29:37 +0000 |
447 | +++ examples/server_example_window_management_info.h 1970-01-01 00:00:00 +0000 |
448 | @@ -1,105 +0,0 @@ |
449 | -/* |
450 | - * Copyright © 2015 Canonical Ltd. |
451 | - * |
452 | - * This program is free software: you can redistribute it and/or modify it |
453 | - * under the terms of the GNU General Public License version 3, |
454 | - * as published by the Free Software Foundation. |
455 | - * |
456 | - * This program is distributed in the hope that it will be useful, |
457 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
458 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
459 | - * GNU General Public License for more details. |
460 | - * |
461 | - * You should have received a copy of the GNU General Public License |
462 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
463 | - * |
464 | - * Authored by: Alan Griffiths <alan@octopull.co.uk> |
465 | - */ |
466 | - |
467 | -#ifndef MIR_SERVER_EXAMPLE_WINDOW_MANAGEMENT_INFO_H |
468 | -#define MIR_SERVER_EXAMPLE_WINDOW_MANAGEMENT_INFO_H |
469 | - |
470 | -#include "mir/geometry/rectangles.h" |
471 | -#include "mir/optional_value.h" |
472 | -#include "mir/shell/surface_specification.h" |
473 | - |
474 | -#include <vector> |
475 | - |
476 | -namespace mir |
477 | -{ |
478 | -namespace scene { class Session; class Surface; class SurfaceCreationParameters; } |
479 | -namespace examples |
480 | -{ |
481 | -struct SurfaceInfo |
482 | -{ |
483 | - SurfaceInfo( |
484 | - std::shared_ptr <scene::Session> const& session, |
485 | - std::shared_ptr <scene::Surface> const& surface, |
486 | - scene::SurfaceCreationParameters const& params); |
487 | - |
488 | - bool can_be_active() const; |
489 | - |
490 | - bool can_morph_to(MirWindowType new_type) const; |
491 | - |
492 | - bool must_have_parent() const; |
493 | - |
494 | - bool must_not_have_parent() const; |
495 | - |
496 | - bool is_visible() const; |
497 | - |
498 | - static bool needs_titlebar(MirWindowType type); |
499 | - |
500 | - void constrain_resize( |
501 | - std::shared_ptr <scene::Surface> const& surface, |
502 | - geometry::Point& requested_pos, |
503 | - geometry::Size& requested_size, |
504 | - const bool left_resize, |
505 | - const bool top_resize, |
506 | - geometry::Rectangle const& bounds) const; |
507 | - |
508 | - MirWindowType type; |
509 | - MirWindowState state; |
510 | - geometry::Rectangle restore_rect; |
511 | - std::weak_ptr <scene::Session> session; |
512 | - std::weak_ptr <scene::Surface> parent; |
513 | - std::vector <std::weak_ptr<scene::Surface>> children; |
514 | - std::shared_ptr <scene::Surface> titlebar; |
515 | - frontend::SurfaceId titlebar_id; |
516 | - frontend::BufferStreamId titlebar_stream_id; |
517 | - bool is_titlebar = false; |
518 | - geometry::Width min_width; |
519 | - geometry::Height min_height; |
520 | - geometry::Width max_width; |
521 | - geometry::Height max_height; |
522 | - mir::optional_value<geometry::DeltaX> width_inc; |
523 | - mir::optional_value<geometry::DeltaY> height_inc; |
524 | - mir::optional_value<shell::SurfaceAspectRatio> min_aspect; |
525 | - mir::optional_value<shell::SurfaceAspectRatio> max_aspect; |
526 | - mir::optional_value<graphics::DisplayConfigurationOutputId> output_id; |
527 | - |
528 | - void init_titlebar( |
529 | - std::shared_ptr<scene::Session> const& session, |
530 | - std::shared_ptr<scene::Surface> const& surface); |
531 | - |
532 | - void paint_titlebar(int intensity); |
533 | - |
534 | -private: |
535 | - |
536 | - struct StreamPainter; |
537 | - struct AllocatingPainter; |
538 | - |
539 | - std::shared_ptr <StreamPainter> stream_painter; |
540 | -}; |
541 | - |
542 | -struct SessionInfo |
543 | -{ |
544 | - std::vector<std::weak_ptr<scene::Surface>> surfaces; |
545 | - |
546 | - // This is only used by the TilingWindowManagerPolicy, |
547 | - // perhaps we need a more extensible mechanism. (std::experimental::any?) |
548 | - geometry::Rectangle tile; |
549 | -}; |
550 | -} |
551 | -} |
552 | - |
553 | -#endif //MIR_SERVER_EXAMPLE_WINDOW_MANAGEMENT_INFO_H |
554 | |
555 | === modified file 'include/server/mir/shell/abstract_shell.h' |
556 | --- include/server/mir/shell/abstract_shell.h 2017-03-09 17:42:58 +0000 |
557 | +++ include/server/mir/shell/abstract_shell.h 2017-04-04 10:15:32 +0000 |
558 | @@ -87,6 +87,11 @@ |
559 | std::shared_ptr<scene::Surface> const& surface, |
560 | uint64_t timestamp) override; |
561 | |
562 | + void request_move( |
563 | + std::shared_ptr<scene::Session> const& session, |
564 | + std::shared_ptr<scene::Surface> const& surface, |
565 | + uint64_t timestamp) override; |
566 | + |
567 | std::shared_ptr<scene::PromptSession> start_prompt_session_for( |
568 | std::shared_ptr<scene::Session> const& session, |
569 | scene::PromptSessionCreationParameters const& params) override; |
570 | |
571 | === renamed file 'src/include/server/mir/shell/basic_window_manager.h' => 'include/server/mir/shell/basic_window_manager.h' |
572 | --- src/include/server/mir/shell/basic_window_manager.h 2017-03-09 17:49:01 +0000 |
573 | +++ include/server/mir/shell/basic_window_manager.h 2017-04-04 10:15:32 +0000 |
574 | @@ -130,6 +130,8 @@ |
575 | shell::FocusController* focus_controller, |
576 | std::unique_ptr<WindowManagementPolicy> policy); |
577 | |
578 | + ~BasicWindowManager(); |
579 | + |
580 | public: |
581 | using typename WindowManagerTools::SurfaceInfoMap; |
582 | using typename WindowManagerTools::SessionInfoMap; |
583 | @@ -175,6 +177,11 @@ |
584 | std::shared_ptr<scene::Surface> const& surface, |
585 | uint64_t timestamp) override; |
586 | |
587 | + void handle_request_move( |
588 | + std::shared_ptr<scene::Session> const& session, |
589 | + std::shared_ptr<scene::Surface> const& surface, |
590 | + uint64_t timestamp) override; |
591 | + |
592 | int set_surface_attribute( |
593 | std::shared_ptr<scene::Session> const& /*session*/, |
594 | std::shared_ptr<scene::Surface> const& surface, |
595 | @@ -217,12 +224,16 @@ |
596 | geometry::Rectangles displays; |
597 | geometry::Point cursor; |
598 | uint64_t last_input_event_timestamp{0}; |
599 | + MirEvent const* last_input_event{nullptr}; |
600 | |
601 | void update_event_timestamp(MirKeyboardEvent const* kev); |
602 | void update_event_timestamp(MirPointerEvent const* pev); |
603 | void update_event_timestamp(MirTouchEvent const* tev); |
604 | -}; |
605 | + void update_event_timestamp(MirInputEvent const* iev); |
606 | +} __attribute__((deprecated("Use libmiral instead"))); |
607 | |
608 | +#pragma GCC diagnostic push |
609 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
610 | /// A policy based window manager. This exists to initialize BasicWindowManager and |
611 | /// the WMPolicy (in an awkward manner). |
612 | /// TODO revisit this initialization sequence. |
613 | @@ -249,7 +260,8 @@ |
614 | return std::unique_ptr<WMPolicy>( |
615 | new WMPolicy(this, std::forward<PolicyArgs>(policy_args)...)); |
616 | } |
617 | -}; |
618 | +} __attribute__((deprecated("Use libmiral instead"))); |
619 | +#pragma GCC diagnostic pop |
620 | } |
621 | } |
622 | |
623 | |
624 | === renamed file 'src/include/server/mir/shell/canonical_window_manager.h' => 'include/server/mir/shell/canonical_window_manager.h' |
625 | --- src/include/server/mir/shell/canonical_window_manager.h 2017-03-08 16:16:44 +0000 |
626 | +++ include/server/mir/shell/canonical_window_manager.h 2017-04-04 10:15:32 +0000 |
627 | @@ -19,7 +19,7 @@ |
628 | #ifndef MIR_SHELL_CANONICAL_WINDOW_MANAGER_H_ |
629 | #define MIR_SHELL_CANONICAL_WINDOW_MANAGER_H_ |
630 | |
631 | -#include "basic_window_manager.h" |
632 | +#include "mir/shell/basic_window_manager.h" |
633 | |
634 | #include "mir/geometry/displacement.h" |
635 | |
636 | @@ -122,7 +122,11 @@ |
637 | std::weak_ptr<scene::Surface> active_surface_; |
638 | }; |
639 | |
640 | + |
641 | +#pragma GCC diagnostic push |
642 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
643 | using CanonicalWindowManager = WindowManagerConstructor<CanonicalWindowManagerPolicy>; |
644 | +#pragma GCC diagnostic pop |
645 | } |
646 | } |
647 | |
648 | |
649 | === modified file 'include/server/mir/shell/shell.h' |
650 | --- include/server/mir/shell/shell.h 2017-03-08 12:34:11 +0000 |
651 | +++ include/server/mir/shell/shell.h 2017-04-04 10:15:32 +0000 |
652 | @@ -104,6 +104,11 @@ |
653 | std::shared_ptr<scene::Session> const& session, |
654 | std::shared_ptr<scene::Surface> const& surface, |
655 | uint64_t timestamp) = 0; |
656 | + |
657 | + virtual void request_move( |
658 | + std::shared_ptr<scene::Session> const& session, |
659 | + std::shared_ptr<scene::Surface> const& surface, |
660 | + uint64_t timestamp) = 0; |
661 | /** @} */ |
662 | }; |
663 | } |
664 | |
665 | === modified file 'include/server/mir/shell/shell_wrapper.h' |
666 | --- include/server/mir/shell/shell_wrapper.h 2017-03-09 17:42:58 +0000 |
667 | +++ include/server/mir/shell/shell_wrapper.h 2017-04-04 10:15:32 +0000 |
668 | @@ -90,6 +90,11 @@ |
669 | std::shared_ptr<scene::Surface> const& surface, |
670 | uint64_t timestamp) override; |
671 | |
672 | + void request_move( |
673 | + std::shared_ptr<scene::Session> const& session, |
674 | + std::shared_ptr<scene::Surface> const& surface, |
675 | + uint64_t timestamp) override; |
676 | + |
677 | void add_display(geometry::Rectangle const& area) override; |
678 | void remove_display(geometry::Rectangle const& area) override; |
679 | |
680 | |
681 | === modified file 'include/server/mir/shell/system_compositor_window_manager.h' |
682 | --- include/server/mir/shell/system_compositor_window_manager.h 2017-03-08 12:59:36 +0000 |
683 | +++ include/server/mir/shell/system_compositor_window_manager.h 2017-04-04 10:15:32 +0000 |
684 | @@ -100,6 +100,11 @@ |
685 | std::shared_ptr<scene::Surface> const& surface, |
686 | uint64_t timestamp) override; |
687 | |
688 | + void handle_request_move( |
689 | + std::shared_ptr<scene::Session> const& session, |
690 | + std::shared_ptr<scene::Surface> const& surface, |
691 | + uint64_t timestamp) override; |
692 | + |
693 | int set_surface_attribute( |
694 | std::shared_ptr<scene::Session> const& session, |
695 | std::shared_ptr<scene::Surface> const& surface, |
696 | |
697 | === renamed file 'src/include/server/mir/shell/window_management_info.h' => 'include/server/mir/shell/window_management_info.h' |
698 | --- src/include/server/mir/shell/window_management_info.h 2017-01-18 02:29:37 +0000 |
699 | +++ include/server/mir/shell/window_management_info.h 2017-04-04 10:15:32 +0000 |
700 | @@ -27,7 +27,7 @@ |
701 | |
702 | namespace mir |
703 | { |
704 | -namespace scene { class Session; class Surface; class SurfaceCreationParameters; } |
705 | +namespace scene { class Session; class Surface; struct SurfaceCreationParameters; } |
706 | namespace shell |
707 | { |
708 | struct SurfaceInfo |
709 | @@ -65,6 +65,7 @@ |
710 | std::vector <std::weak_ptr<scene::Surface>> children; |
711 | std::shared_ptr <scene::Surface> titlebar; |
712 | frontend::SurfaceId titlebar_id; |
713 | + frontend::BufferStreamId titlebar_stream_id; |
714 | bool is_titlebar = false; |
715 | geometry::Width min_width; |
716 | geometry::Height min_height; |
717 | @@ -77,8 +78,7 @@ |
718 | mir::optional_value<graphics::DisplayConfigurationOutputId> output_id; |
719 | mir::optional_value<MirPointerConfinementState> confine_pointer; |
720 | |
721 | - void init_titlebar(std::shared_ptr <scene::Surface> const& surface); |
722 | - |
723 | + void init_titlebar(std::shared_ptr<scene::Session> const& session, std::shared_ptr<scene::Surface> const& surface); |
724 | void paint_titlebar(int intensity); |
725 | |
726 | private: |
727 | |
728 | === modified file 'include/server/mir/shell/window_manager.h' |
729 | --- include/server/mir/shell/window_manager.h 2017-03-08 12:59:36 +0000 |
730 | +++ include/server/mir/shell/window_manager.h 2017-04-04 10:15:32 +0000 |
731 | @@ -81,6 +81,11 @@ |
732 | std::shared_ptr<scene::Surface> const& surface, |
733 | uint64_t timestamp) = 0; |
734 | |
735 | + virtual void handle_request_move( |
736 | + std::shared_ptr<scene::Session> const& session, |
737 | + std::shared_ptr<scene::Surface> const& surface, |
738 | + uint64_t timestamp) = 0; |
739 | + |
740 | virtual ~WindowManager() = default; |
741 | WindowManager() = default; |
742 | WindowManager(WindowManager const&) = delete; |
743 | |
744 | === modified file 'include/test/mir/test/doubles/mock_window_manager.h' |
745 | --- include/test/mir/test/doubles/mock_window_manager.h 2017-03-08 12:59:36 +0000 |
746 | +++ include/test/mir/test/doubles/mock_window_manager.h 2017-04-04 10:15:32 +0000 |
747 | @@ -59,6 +59,7 @@ |
748 | |
749 | MOCK_METHOD3(handle_raise_surface, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t)); |
750 | MOCK_METHOD3(handle_request_drag_and_drop, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t)); |
751 | + MOCK_METHOD3(handle_request_move, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t)); |
752 | |
753 | MOCK_METHOD4(set_surface_attribute, |
754 | int(std::shared_ptr<scene::Session> const& session, |
755 | |
756 | === modified file 'src/include/server/mir/frontend/shell.h' |
757 | --- src/include/server/mir/frontend/shell.h 2017-03-08 12:34:11 +0000 |
758 | +++ src/include/server/mir/frontend/shell.h 2017-04-04 10:15:32 +0000 |
759 | @@ -82,15 +82,17 @@ |
760 | SurfaceId surface_id, |
761 | MirWindowAttrib attrib) = 0; |
762 | |
763 | - virtual void raise_surface( |
764 | - std::shared_ptr<Session> const& session, |
765 | - SurfaceId surface_id, |
766 | - uint64_t timestamp) = 0; |
767 | + enum class UserRequest |
768 | + { |
769 | + drag_and_drop, |
770 | + move, |
771 | + activate, |
772 | + }; |
773 | |
774 | - virtual void request_drag_and_drop( |
775 | + virtual void request_operation( |
776 | std::shared_ptr<Session> const& session, |
777 | - SurfaceId surface_id, |
778 | - uint64_t timestamp) = 0; |
779 | + SurfaceId surface_id, uint64_t timestamp, |
780 | + UserRequest request) = 0; |
781 | |
782 | protected: |
783 | Shell() = default; |
784 | |
785 | === modified file 'src/server/CMakeLists.txt' |
786 | --- src/server/CMakeLists.txt 2017-03-14 05:30:56 +0000 |
787 | +++ src/server/CMakeLists.txt 2017-04-04 10:15:32 +0000 |
788 | @@ -11,6 +11,7 @@ |
789 | ${PROJECT_SOURCE_DIR}/include/server |
790 | ${PROJECT_SOURCE_DIR}/include/renderer |
791 | ${PROJECT_SOURCE_DIR}/include/renderers/gl |
792 | + ${PROJECT_SOURCE_DIR}/include/renderers/sw |
793 | ${PROJECT_SOURCE_DIR}/src/include/platform |
794 | ${PROJECT_SOURCE_DIR}/src/include/client |
795 | ${PROJECT_SOURCE_DIR}/src/include/server |
796 | |
797 | === modified file 'src/server/frontend/CMakeLists.txt' |
798 | --- src/server/frontend/CMakeLists.txt 2017-02-15 07:38:33 +0000 |
799 | +++ src/server/frontend/CMakeLists.txt 2017-04-04 10:15:32 +0000 |
800 | @@ -33,6 +33,7 @@ |
801 | screencast_buffer_tracker.cpp |
802 | session_mediator_observer_multiplexer.cpp |
803 | session_mediator_observer_multiplexer.h |
804 | + ${PROJECT_SOURCE_DIR}/src/include/server/mir/frontend/shell.h |
805 | ) |
806 | |
807 | add_library( |
808 | |
809 | === modified file 'src/server/frontend/session_mediator.cpp' |
810 | --- src/server/frontend/session_mediator.cpp 2017-04-04 07:04:57 +0000 |
811 | +++ src/server/frontend/session_mediator.cpp 2017-04-04 10:15:32 +0000 |
812 | @@ -1180,11 +1180,24 @@ |
813 | switch (request->operation()) |
814 | { |
815 | case mir::protobuf::RequestOperation::START_DRAG_AND_DROP: |
816 | - shell->request_drag_and_drop(session, mf::SurfaceId{surface_id.value()}, cookie_ptr->timestamp()); |
817 | + shell->request_operation( |
818 | + session, mf::SurfaceId{surface_id.value()}, |
819 | + cookie_ptr->timestamp(), |
820 | + Shell::UserRequest::drag_and_drop); |
821 | break; |
822 | |
823 | case mir::protobuf::RequestOperation::MAKE_ACTIVE: |
824 | - shell->raise_surface(session, mf::SurfaceId{surface_id.value()}, cookie_ptr->timestamp()); |
825 | + shell->request_operation( |
826 | + session, mf::SurfaceId{surface_id.value()}, |
827 | + cookie_ptr->timestamp(), |
828 | + Shell::UserRequest::activate); |
829 | + break; |
830 | + |
831 | + case mir::protobuf::RequestOperation::USER_MOVE: |
832 | + shell->request_operation( |
833 | + session, mf::SurfaceId{surface_id.value()}, |
834 | + cookie_ptr->timestamp(), |
835 | + Shell::UserRequest::move); |
836 | break; |
837 | |
838 | default: |
839 | |
840 | === modified file 'src/server/frontend/shell_wrapper.cpp' |
841 | --- src/server/frontend/shell_wrapper.cpp 2017-03-08 12:34:11 +0000 |
842 | +++ src/server/frontend/shell_wrapper.cpp 2017-04-04 10:15:32 +0000 |
843 | @@ -99,18 +99,8 @@ |
844 | return wrapped->get_surface_attribute(session, surface_id, attrib); |
845 | } |
846 | |
847 | -void mf::ShellWrapper::raise_surface( |
848 | - std::shared_ptr<Session> const& session, |
849 | - SurfaceId surface_id, |
850 | - uint64_t timestamp) |
851 | -{ |
852 | - wrapped->raise_surface(session, surface_id, timestamp); |
853 | -} |
854 | - |
855 | -void mf::ShellWrapper::request_drag_and_drop( |
856 | - std::shared_ptr<Session> const& session, |
857 | - SurfaceId surface_id, |
858 | - uint64_t timestamp) |
859 | -{ |
860 | - wrapped->request_drag_and_drop(session, surface_id, timestamp); |
861 | +void mf::ShellWrapper::request_operation( |
862 | + std::shared_ptr<Session> const& session, SurfaceId surface_id, uint64_t timestamp, UserRequest request) |
863 | +{ |
864 | + wrapped->request_operation(session, surface_id, timestamp, request); |
865 | } |
866 | |
867 | === modified file 'src/server/frontend/shell_wrapper.h' |
868 | --- src/server/frontend/shell_wrapper.h 2017-03-08 12:34:11 +0000 |
869 | +++ src/server/frontend/shell_wrapper.h 2017-04-04 10:15:32 +0000 |
870 | @@ -75,15 +75,11 @@ |
871 | SurfaceId surface_id, |
872 | MirWindowAttrib attrib) override; |
873 | |
874 | - void raise_surface( |
875 | - std::shared_ptr<Session> const& session, |
876 | - SurfaceId surface_id, |
877 | - uint64_t timestamp) override; |
878 | - |
879 | - void request_drag_and_drop( |
880 | - std::shared_ptr<Session> const& session, |
881 | - SurfaceId surface_id, |
882 | - uint64_t timestamp) override; |
883 | + void request_operation( |
884 | + std::shared_ptr<Session> const& session, |
885 | + SurfaceId surface_id, |
886 | + uint64_t timestamp, |
887 | + UserRequest request) override; |
888 | |
889 | protected: |
890 | std::shared_ptr<Shell> const wrapped; |
891 | |
892 | === modified file 'src/server/shell/CMakeLists.txt' |
893 | --- src/server/shell/CMakeLists.txt 2017-01-18 02:29:37 +0000 |
894 | +++ src/server/shell/CMakeLists.txt 2017-04-04 10:15:32 +0000 |
895 | @@ -2,8 +2,8 @@ |
896 | SHELL_SOURCES |
897 | |
898 | abstract_shell.cpp |
899 | - basic_window_manager.cpp ${CMAKE_SOURCE_DIR}/src/include/server/mir/shell/basic_window_manager.h |
900 | - canonical_window_manager.cpp ${CMAKE_SOURCE_DIR}/src/include/server/mir/shell/canonical_window_manager.h |
901 | + basic_window_manager.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/basic_window_manager.h |
902 | + canonical_window_manager.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/canonical_window_manager.h |
903 | frontend_shell.cpp |
904 | graphics_display_layout.cpp |
905 | graphics_display_layout.h |
906 | @@ -17,7 +17,7 @@ |
907 | ${CMAKE_SOURCE_DIR}/include/server/mir/shell/display_configuration_controller.h |
908 | surface_specification.cpp |
909 | surface_stack_wrapper.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/surface_stack_wrapper.h |
910 | - window_management_info.cpp ${CMAKE_SOURCE_DIR}/src/include/server/mir/shell/window_management_info.h |
911 | + window_management_info.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/window_management_info.h |
912 | ) |
913 | |
914 | add_library( |
915 | |
916 | === modified file 'src/server/shell/abstract_shell.cpp' |
917 | --- src/server/shell/abstract_shell.cpp 2017-03-28 18:02:49 +0000 |
918 | +++ src/server/shell/abstract_shell.cpp 2017-04-04 10:15:32 +0000 |
919 | @@ -266,6 +266,14 @@ |
920 | window_manager->handle_request_drag_and_drop(session, surface, timestamp); |
921 | } |
922 | |
923 | +void msh::AbstractShell::request_move( |
924 | + std::shared_ptr<scene::Session> const& session, |
925 | + std::shared_ptr<scene::Surface> const& surface, |
926 | + uint64_t timestamp) |
927 | +{ |
928 | + window_manager->handle_request_move(session, surface, timestamp); |
929 | +} |
930 | + |
931 | void msh::AbstractShell::focus_next_session() |
932 | { |
933 | std::unique_lock<std::mutex> lock(focus_mutex); |
934 | |
935 | === modified file 'src/server/shell/basic_window_manager.cpp' |
936 | --- src/server/shell/basic_window_manager.cpp 2017-03-09 17:49:01 +0000 |
937 | +++ src/server/shell/basic_window_manager.cpp 2017-04-04 10:15:32 +0000 |
938 | @@ -32,6 +32,12 @@ |
939 | { |
940 | } |
941 | |
942 | +msh::BasicWindowManager::~BasicWindowManager() |
943 | +{ |
944 | + if (last_input_event) |
945 | + mir_event_unref(last_input_event); |
946 | +} |
947 | + |
948 | void msh::BasicWindowManager::add_session(std::shared_ptr<scene::Session> const& session) |
949 | { |
950 | std::lock_guard<decltype(mutex)> lock(mutex); |
951 | @@ -145,6 +151,21 @@ |
952 | policy->handle_request_drag_and_drop(session, surface); |
953 | } |
954 | |
955 | +void msh::BasicWindowManager::handle_request_move( |
956 | + std::shared_ptr<scene::Session> const& session, |
957 | + std::shared_ptr<scene::Surface> const& surface, |
958 | + uint64_t timestamp) |
959 | +{ |
960 | + std::lock_guard<decltype(mutex)> lock(mutex); |
961 | + if (timestamp >= last_input_event_timestamp) |
962 | + { |
963 | + // When we reintegrate with miral::BasicWindowManager this is where we |
964 | + // will ask the policy to to handle the move. |
965 | + (void)session; |
966 | + (void)surface; |
967 | + } |
968 | +} |
969 | + |
970 | int msh::BasicWindowManager::set_surface_attribute( |
971 | std::shared_ptr<scene::Session> const& /*session*/, |
972 | std::shared_ptr<scene::Surface> const& surface, |
973 | @@ -288,25 +309,22 @@ |
974 | |
975 | void msh::BasicWindowManager::update_event_timestamp(MirKeyboardEvent const* kev) |
976 | { |
977 | - auto iev = mir_keyboard_event_input_event(kev); |
978 | - last_input_event_timestamp = mir_input_event_get_event_time(iev); |
979 | + update_event_timestamp(mir_keyboard_event_input_event(kev)); |
980 | } |
981 | |
982 | void msh::BasicWindowManager::update_event_timestamp(MirPointerEvent const* pev) |
983 | { |
984 | - auto iev = mir_pointer_event_input_event(pev); |
985 | auto pointer_action = mir_pointer_event_action(pev); |
986 | |
987 | if (pointer_action == mir_pointer_action_button_up || |
988 | pointer_action == mir_pointer_action_button_down) |
989 | { |
990 | - last_input_event_timestamp = mir_input_event_get_event_time(iev); |
991 | + update_event_timestamp(mir_pointer_event_input_event(pev)); |
992 | } |
993 | } |
994 | |
995 | void msh::BasicWindowManager::update_event_timestamp(MirTouchEvent const* tev) |
996 | { |
997 | - auto iev = mir_touch_event_input_event(tev); |
998 | auto touch_count = mir_touch_event_point_count(tev); |
999 | for (unsigned i = 0; i < touch_count; i++) |
1000 | { |
1001 | @@ -314,12 +332,20 @@ |
1002 | if (touch_action == mir_touch_action_up || |
1003 | touch_action == mir_touch_action_down) |
1004 | { |
1005 | - last_input_event_timestamp = mir_input_event_get_event_time(iev); |
1006 | + update_event_timestamp(mir_touch_event_input_event(tev)); |
1007 | break; |
1008 | } |
1009 | } |
1010 | } |
1011 | |
1012 | +void msh::BasicWindowManager::update_event_timestamp(MirInputEvent const* iev) |
1013 | +{ |
1014 | + last_input_event_timestamp = mir_input_event_get_event_time(iev); |
1015 | + if (last_input_event) |
1016 | + mir_event_unref(last_input_event); |
1017 | + last_input_event = mir_event_ref(mir_input_event_get_event(iev)); |
1018 | +} |
1019 | + |
1020 | void mir::shell::BasicWindowManager::set_drag_and_drop_handle(std::vector<uint8_t> const& handle) |
1021 | { |
1022 | focus_controller->set_drag_and_drop_handle(handle); |
1023 | |
1024 | === modified file 'src/server/shell/frontend_shell.cpp' |
1025 | --- src/server/shell/frontend_shell.cpp 2017-03-08 12:34:11 +0000 |
1026 | +++ src/server/shell/frontend_shell.cpp 2017-04-04 10:15:32 +0000 |
1027 | @@ -148,22 +148,34 @@ |
1028 | return wrapped->get_surface_attribute(surface, attrib); |
1029 | } |
1030 | |
1031 | -void msh::FrontendShell::raise_surface( |
1032 | - std::shared_ptr<mf::Session> const& session, |
1033 | - mf::SurfaceId surface_id, |
1034 | - uint64_t timestamp) |
1035 | -{ |
1036 | - auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session); |
1037 | - auto const surface = scene_session->surface(surface_id); |
1038 | - wrapped->raise_surface(scene_session, surface, timestamp); |
1039 | -} |
1040 | - |
1041 | -void msh::FrontendShell::request_drag_and_drop( |
1042 | - std::shared_ptr<mf::Session> const& session, |
1043 | - mf::SurfaceId surface_id, |
1044 | - uint64_t timestamp) |
1045 | -{ |
1046 | - auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session); |
1047 | - auto const surface = scene_session->surface(surface_id); |
1048 | - wrapped->request_drag_and_drop(scene_session, surface, timestamp); |
1049 | +void msh::FrontendShell::request_operation( |
1050 | + std::shared_ptr<mf::Session> const& session, |
1051 | + mf::SurfaceId surface_id, |
1052 | + uint64_t timestamp, |
1053 | + UserRequest request) |
1054 | +{ |
1055 | + auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session); |
1056 | + auto const surface = scene_session->surface(surface_id); |
1057 | + |
1058 | + switch (request) |
1059 | + { |
1060 | + case UserRequest::activate: |
1061 | + { |
1062 | + auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session); |
1063 | + auto const surface = scene_session->surface(surface_id); |
1064 | + wrapped->raise_surface(scene_session, surface, timestamp); |
1065 | + break; |
1066 | + } |
1067 | + |
1068 | + case UserRequest::drag_and_drop: |
1069 | + wrapped->request_drag_and_drop(scene_session, surface, timestamp); |
1070 | + break; |
1071 | + |
1072 | + case UserRequest::move: |
1073 | + wrapped->request_move(scene_session, surface, timestamp); |
1074 | + break; |
1075 | + |
1076 | + default: |
1077 | + break; |
1078 | + } |
1079 | } |
1080 | |
1081 | === modified file 'src/server/shell/frontend_shell.h' |
1082 | --- src/server/shell/frontend_shell.h 2017-03-08 12:34:11 +0000 |
1083 | +++ src/server/shell/frontend_shell.h 2017-04-04 10:15:32 +0000 |
1084 | @@ -87,15 +87,11 @@ |
1085 | mf::SurfaceId surface_id, |
1086 | MirWindowAttrib attrib) override; |
1087 | |
1088 | - void raise_surface( |
1089 | - std::shared_ptr<mf::Session> const& session, |
1090 | - mf::SurfaceId surface_id, |
1091 | - uint64_t timestamp) override; |
1092 | - |
1093 | - void request_drag_and_drop( |
1094 | - std::shared_ptr<mf::Session> const& session, |
1095 | - mf::SurfaceId surface_id, |
1096 | - uint64_t timestamp) override; |
1097 | + void request_operation( |
1098 | + std::shared_ptr<mf::Session> const& session, |
1099 | + mf::SurfaceId surface_id, |
1100 | + uint64_t timestamp, |
1101 | + UserRequest request) override; |
1102 | }; |
1103 | } |
1104 | } |
1105 | |
1106 | === modified file 'src/server/shell/shell_wrapper.cpp' |
1107 | --- src/server/shell/shell_wrapper.cpp 2017-03-10 14:27:50 +0000 |
1108 | +++ src/server/shell/shell_wrapper.cpp 2017-04-04 10:15:32 +0000 |
1109 | @@ -128,6 +128,14 @@ |
1110 | wrapped->request_drag_and_drop(session, surface, timestamp); |
1111 | } |
1112 | |
1113 | +void msh::ShellWrapper::request_move( |
1114 | + std::shared_ptr<ms::Session> const& session, |
1115 | + std::shared_ptr<ms::Surface> const& surface, |
1116 | + uint64_t timestamp) |
1117 | +{ |
1118 | + wrapped->request_move(session, surface, timestamp); |
1119 | +} |
1120 | + |
1121 | void msh::ShellWrapper::add_display(geometry::Rectangle const& area) |
1122 | { |
1123 | wrapped->add_display(area); |
1124 | |
1125 | === modified file 'src/server/shell/system_compositor_window_manager.cpp' |
1126 | --- src/server/shell/system_compositor_window_manager.cpp 2017-03-08 12:59:36 +0000 |
1127 | +++ src/server/shell/system_compositor_window_manager.cpp 2017-04-04 10:15:32 +0000 |
1128 | @@ -208,3 +208,10 @@ |
1129 | uint64_t /*timestamp*/) |
1130 | { |
1131 | } |
1132 | + |
1133 | +void msh::SystemCompositorWindowManager::handle_request_move( |
1134 | + std::shared_ptr<ms::Session> const& /*session*/, |
1135 | + std::shared_ptr<ms::Surface> const& /*surface*/, |
1136 | + uint64_t /*timestamp*/) |
1137 | +{ |
1138 | +} |
1139 | |
1140 | === modified file 'src/server/shell/window_management_info.cpp' |
1141 | --- src/server/shell/window_management_info.cpp 2017-01-18 02:29:37 +0000 |
1142 | +++ src/server/shell/window_management_info.cpp 2017-04-04 10:15:32 +0000 |
1143 | @@ -18,13 +18,16 @@ |
1144 | |
1145 | #include "mir/shell/window_management_info.h" |
1146 | |
1147 | +#include "mir/scene/session.h" |
1148 | #include "mir/scene/surface.h" |
1149 | #include "mir/scene/surface_creation_parameters.h" |
1150 | |
1151 | #include "mir/graphics/buffer.h" |
1152 | +#include "mir/renderer/sw/pixel_source.h" |
1153 | |
1154 | #include <atomic> |
1155 | |
1156 | +namespace mrs = mir::renderer::software; |
1157 | namespace msh = mir::shell; |
1158 | namespace ms = mir::scene; |
1159 | namespace mg = mir::graphics; |
1160 | @@ -156,6 +159,75 @@ |
1161 | return true; |
1162 | } |
1163 | |
1164 | +struct msh::SurfaceInfo::StreamPainter |
1165 | +{ |
1166 | + virtual void paint(int) = 0; |
1167 | + virtual ~StreamPainter() = default; |
1168 | + StreamPainter() = default; |
1169 | + StreamPainter(StreamPainter const&) = delete; |
1170 | + StreamPainter& operator=(StreamPainter const&) = delete; |
1171 | +}; |
1172 | + |
1173 | +struct msh::SurfaceInfo::AllocatingPainter |
1174 | + : msh::SurfaceInfo::StreamPainter |
1175 | +{ |
1176 | + AllocatingPainter( |
1177 | + std::shared_ptr<frontend::BufferStream> const& buffer_stream, |
1178 | + std::shared_ptr<scene::Session> const& session, |
1179 | + Size size) : |
1180 | + buffer_stream(buffer_stream), |
1181 | + session(session), |
1182 | + properties({ |
1183 | + size, |
1184 | + buffer_stream->pixel_format(), |
1185 | + mg::BufferUsage::software |
1186 | + }), |
1187 | + front_buffer(session->create_buffer(properties)), |
1188 | + back_buffer(session->create_buffer(properties)) |
1189 | + { |
1190 | + } |
1191 | + |
1192 | + void paint(int intensity) override |
1193 | + { |
1194 | + auto buffer = session->get_buffer(back_buffer); |
1195 | + |
1196 | + auto const format = buffer->pixel_format(); |
1197 | + auto const sz = buffer->size().height.as_int() * |
1198 | + buffer->size().width.as_int() * MIR_BYTES_PER_PIXEL(format); |
1199 | + std::vector<unsigned char> pixels(sz, intensity); |
1200 | + if (auto pixel_source = dynamic_cast<mrs::PixelSource*>(buffer->native_buffer_base())) |
1201 | + pixel_source->write(pixels.data(), sz); |
1202 | + buffer_stream->submit_buffer(buffer); |
1203 | + |
1204 | + std::swap(front_buffer, back_buffer); |
1205 | + } |
1206 | + |
1207 | + ~AllocatingPainter() |
1208 | + { |
1209 | + session->destroy_buffer(front_buffer); |
1210 | + session->destroy_buffer(back_buffer); |
1211 | + } |
1212 | + |
1213 | + std::shared_ptr<frontend::BufferStream> const buffer_stream; |
1214 | + std::shared_ptr<scene::Session> const session; |
1215 | + mg::BufferProperties properties; |
1216 | + mg::BufferID front_buffer; |
1217 | + mg::BufferID back_buffer; |
1218 | +}; |
1219 | + |
1220 | +void msh::SurfaceInfo::init_titlebar( |
1221 | + std::shared_ptr<scene::Session> const& session, |
1222 | + std::shared_ptr<scene::Surface> const& surface) |
1223 | +{ |
1224 | + auto stream = surface->primary_buffer_stream(); |
1225 | + stream_painter = std::make_shared<AllocatingPainter>(stream, session, surface->size()); |
1226 | +} |
1227 | + |
1228 | +void msh::SurfaceInfo::paint_titlebar(int intensity) |
1229 | +{ |
1230 | + stream_painter->paint(intensity); |
1231 | +} |
1232 | + |
1233 | void msh::SurfaceInfo::constrain_resize( |
1234 | std::shared_ptr<ms::Surface> const& surface, |
1235 | Point& requested_pos, |
1236 | |
1237 | === modified file 'src/server/symbols.map' |
1238 | --- src/server/symbols.map 2017-03-21 07:57:17 +0000 |
1239 | +++ src/server/symbols.map 2017-04-04 10:15:32 +0000 |
1240 | @@ -37,6 +37,7 @@ |
1241 | mir::frontend::BufferStream::operator*; |
1242 | mir::frontend::ClientBuffers::?ClientBuffers*; |
1243 | mir::frontend::ClientBuffers::ClientBuffers*; |
1244 | + mir::frontend::ClientBuffers::operator*; |
1245 | mir::frontend::PromptSession::operator*; |
1246 | mir::frontend::PromptSession::?PromptSession*; |
1247 | mir::frontend::PromptSession::PromptSession*; |
1248 | @@ -251,6 +252,7 @@ |
1249 | mir::shell::AbstractShell::AbstractShell*; |
1250 | mir::shell::AbstractShell::add_display*; |
1251 | mir::shell::AbstractShell::add_prompt_provider_for*; |
1252 | + mir::shell::AbstractShell::clear_drag_and_drop_handle*; |
1253 | mir::shell::AbstractShell::close_session*; |
1254 | mir::shell::AbstractShell::create_surface*; |
1255 | mir::shell::AbstractShell::destroy_surface*; |
1256 | @@ -264,12 +266,56 @@ |
1257 | mir::shell::AbstractShell::raise*; |
1258 | mir::shell::AbstractShell::raise_surface*; |
1259 | mir::shell::AbstractShell::remove_display*; |
1260 | + mir::shell::AbstractShell::request_drag_and_drop*; |
1261 | + mir::shell::AbstractShell::request_move*; |
1262 | + mir::shell::AbstractShell::set_drag_and_drop_handle*; |
1263 | mir::shell::AbstractShell::set_focus_to*; |
1264 | mir::shell::AbstractShell::set_surface_attribute*; |
1265 | mir::shell::AbstractShell::start_prompt_session_for*; |
1266 | mir::shell::AbstractShell::stop_prompt_session*; |
1267 | mir::shell::AbstractShell::surface_at*; |
1268 | mir::shell::AbstractShell::update_focused_surface_confined_region*; |
1269 | + mir::shell::BasicWindowManager::active_display*; |
1270 | + mir::shell::BasicWindowManager::add_display*; |
1271 | + mir::shell::BasicWindowManager::add_session*; |
1272 | + mir::shell::BasicWindowManager::add_surface*; |
1273 | + mir::shell::BasicWindowManager::?BasicWindowManager*; |
1274 | + mir::shell::BasicWindowManager::BasicWindowManager*; |
1275 | + mir::shell::BasicWindowManager::clear_drag_and_drop_handle*; |
1276 | + mir::shell::BasicWindowManager::find_session*; |
1277 | + mir::shell::BasicWindowManager::focused_session*; |
1278 | + mir::shell::BasicWindowManager::focused_surface*; |
1279 | + mir::shell::BasicWindowManager::focus_next_session*; |
1280 | + mir::shell::BasicWindowManager::forget*; |
1281 | + mir::shell::BasicWindowManager::handle_keyboard_event*; |
1282 | + mir::shell::BasicWindowManager::handle_pointer_event*; |
1283 | + mir::shell::BasicWindowManager::handle_raise_surface*; |
1284 | + mir::shell::BasicWindowManager::handle_request_drag_and_drop*; |
1285 | + mir::shell::BasicWindowManager::handle_request_move*; |
1286 | + mir::shell::BasicWindowManager::handle_touch_event*; |
1287 | + mir::shell::BasicWindowManager::info_for*; |
1288 | + mir::shell::BasicWindowManager::modify_surface*; |
1289 | + mir::shell::BasicWindowManager::raise_tree*; |
1290 | + mir::shell::BasicWindowManager::remove_display*; |
1291 | + mir::shell::BasicWindowManager::remove_session*; |
1292 | + mir::shell::BasicWindowManager::remove_surface*; |
1293 | + mir::shell::BasicWindowManager::set_drag_and_drop_handle*; |
1294 | + mir::shell::BasicWindowManager::set_focus_to*; |
1295 | + mir::shell::BasicWindowManager::set_surface_attribute*; |
1296 | + mir::shell::BasicWindowManager::surface_at*; |
1297 | + mir::shell::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy*; |
1298 | + mir::shell::CanonicalWindowManagerPolicy::handle_delete_surface*; |
1299 | + mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*; |
1300 | + mir::shell::CanonicalWindowManagerPolicy::handle_keyboard_event*; |
1301 | + mir::shell::CanonicalWindowManagerPolicy::handle_modify_surface*; |
1302 | + mir::shell::CanonicalWindowManagerPolicy::handle_new_surface*; |
1303 | + mir::shell::CanonicalWindowManagerPolicy::handle_place_new_surface*; |
1304 | + mir::shell::CanonicalWindowManagerPolicy::handle_pointer_event*; |
1305 | + mir::shell::CanonicalWindowManagerPolicy::handle_raise_surface*; |
1306 | + mir::shell::CanonicalWindowManagerPolicy::handle_request_drag_and_drop*; |
1307 | + mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*; |
1308 | + mir::shell::CanonicalWindowManagerPolicy::handle_set_state*; |
1309 | + mir::shell::CanonicalWindowManagerPolicy::handle_touch_event*; |
1310 | mir::shell::DisplayConfigurationController::?DisplayConfigurationController*; |
1311 | mir::shell::DisplayConfigurationController::DisplayConfigurationController*; |
1312 | mir::shell::DisplayConfigurationController::operator*; |
1313 | @@ -309,13 +355,24 @@ |
1314 | mir::shell::ShellWrapper::raise_surface*; |
1315 | mir::shell::ShellWrapper::remove_display*; |
1316 | mir::shell::ShellWrapper::request_drag_and_drop*; |
1317 | + mir::shell::ShellWrapper::request_move*; |
1318 | + mir::shell::ShellWrapper::set_drag_and_drop_handle*; |
1319 | mir::shell::ShellWrapper::set_focus_to*; |
1320 | mir::shell::ShellWrapper::set_surface_attribute*; |
1321 | mir::shell::ShellWrapper::ShellWrapper*; |
1322 | - mir::shell::ShellWrapper::set_drag_and_drop_handle*; |
1323 | mir::shell::ShellWrapper::start_prompt_session_for*; |
1324 | mir::shell::ShellWrapper::stop_prompt_session*; |
1325 | mir::shell::ShellWrapper::surface_at*; |
1326 | + mir::shell::SurfaceInfo::can_be_active*; |
1327 | + mir::shell::SurfaceInfo::can_morph_to*; |
1328 | + mir::shell::SurfaceInfo::constrain_resize*; |
1329 | + mir::shell::SurfaceInfo::init_titlebar*; |
1330 | + mir::shell::SurfaceInfo::is_visible*; |
1331 | + mir::shell::SurfaceInfo::must_have_parent*; |
1332 | + mir::shell::SurfaceInfo::must_not_have_parent*; |
1333 | + mir::shell::SurfaceInfo::needs_titlebar*; |
1334 | + mir::shell::SurfaceInfo::paint_titlebar*; |
1335 | + mir::shell::SurfaceInfo::SurfaceInfo*; |
1336 | mir::shell::SurfaceReadyObserver::frame_posted*; |
1337 | mir::shell::SurfaceReadyObserver::?SurfaceReadyObserver*; |
1338 | mir::shell::SurfaceReadyObserver::SurfaceReadyObserver*; |
1339 | @@ -334,6 +391,8 @@ |
1340 | mir::shell::SystemCompositorWindowManager::handle_keyboard_event*; |
1341 | mir::shell::SystemCompositorWindowManager::handle_pointer_event*; |
1342 | mir::shell::SystemCompositorWindowManager::handle_raise_surface*; |
1343 | + mir::shell::SystemCompositorWindowManager::handle_request_drag_and_drop*; |
1344 | + mir::shell::SystemCompositorWindowManager::handle_request_move*; |
1345 | mir::shell::SystemCompositorWindowManager::handle_touch_event*; |
1346 | mir::shell::SystemCompositorWindowManager::modify_surface*; |
1347 | mir::shell::SystemCompositorWindowManager::on_session_added*; |
1348 | @@ -342,10 +401,15 @@ |
1349 | mir::shell::SystemCompositorWindowManager::remove_display*; |
1350 | mir::shell::SystemCompositorWindowManager::remove_session*; |
1351 | mir::shell::SystemCompositorWindowManager::remove_surface*; |
1352 | - mir::shell::SystemCompositorWindowManager::handle_request_drag_and_drop*; |
1353 | mir::shell::SystemCompositorWindowManager::set_surface_attribute*; |
1354 | mir::shell::SystemCompositorWindowManager::SystemCompositorWindowManager*; |
1355 | + mir::shell::WindowManagementPolicy::operator*; |
1356 | + mir::shell::WindowManagementPolicy::?WindowManagementPolicy*; |
1357 | + mir::shell::WindowManagementPolicy::WindowManagementPolicy*; |
1358 | mir::shell::WindowManager::operator*; |
1359 | + mir::shell::WindowManagerTools::operator*; |
1360 | + mir::shell::WindowManagerTools::?WindowManagerTools*; |
1361 | + mir::shell::WindowManagerTools::WindowManagerTools*; |
1362 | mir::shell::WindowManager::?WindowManager*; |
1363 | mir::shell::WindowManager::WindowManager*; |
1364 | mir::terminate_with_current_exception*; |
1365 | @@ -410,6 +474,7 @@ |
1366 | non-virtual?thunk?to?mir::scene::NullSurfaceObserver::reception_mode_set_to*; |
1367 | non-virtual?thunk?to?mir::scene::NullSurfaceObserver::renamed*; |
1368 | non-virtual?thunk?to?mir::scene::NullSurfaceObserver::resized_to*; |
1369 | + non-virtual?thunk?to?mir::scene::NullSurfaceObserver::start_drag_and_drop*; |
1370 | non-virtual?thunk?to?mir::scene::NullSurfaceObserver::transformation_set_to*; |
1371 | non-virtual?thunk?to?mir::scene::Observer::?Observer*; |
1372 | non-virtual?thunk?to?mir::scene::PromptSessionListener::?PromptSessionListener*; |
1373 | @@ -422,6 +487,7 @@ |
1374 | non-virtual?thunk?to?mir::ServerStatusListener::?ServerStatusListener*; |
1375 | non-virtual?thunk?to?mir::shell::AbstractShell::add_display*; |
1376 | non-virtual?thunk?to?mir::shell::AbstractShell::add_prompt_provider_for*; |
1377 | + non-virtual?thunk?to?mir::shell::AbstractShell::clear_drag_and_drop_handle*; |
1378 | non-virtual?thunk?to?mir::shell::AbstractShell::close_session*; |
1379 | non-virtual?thunk?to?mir::shell::AbstractShell::create_surface*; |
1380 | non-virtual?thunk?to?mir::shell::AbstractShell::destroy_surface*; |
1381 | @@ -435,11 +501,52 @@ |
1382 | non-virtual?thunk?to?mir::shell::AbstractShell::raise*; |
1383 | non-virtual?thunk?to?mir::shell::AbstractShell::raise_surface*; |
1384 | non-virtual?thunk?to?mir::shell::AbstractShell::remove_display*; |
1385 | + non-virtual?thunk?to?mir::shell::AbstractShell::request_drag_and_drop*; |
1386 | + non-virtual?thunk?to?mir::shell::AbstractShell::request_move*; |
1387 | + non-virtual?thunk?to?mir::shell::AbstractShell::set_drag_and_drop_handle*; |
1388 | non-virtual?thunk?to?mir::shell::AbstractShell::set_focus_to*; |
1389 | non-virtual?thunk?to?mir::shell::AbstractShell::set_surface_attribute*; |
1390 | non-virtual?thunk?to?mir::shell::AbstractShell::start_prompt_session_for*; |
1391 | non-virtual?thunk?to?mir::shell::AbstractShell::stop_prompt_session*; |
1392 | non-virtual?thunk?to?mir::shell::AbstractShell::surface_at*; |
1393 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::active_display*; |
1394 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::add_display*; |
1395 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::add_session*; |
1396 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::add_surface*; |
1397 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::clear_drag_and_drop_handle*; |
1398 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::find_session*; |
1399 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::focused_session*; |
1400 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::focused_surface*; |
1401 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::focus_next_session*; |
1402 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::forget*; |
1403 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_keyboard_event*; |
1404 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_pointer_event*; |
1405 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_raise_surface*; |
1406 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_drag_and_drop*; |
1407 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_move*; |
1408 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_touch_event*; |
1409 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::info_for*; |
1410 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::modify_surface*; |
1411 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::raise_tree*; |
1412 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::remove_display*; |
1413 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::remove_session*; |
1414 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::remove_surface*; |
1415 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::set_drag_and_drop_handle*; |
1416 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::set_focus_to*; |
1417 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::set_surface_attribute*; |
1418 | + non-virtual?thunk?to?mir::shell::BasicWindowManager::surface_at*; |
1419 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_delete_surface*; |
1420 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*; |
1421 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_keyboard_event*; |
1422 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_modify_surface*; |
1423 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_new_surface*; |
1424 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_place_new_surface*; |
1425 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_pointer_event*; |
1426 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_raise_surface*; |
1427 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_request_drag_and_drop*; |
1428 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*; |
1429 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_set_state*; |
1430 | + non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_touch_event*; |
1431 | non-virtual?thunk?to?mir::shell::DisplayConfigurationController::?DisplayConfigurationController*; |
1432 | non-virtual?thunk?to?mir::shell::DisplayLayout::?DisplayLayout*; |
1433 | non-virtual?thunk?to?mir::shell::FocusController::?FocusController*; |
1434 | @@ -449,6 +556,7 @@ |
1435 | non-virtual?thunk?to?mir::shell::ShellReport::?ShellReport*; |
1436 | non-virtual?thunk?to?mir::shell::ShellWrapper::add_display*; |
1437 | non-virtual?thunk?to?mir::shell::ShellWrapper::add_prompt_provider_for*; |
1438 | + non-virtual?thunk?to?mir::shell::ShellWrapper::clear_drag_and_drop_handle*; |
1439 | non-virtual?thunk?to?mir::shell::ShellWrapper::close_session*; |
1440 | non-virtual?thunk?to?mir::shell::ShellWrapper::create_surface*; |
1441 | non-virtual?thunk?to?mir::shell::ShellWrapper::destroy_surface*; |
1442 | @@ -462,6 +570,9 @@ |
1443 | non-virtual?thunk?to?mir::shell::ShellWrapper::raise*; |
1444 | non-virtual?thunk?to?mir::shell::ShellWrapper::raise_surface*; |
1445 | non-virtual?thunk?to?mir::shell::ShellWrapper::remove_display*; |
1446 | + non-virtual?thunk?to?mir::shell::ShellWrapper::request_drag_and_drop*; |
1447 | + non-virtual?thunk?to?mir::shell::ShellWrapper::request_move*; |
1448 | + non-virtual?thunk?to?mir::shell::ShellWrapper::set_drag_and_drop_handle*; |
1449 | non-virtual?thunk?to?mir::shell::ShellWrapper::set_focus_to*; |
1450 | non-virtual?thunk?to?mir::shell::ShellWrapper::set_surface_attribute*; |
1451 | non-virtual?thunk?to?mir::shell::ShellWrapper::start_prompt_session_for*; |
1452 | @@ -479,6 +590,8 @@ |
1453 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_keyboard_event*; |
1454 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_pointer_event*; |
1455 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_raise_surface*; |
1456 | + non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_request_drag_and_drop*; |
1457 | + non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_request_move*; |
1458 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_touch_event*; |
1459 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::modify_surface*; |
1460 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::on_session_added*; |
1461 | @@ -488,6 +601,8 @@ |
1462 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::remove_session*; |
1463 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::remove_surface*; |
1464 | non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::set_surface_attribute*; |
1465 | + non-virtual?thunk?to?mir::shell::WindowManagementPolicy::?WindowManagementPolicy*; |
1466 | + non-virtual?thunk?to?mir::shell::WindowManagerTools::?WindowManagerTools*; |
1467 | non-virtual?thunk?to?mir::shell::WindowManager::?WindowManager*; |
1468 | non-virtual?thunk?to?mir::time::Alarm::?Alarm*; |
1469 | non-virtual?thunk?to?mir::time::AlarmFactory::?AlarmFactory*; |
1470 | @@ -552,6 +667,8 @@ |
1471 | typeinfo?for?mir::ServerActionQueue; |
1472 | typeinfo?for?mir::ServerStatusListener; |
1473 | typeinfo?for?mir::shell::AbstractShell; |
1474 | + typeinfo?for?mir::shell::BasicWindowManager; |
1475 | + typeinfo?for?mir::shell::CanonicalWindowManagerPolicy; |
1476 | typeinfo?for?mir::shell::DisplayConfigurationController; |
1477 | typeinfo?for?mir::shell::DisplayLayout; |
1478 | typeinfo?for?mir::shell::FocusController; |
1479 | @@ -559,18 +676,22 @@ |
1480 | typeinfo?for?mir::shell::InputTargeter; |
1481 | typeinfo?for?mir::shell::PersistentSurfaceStore; |
1482 | typeinfo?for?mir::shell::PersistentSurfaceStore::Id; |
1483 | + typeinfo?for?mir::shell::SessionInfo; |
1484 | typeinfo?for?mir::shell::Shell; |
1485 | typeinfo?for?mir::shell::ShellReport; |
1486 | typeinfo?for?mir::shell::ShellWrapper; |
1487 | typeinfo?for?mir::shell::StreamCursor; |
1488 | typeinfo?for?mir::shell::StreamSpecification; |
1489 | typeinfo?for?mir::shell::SurfaceAspectRatio; |
1490 | + typeinfo?for?mir::shell::SurfaceInfo; |
1491 | typeinfo?for?mir::shell::SurfaceReadyObserver; |
1492 | typeinfo?for?mir::shell::SurfaceSpecification; |
1493 | typeinfo?for?mir::shell::SurfaceStack; |
1494 | typeinfo?for?mir::shell::SurfaceStackWrapper; |
1495 | typeinfo?for?mir::shell::SystemCompositorWindowManager; |
1496 | + typeinfo?for?mir::shell::WindowManagementPolicy; |
1497 | typeinfo?for?mir::shell::WindowManager; |
1498 | + typeinfo?for?mir::shell::WindowManagerTools; |
1499 | typeinfo?for?mir::time::Alarm; |
1500 | typeinfo?for?mir::time::AlarmFactory; |
1501 | vtable?for?mir::compositor::Compositor; |
1502 | @@ -634,6 +755,8 @@ |
1503 | vtable?for?mir::ServerActionQueue; |
1504 | vtable?for?mir::ServerStatusListener; |
1505 | vtable?for?mir::shell::AbstractShell; |
1506 | + vtable?for?mir::shell::BasicWindowManager; |
1507 | + vtable?for?mir::shell::CanonicalWindowManagerPolicy; |
1508 | vtable?for?mir::shell::DisplayConfigurationController; |
1509 | vtable?for?mir::shell::DisplayLayout; |
1510 | vtable?for?mir::shell::FocusController; |
1511 | @@ -641,18 +764,22 @@ |
1512 | vtable?for?mir::shell::InputTargeter; |
1513 | vtable?for?mir::shell::PersistentSurfaceStore; |
1514 | vtable?for?mir::shell::PersistentSurfaceStore::Id; |
1515 | + vtable?for?mir::shell::SessionInfo; |
1516 | vtable?for?mir::shell::Shell; |
1517 | vtable?for?mir::shell::ShellReport; |
1518 | vtable?for?mir::shell::ShellWrapper; |
1519 | vtable?for?mir::shell::StreamCursor; |
1520 | vtable?for?mir::shell::StreamSpecification; |
1521 | vtable?for?mir::shell::SurfaceAspectRatio; |
1522 | + vtable?for?mir::shell::SurfaceInfo; |
1523 | vtable?for?mir::shell::SurfaceReadyObserver; |
1524 | vtable?for?mir::shell::SurfaceSpecification; |
1525 | vtable?for?mir::shell::SurfaceStack; |
1526 | vtable?for?mir::shell::SurfaceStackWrapper; |
1527 | vtable?for?mir::shell::SystemCompositorWindowManager; |
1528 | + vtable?for?mir::shell::WindowManagementPolicy; |
1529 | vtable?for?mir::shell::WindowManager; |
1530 | + vtable?for?mir::shell::WindowManagerTools; |
1531 | vtable?for?mir::time::Alarm; |
1532 | vtable?for?mir::time::AlarmFactory; |
1533 | |
1534 | @@ -675,6 +802,21 @@ |
1535 | virtual?thunk?to?mir::shell::AbstractShell::setting_focus_to*; |
1536 | virtual?thunk?to?mir::shell::AbstractShell::start_prompt_session_for*; |
1537 | virtual?thunk?to?mir::shell::AbstractShell::stop_prompt_session*; |
1538 | + virtual?thunk?to?mir::shell::BasicWindowManager::?BasicWindowManager*; |
1539 | + virtual?thunk?to?mir::shell::BasicWindowManager::add_display*; |
1540 | + virtual?thunk?to?mir::shell::BasicWindowManager::add_session*; |
1541 | + virtual?thunk?to?mir::shell::BasicWindowManager::add_surface*; |
1542 | + virtual?thunk?to?mir::shell::BasicWindowManager::handle_keyboard_event*; |
1543 | + virtual?thunk?to?mir::shell::BasicWindowManager::handle_pointer_event*; |
1544 | + virtual?thunk?to?mir::shell::BasicWindowManager::handle_raise_surface*; |
1545 | + virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_drag_and_drop*; |
1546 | + virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_move*; |
1547 | + virtual?thunk?to?mir::shell::BasicWindowManager::handle_touch_event*; |
1548 | + virtual?thunk?to?mir::shell::BasicWindowManager::modify_surface*; |
1549 | + virtual?thunk?to?mir::shell::BasicWindowManager::remove_display*; |
1550 | + virtual?thunk?to?mir::shell::BasicWindowManager::remove_session*; |
1551 | + virtual?thunk?to?mir::shell::BasicWindowManager::remove_surface*; |
1552 | + virtual?thunk?to?mir::shell::BasicWindowManager::set_surface_attribute*; |
1553 | virtual?thunk?to?mir::shell::ShellWrapper::add_display*; |
1554 | virtual?thunk?to?mir::shell::ShellWrapper::handle*; |
1555 | virtual?thunk?to?mir::shell::ShellWrapper::remove_display*; |
1556 | @@ -686,25 +828,6 @@ |
1557 | MIR_SERVER_DETAIL_FOR_TESTING_0.27 { |
1558 | global: |
1559 | extern "C++" { |
1560 | - mir::shell::CanonicalWindowManagerPolicy::handle_set_state*; |
1561 | - mir::shell::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy*; |
1562 | - mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*; |
1563 | - mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*; |
1564 | - mir::shell::CanonicalWindowManagerPolicy::handle_place_new_surface*; |
1565 | - mir::shell::CanonicalWindowManagerPolicy::handle_modify_surface*; |
1566 | - mir::shell::CanonicalWindowManagerPolicy::handle_new_surface*; |
1567 | - mir::shell::CanonicalWindowManagerPolicy::handle_delete_surface*; |
1568 | - mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*; |
1569 | - mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*; |
1570 | - mir::shell::CanonicalWindowManagerPolicy::handle_keyboard_event*; |
1571 | - mir::shell::CanonicalWindowManagerPolicy::handle_touch_event*; |
1572 | - mir::shell::CanonicalWindowManagerPolicy::handle_pointer_event*; |
1573 | - mir::shell::CanonicalWindowManagerPolicy::handle_raise_surface*; |
1574 | - mir::shell::CanonicalWindowManagerPolicy::handle_request_drag_and_drop*; |
1575 | - typeinfo?for?mir::shell::CanonicalWindowManagerPolicy; |
1576 | - vtable?for?mir::shell::CanonicalWindowManagerPolicy; |
1577 | - VTT?for?mir::shell::CanonicalWindowManagerPolicy; |
1578 | - |
1579 | mir::DefaultServerConfiguration::clock*; |
1580 | mir::DefaultServerConfiguration::DefaultServerConfiguration*; |
1581 | mir::DefaultServerConfiguration::new_ipc_factory*; |
1582 | @@ -831,47 +954,5 @@ |
1583 | mir::renderer::gl::Renderer::vshader; |
1584 | typeinfo?for?mir::renderer::gl::Renderer; |
1585 | vtable?for?mir::renderer::gl::Renderer; |
1586 | - |
1587 | - mir::shell::BasicWindowManager::active_display*; |
1588 | - mir::shell::BasicWindowManager::add_display*; |
1589 | - mir::shell::BasicWindowManager::add_session*; |
1590 | - mir::shell::BasicWindowManager::add_surface*; |
1591 | - mir::shell::BasicWindowManager::BasicWindowManager*; |
1592 | - mir::shell::BasicWindowManager::clear_drag_and_drop_handle*; |
1593 | - mir::shell::BasicWindowManager::find_session*; |
1594 | - mir::shell::BasicWindowManager::focused_session*; |
1595 | - mir::shell::BasicWindowManager::focused_surface*; |
1596 | - mir::shell::BasicWindowManager::focus_next_session*; |
1597 | - mir::shell::BasicWindowManager::forget*; |
1598 | - mir::shell::BasicWindowManager::handle_keyboard_event*; |
1599 | - mir::shell::BasicWindowManager::handle_pointer_event*; |
1600 | - mir::shell::BasicWindowManager::handle_raise_surface*; |
1601 | - mir::shell::BasicWindowManager::handle_request_drag_and_drop*; |
1602 | - mir::shell::BasicWindowManager::handle_touch_event*; |
1603 | - mir::shell::BasicWindowManager::info_for*; |
1604 | - mir::shell::BasicWindowManager::modify_surface*; |
1605 | - mir::shell::BasicWindowManager::raise_tree*; |
1606 | - mir::shell::BasicWindowManager::remove_display*; |
1607 | - mir::shell::BasicWindowManager::remove_session*; |
1608 | - mir::shell::BasicWindowManager::remove_surface*; |
1609 | - mir::shell::BasicWindowManager::set_drag_and_drop_handle*; |
1610 | - mir::shell::BasicWindowManager::set_focus_to*; |
1611 | - mir::shell::BasicWindowManager::set_surface_attribute*; |
1612 | - mir::shell::BasicWindowManager::surface_at*; |
1613 | - typeinfo?for?mir::shell::BasicWindowManager; |
1614 | - virtual?thunk?to?mir::shell::BasicWindowManager::add_display*; |
1615 | - virtual?thunk?to?mir::shell::BasicWindowManager::add_session*; |
1616 | - virtual?thunk?to?mir::shell::BasicWindowManager::add_surface*; |
1617 | - virtual?thunk?to?mir::shell::BasicWindowManager::handle_keyboard_event*; |
1618 | - virtual?thunk?to?mir::shell::BasicWindowManager::handle_pointer_event*; |
1619 | - virtual?thunk?to?mir::shell::BasicWindowManager::handle_raise_surface*; |
1620 | - virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_drag_and_drop*; |
1621 | - virtual?thunk?to?mir::shell::BasicWindowManager::handle_touch_event*; |
1622 | - virtual?thunk?to?mir::shell::BasicWindowManager::modify_surface*; |
1623 | - virtual?thunk?to?mir::shell::BasicWindowManager::remove_display*; |
1624 | - virtual?thunk?to?mir::shell::BasicWindowManager::remove_session*; |
1625 | - virtual?thunk?to?mir::shell::BasicWindowManager::remove_surface*; |
1626 | - virtual?thunk?to?mir::shell::BasicWindowManager::set_surface_attribute*; |
1627 | - VTT?for?mir::shell::BasicWindowManager; |
1628 | }; |
1629 | } MIR_SERVER_DETAIL_FOR_TESTING_0.27; |
1630 | |
1631 | === modified file 'tests/acceptance-tests/CMakeLists.txt' |
1632 | --- tests/acceptance-tests/CMakeLists.txt 2017-03-24 10:16:59 +0000 |
1633 | +++ tests/acceptance-tests/CMakeLists.txt 2017-04-04 10:15:32 +0000 |
1634 | @@ -77,18 +77,10 @@ |
1635 | # The following tests use still files we have chosen not to support in the public API |
1636 | # TODO update these "throwback" tests to rely only on the public APIs |
1637 | |
1638 | - # uses BasicWindowManager<> |
1639 | - set_source_files_properties(test_client_cursor_api.cpp PROPERTIES COMPILE_FLAGS |
1640 | - "${CMAKE_CXXFLAGS} -I ${PROJECT_SOURCE_DIR}/src/include/server") |
1641 | - |
1642 | # uses UsingClientPlatform |
1643 | set_source_files_properties(test_client_library_errors.cpp PROPERTIES COMPILE_FLAGS |
1644 | "${CMAKE_CXXFLAGS} -I ${CMAKE_SOURCE_DIR}") |
1645 | |
1646 | - # uses CanonicalWindowManager |
1647 | - set_source_files_properties(test_shell_control_of_surface_configuration.cpp PROPERTIES COMPILE_FLAGS |
1648 | - "${CMAKE_CXXFLAGS} -I ${PROJECT_SOURCE_DIR}/src/include/server") |
1649 | - |
1650 | # uses src/include/common/mir/protobuf/protocol_version.h |
1651 | set_source_files_properties(test_client_library.cpp PROPERTIES COMPILE_FLAGS |
1652 | "${CMAKE_CXXFLAGS} -I ${CMAKE_SOURCE_DIR}") |
1653 | |
1654 | === modified file 'tests/acceptance-tests/client_mediated_user_gestures.cpp' |
1655 | --- tests/acceptance-tests/client_mediated_user_gestures.cpp 2017-03-27 16:13:56 +0000 |
1656 | +++ tests/acceptance-tests/client_mediated_user_gestures.cpp 2017-04-04 10:15:32 +0000 |
1657 | @@ -22,12 +22,14 @@ |
1658 | #include <mir/geometry/displacement.h> |
1659 | #include <mir/input/input_device_info.h> |
1660 | #include <mir/input/device_capability.h> |
1661 | +#include <mir/shell/canonical_window_manager.h> |
1662 | #include <mir/shell/shell.h> |
1663 | |
1664 | #include <mir_test_framework/connected_client_with_a_window.h> |
1665 | #include <mir_test_framework/fake_input_device.h> |
1666 | #include <mir_test_framework/stub_server_platform_factory.h> |
1667 | #include <mir/test/event_factory.h> |
1668 | +#include <mir/test/fake_shared.h> |
1669 | #include <mir/test/signal.h> |
1670 | |
1671 | #include <gmock/gmock.h> |
1672 | @@ -40,6 +42,7 @@ |
1673 | using namespace std::chrono_literals; |
1674 | using namespace mir::geometry; |
1675 | using namespace testing; |
1676 | +using mir::test::fake_shared; |
1677 | using mir::test::Signal; |
1678 | |
1679 | namespace |
1680 | @@ -67,6 +70,17 @@ |
1681 | |
1682 | void mir_cookie_release(Cookie const&) = delete; |
1683 | |
1684 | +#pragma GCC diagnostic push |
1685 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
1686 | +struct MockWindowManager : mir::shell::CanonicalWindowManager |
1687 | +{ |
1688 | + using mir::shell::CanonicalWindowManager::CanonicalWindowManager; |
1689 | + |
1690 | + MOCK_METHOD3(handle_request_move, |
1691 | + void(std::shared_ptr<mir::scene::Session> const&, std::shared_ptr<mir::scene::Surface> const&, uint64_t)); |
1692 | +}; |
1693 | +#pragma GCC diagnostic pop |
1694 | + |
1695 | struct MouseMoverAndFaker |
1696 | { |
1697 | void start_dragging_mouse() |
1698 | @@ -103,6 +117,12 @@ |
1699 | void SetUp() override |
1700 | { |
1701 | initial_display_layout({screen_geometry}); |
1702 | + server.override_the_window_manager_builder([this](mir::shell::FocusController* focus_controller) |
1703 | + { |
1704 | + return window_manager = |
1705 | + std::make_shared<MockWindowManager>(focus_controller, server.the_shell_display_layout()); |
1706 | + }); |
1707 | + |
1708 | mir_test_framework::ConnectedClientWithAWindow::SetUp(); |
1709 | mir_window_set_event_handler(window, &window_event_handler, this); |
1710 | |
1711 | @@ -114,11 +134,14 @@ |
1712 | void TearDown() override |
1713 | { |
1714 | reset_window_event_handler(); |
1715 | + window_manager.reset(); |
1716 | mir_test_framework::ConnectedClientWithAWindow::TearDown(); |
1717 | } |
1718 | |
1719 | auto user_initiates_gesture() -> Cookie; |
1720 | |
1721 | + std::shared_ptr<MockWindowManager> window_manager; |
1722 | + |
1723 | private: |
1724 | void center_mouse(); |
1725 | void paint_window(); |
1726 | @@ -250,10 +273,13 @@ |
1727 | EXPECT_THAT(cookie.get(), NotNull()); |
1728 | } |
1729 | |
1730 | -// TODO extend this test when server side implemented |
1731 | -TEST_F(ClientMediatedUserGestures, when_client_initiates_move_nothing_bad_happens) |
1732 | +TEST_F(ClientMediatedUserGestures, when_client_initiates_move_window_manager_handles_request) |
1733 | { |
1734 | auto const cookie = user_initiates_gesture(); |
1735 | + Signal have_request; |
1736 | + EXPECT_CALL(*window_manager, handle_request_move(_, _, _)).WillOnce(InvokeWithoutArgs([&]{ have_request.raise(); })); |
1737 | |
1738 | mir_window_request_user_move(window, cookie); |
1739 | + |
1740 | + EXPECT_THAT(have_request.wait_for(receive_event_timeout), Eq(true)); |
1741 | } |
1742 | |
1743 | === modified file 'tests/acceptance-tests/test_client_cursor_api.cpp' |
1744 | --- tests/acceptance-tests/test_client_cursor_api.cpp 2017-03-15 09:30:18 +0000 |
1745 | +++ tests/acceptance-tests/test_client_cursor_api.cpp 2017-04-04 10:15:32 +0000 |
1746 | @@ -275,7 +275,10 @@ |
1747 | |
1748 | server.override_the_window_manager_builder([this](msh::FocusController* focus_controller) |
1749 | { |
1750 | +#pragma GCC diagnostic push |
1751 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
1752 | using PlacementWindowManager = msh::WindowManagerConstructor<mtf::DeclarativePlacementWindowManagerPolicy>; |
1753 | +#pragma GCC diagnostic pop |
1754 | return std::make_shared<PlacementWindowManager>( |
1755 | focus_controller, |
1756 | client_geometries, |
1757 | |
1758 | === modified file 'tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp' |
1759 | --- tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp 2017-03-14 02:26:28 +0000 |
1760 | +++ tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp 2017-04-04 10:15:32 +0000 |
1761 | @@ -39,6 +39,8 @@ |
1762 | |
1763 | namespace |
1764 | { |
1765 | +#pragma GCC diagnostic push |
1766 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
1767 | struct MockWindowManager : msh::CanonicalWindowManager |
1768 | { |
1769 | using msh::CanonicalWindowManager::CanonicalWindowManager; |
1770 | @@ -57,6 +59,7 @@ |
1771 | return msh::CanonicalWindowManager::set_surface_attribute(session, surface, attrib, value); |
1772 | } |
1773 | }; |
1774 | +#pragma GCC diagnostic pop |
1775 | |
1776 | void signal_state_change(MirWindow*, MirEvent const* event, void* context) |
1777 | { |
1778 | |
1779 | === modified file 'tests/include/mir/test/doubles/mock_shell.h' |
1780 | --- tests/include/mir/test/doubles/mock_shell.h 2017-03-08 12:34:11 +0000 |
1781 | +++ tests/include/mir/test/doubles/mock_shell.h 2017-04-04 10:15:32 +0000 |
1782 | @@ -73,8 +73,8 @@ |
1783 | MOCK_METHOD3(raise_surface, void(std::shared_ptr<frontend::Session> const& session, |
1784 | frontend::SurfaceId surface_id, uint64_t timestamp)); |
1785 | |
1786 | - MOCK_METHOD3(request_drag_and_drop, void(std::shared_ptr<frontend::Session> const& session, |
1787 | - frontend::SurfaceId surface_id, uint64_t timestamp)); |
1788 | + MOCK_METHOD4(request_operation, void(std::shared_ptr<frontend::Session> const &session, |
1789 | + frontend::SurfaceId surface_id, uint64_t timestamp, UserRequest request)); |
1790 | }; |
1791 | |
1792 | } |
FAILED: Continuous integration, rev:4133 /mir-jenkins. ubuntu. com/job/ mir-ci/ 3284/ /mir-jenkins. ubuntu. com/job/ build-mir/ 4433/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/4525 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 4515 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 4515 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/4515 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/4465/ console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4465 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4465/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4465 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4465/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 4465 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 4465/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 4465 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 4465/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4465 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4465/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 3284/rebuild
https:/