Merge lp:~alan-griffiths/miral/1.3 into lp:miral/release

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 357
Proposed branch: lp:~alan-griffiths/miral/1.3
Merge into: lp:miral/release
Diff against target: 783 lines (+301/-94)
27 files modified
CMakeLists.txt (+1/-1)
debian/changelog (+18/-0)
debian/libmiral2.symbols (+6/-0)
include/mir/client/blob.h (+50/-0)
include/mir/client/cookie.h (+50/-0)
include/mir/client/window_spec.h (+11/-2)
include/miral/set_command_line_handler.h (+3/-3)
include/miral/set_window_managment_policy.h (+5/-5)
miral-kiosk/kiosk_main.cpp (+1/-1)
miral-shell/decoration_provider.cpp (+22/-5)
miral-shell/shell_main.cpp (+1/-1)
miral-shell/spinner/miregl.h (+0/-2)
miral-shell/tiling_window_manager.h (+0/-1)
miral/CMakeLists.txt (+3/-1)
miral/basic_window_manager.cpp (+26/-35)
miral/set_command_line_handler.cpp (+1/-1)
miral/set_window_managment_policy.cpp (+20/-3)
miral/symbols.map (+11/-0)
scripts/process_doxygen_xml.py (+24/-1)
tasks_for_the_interested_reader.md (+1/-1)
test/active_window.cpp (+38/-1)
test/display_reconfiguration.cpp (+0/-2)
test/drag_active_window.cpp (+0/-2)
test/modify_window_state.cpp (+0/-2)
test/raise_tree.cpp (+0/-10)
test/window_id.cpp (+9/-9)
test/workspaces.cpp (+0/-5)
To merge this branch: bzr merge lp:~alan-griffiths/miral/1.3
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+320033@code.launchpad.net

Commit message

1.3.1 release

To post a comment you must log in.
lp:~alan-griffiths/miral/1.3 updated
357. By CI Train Bot Account

* New upstream release 1.3.1 (https://launchpad.net/miral/+milestone/1.3.1)
  - ABI summary:
    . miral ABI unchanged at 2
  - Enhancements:
    . [libmirclientcpp] RAII wrappers for MirBlob and MirCookie
    . spelling: SetWindowManagmentPolicy => SetWindowManagementPolicy
  - Bugs fixed:
    . [miral-shell] If a surface is deleted before its decoration is painted
      miral-shell can crash, or hang on exit (LP: #1673038)
    . [miral-shell] if the specified font doesn't exist the server crashes
      (LP: #1671028)
    . [libmiral] When a dialog is hidden ensure that the active window focus
      goes to the parent. (LP: #1671072)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2017-02-15 17:32:34 +0000
3+++ CMakeLists.txt 2017-03-16 18:12:17 +0000
4@@ -42,7 +42,7 @@
5
6 set(MIRAL_VERSION_MAJOR 1)
7 set(MIRAL_VERSION_MINOR 3)
8-set(MIRAL_VERSION_PATCH 0)
9+set(MIRAL_VERSION_PATCH 1)
10
11 set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH})
12
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2017-03-03 10:19:14 +0000
16+++ debian/changelog 2017-03-16 18:12:17 +0000
17@@ -1,3 +1,21 @@
18+miral (1.3.1) UNRELEASED; urgency=medium
19+
20+ * New upstream release 1.3.1 (https://launchpad.net/miral/+milestone/1.3.1)
21+ - ABI summary:
22+ . miral ABI unchanged at 2
23+ - Enhancements:
24+ . [libmirclientcpp] RAII wrappers for MirBlob and MirCookie
25+ . spelling: SetWindowManagmentPolicy => SetWindowManagementPolicy
26+ - Bugs fixed:
27+ . [miral-shell] If a surface is deleted before its decoration is painted
28+ miral-shell can crash, or hang on exit (LP: #1673038)
29+ . [miral-shell] if the specified font doesn't exist the server crashes
30+ (LP: #1671028)
31+ . [libmiral] When a dialog is hidden ensure that the active window focus
32+ goes to the parent. (LP: #1671072)
33+
34+ -- Alan Griffiths <alan.griffiths@canonical.com> Mon, 06 Mar 2017 10:00:20 +0000
35+
36 miral (1.3.0+17.04.20170303-0ubuntu1) zesty; urgency=medium
37
38 * New upstream release 1.3.0 (https://launchpad.net/miral/+milestone/1.3)
39
40=== modified file 'debian/libmiral2.symbols'
41--- debian/libmiral2.symbols 2017-03-02 17:40:20 +0000
42+++ debian/libmiral2.symbols 2017-03-16 18:12:17 +0000
43@@ -383,3 +383,9 @@
44 (c++)"miral::WindowManagerTools::for_each_workspace_containing(miral::Window const&, std::function<void (std::shared_ptr<miral::Workspace> const&)> const&)@MIRAL_1.3" 1.3.0
45 (c++)"typeinfo for miral::WorkspacePolicy@MIRAL_1.3" 1.3.0
46 (c++)"vtable for miral::WorkspacePolicy@MIRAL_1.3" 1.3.0
47+ MIRAL_1.3.1@MIRAL_1.3.1 1.3.1
48+ (c++)"miral::SetWindowManagementPolicy::SetWindowManagementPolicy(std::function<std::unique_ptr<miral::WindowManagementPolicy, std::default_delete<miral::WindowManagementPolicy> > (miral::WindowManagerTools const&)> const&)@MIRAL_1.3.1" 1.3.1
49+ (c++)"miral::SetWindowManagementPolicy::SetWindowManagementPolicy(std::function<std::unique_ptr<miral::WindowManagementPolicy, std::default_delete<miral::WindowManagementPolicy> > (miral::WindowManagerTools const&)> const&)@MIRAL_1.3.1" 1.3.1
50+ (c++)"miral::SetWindowManagementPolicy::~SetWindowManagementPolicy()@MIRAL_1.3.1" 1.3.1
51+ (c++)"miral::SetWindowManagementPolicy::~SetWindowManagementPolicy()@MIRAL_1.3.1" 1.3.1
52+ (c++)"miral::SetWindowManagementPolicy::operator()(mir::Server&) const@MIRAL_1.3.1" 1.3.1
53
54=== added file 'include/mir/client/blob.h'
55--- include/mir/client/blob.h 1970-01-01 00:00:00 +0000
56+++ include/mir/client/blob.h 2017-03-16 18:12:17 +0000
57@@ -0,0 +1,50 @@
58+/*
59+ * Copyright © 2017 Canonical Ltd.
60+ *
61+ * This program is free software: you can redistribute it and/or modify it
62+ * under the terms of the GNU General Public License version 3,
63+ * as published by the Free Software Foundation.
64+ *
65+ * This program is distributed in the hope that it will be useful,
66+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
67+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68+ * GNU General Public License for more details.
69+ *
70+ * You should have received a copy of the GNU General Public License
71+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
72+ *
73+ * Authored by: Alan Griffiths <alan@octopull.co.uk>
74+ */
75+
76+#ifndef MIR_CLIENT_BLOB_H
77+#define MIR_CLIENT_BLOB_H
78+
79+#include <mir_toolkit/mir_blob.h>
80+
81+#include <memory>
82+
83+namespace mir
84+{
85+namespace client
86+{
87+class Blob
88+{
89+public:
90+ Blob() = default;
91+ explicit Blob(MirBlob* blob) : self{blob, deleter} {}
92+
93+ operator MirBlob*() const { return self.get(); }
94+
95+ void reset() { self.reset(); }
96+ void reset(MirBlob* blob) { self.reset(blob, deleter); }
97+
98+ friend void mir_blob_release(Blob const&) = delete;
99+
100+private:
101+ static void deleter(MirBlob* blob) { mir_blob_release(blob); }
102+ std::shared_ptr<MirBlob> self;
103+};
104+}
105+}
106+
107+#endif //MIR_CLIENT_BLOB_H
108
109=== added file 'include/mir/client/cookie.h'
110--- include/mir/client/cookie.h 1970-01-01 00:00:00 +0000
111+++ include/mir/client/cookie.h 2017-03-16 18:12:17 +0000
112@@ -0,0 +1,50 @@
113+/*
114+ * Copyright © 2017 Canonical Ltd.
115+ *
116+ * This program is free software: you can redistribute it and/or modify it
117+ * under the terms of the GNU General Public License version 3,
118+ * as published by the Free Software Foundation.
119+ *
120+ * This program is distributed in the hope that it will be useful,
121+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
122+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
123+ * GNU General Public License for more details.
124+ *
125+ * You should have received a copy of the GNU General Public License
126+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
127+ *
128+ * Authored by: Alan Griffiths <alan@octopull.co.uk>
129+ */
130+
131+#ifndef MIR_CLIENT_COOKIE_H
132+#define MIR_CLIENT_COOKIE_H
133+
134+#include <mir_toolkit/mir_cookie.h>
135+
136+#include <memory>
137+
138+namespace mir
139+{
140+namespace client
141+{
142+class Cookie
143+{
144+public:
145+ Cookie() = default;
146+ explicit Cookie(MirCookie const* cookie) : self{cookie, deleter} {}
147+
148+ operator MirCookie const*() const { return self.get(); }
149+
150+ void reset() { self.reset(); }
151+ void reset(MirCookie const* cookie) { self.reset(cookie, deleter); }
152+
153+ friend void mir_cookie_release(Cookie const&) = delete;
154+
155+private:
156+ static void deleter(MirCookie const* cookie) { mir_cookie_release(cookie); }
157+ std::shared_ptr<MirCookie const> self;
158+};
159+}
160+}
161+
162+#endif //MIR_CLIENT_COOKIE_H
163
164=== modified file 'include/mir/client/window_spec.h'
165--- include/mir/client/window_spec.h 2017-02-22 12:39:47 +0000
166+++ include/mir/client/window_spec.h 2017-03-16 18:12:17 +0000
167@@ -109,7 +109,6 @@
168 #endif
169 }
170
171-#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)
172 static auto for_tip(MirConnection* connection,
173 int width,
174 int height,
175@@ -118,6 +117,7 @@
176 MirRectangle* rect,
177 MirEdgeAttachment edge) -> WindowSpec
178 {
179+#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)
180 #if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
181 return WindowSpec{mir_connection_create_spec_for_tip(connection, width, height, format, parent, rect, edge)};
182 #else
183@@ -125,8 +125,17 @@
184 mir_window_spec_set_pixel_format(spec, format);
185 return spec;
186 #endif
187+#else
188+ (void)rect;
189+ (void)edge;
190+ return WindowSpec{mir_create_surface_spec(connection)}
191+ .set_buffer_usage(mir_buffer_usage_hardware) // Required protobuf field for create_window()
192+ .set_pixel_format(format) // Required protobuf field for create_window()
193+ .set_size(width, height)
194+ .set_parent(parent)
195+ .set_type(mir_window_type_tip);
196+#endif
197 }
198-#endif
199
200 static auto for_dialog(MirConnection* connection,
201 int width,
202
203=== renamed file 'include/miral/set_command_line_hander.h' => 'include/miral/set_command_line_handler.h'
204--- include/miral/set_command_line_hander.h 2016-08-17 08:40:51 +0000
205+++ include/miral/set_command_line_handler.h 2017-03-16 18:12:17 +0000
206@@ -16,8 +16,8 @@
207 * Authored by: Alan Griffiths <alan@octopull.co.uk>
208 */
209
210-#ifndef MIRAL_SET_COMMAND_LINE_HANDER_H
211-#define MIRAL_SET_COMMAND_LINE_HANDER_H
212+#ifndef MIRAL_SET_COMMAND_LINE_HANDLER_H
213+#define MIRAL_SET_COMMAND_LINE_HANDLER_H
214
215 #include <functional>
216
217@@ -47,4 +47,4 @@
218 };
219 }
220
221-#endif //MIRAL_SET_COMMAND_LINE_HANDER_H
222+#endif //MIRAL_SET_COMMAND_LINE_HANDLER_H
223
224=== modified file 'include/miral/set_window_managment_policy.h'
225--- include/miral/set_window_managment_policy.h 2016-07-27 15:43:19 +0000
226+++ include/miral/set_window_managment_policy.h 2017-03-16 18:12:17 +0000
227@@ -31,11 +31,11 @@
228 class WindowManagerTools;
229 class WindowManagementPolicy;
230
231-class SetWindowManagmentPolicy
232+class SetWindowManagementPolicy
233 {
234 public:
235- SetWindowManagmentPolicy(std::function<std::unique_ptr<WindowManagementPolicy>(WindowManagerTools const& tools)> const& builder);
236- ~SetWindowManagmentPolicy();
237+ SetWindowManagementPolicy(std::function<std::unique_ptr<WindowManagementPolicy>(WindowManagerTools const& tools)> const& builder);
238+ ~SetWindowManagementPolicy();
239
240 void operator()(mir::Server& server) const;
241
242@@ -44,9 +44,9 @@
243 };
244
245 template<typename Policy, typename ...Args>
246-auto set_window_managment_policy(Args& ... args) -> SetWindowManagmentPolicy
247+auto set_window_management_policy(Args& ... args) -> SetWindowManagementPolicy
248 {
249- return SetWindowManagmentPolicy{[&args...](WindowManagerTools const& tools) -> std::unique_ptr<WindowManagementPolicy>
250+ return SetWindowManagementPolicy{[&args...](WindowManagerTools const& tools) -> std::unique_ptr<WindowManagementPolicy>
251 { return std::make_unique<Policy>(tools, args...); }};
252 }
253 }
254
255=== modified file 'miral-kiosk/kiosk_main.cpp'
256--- miral-kiosk/kiosk_main.cpp 2017-03-02 11:23:44 +0000
257+++ miral-kiosk/kiosk_main.cpp 2017-03-16 18:12:17 +0000
258@@ -91,7 +91,7 @@
259 {
260 CommandLineOption{[&](std::string const& ) { },
261 "desktop_file_hint", "Ignored for Unity8 compatability", "miral-shell.desktop"},
262- set_window_managment_policy<KioskWindowManagerPolicy>(splash),
263+ set_window_management_policy<KioskWindowManagerPolicy>(splash),
264 SetApplicationAuthorizer<KioskAuthorizer>{splash},
265 Keymap{},
266 maximise_roots,
267
268=== modified file 'miral-shell/decoration_provider.cpp'
269--- miral-shell/decoration_provider.cpp 2017-03-02 17:40:20 +0000
270+++ miral-shell/decoration_provider.cpp 2017-03-16 18:12:17 +0000
271@@ -154,6 +154,9 @@
272
273 void Printer::printhelp(MirGraphicsRegion const& region)
274 {
275+ if (!working)
276+ return;
277+
278 static char const* const helptext[] =
279 {
280 "Welcome to miral-shell",
281@@ -398,11 +401,25 @@
282 });
283 }
284
285- enqueue_work([this, window]
286- {
287- std::lock_guard<decltype(mutex)> lock{mutex};
288- window_to_titlebar.erase(window);
289- });
290+ if (data->titlebar.load())
291+ {
292+ enqueue_work([this, window]
293+ {
294+ std::lock_guard<decltype(mutex)> lock{mutex};
295+ window_to_titlebar.erase(window);
296+ });
297+ }
298+ else
299+ {
300+ data->on_create = [this, window](MirWindow*)
301+ {
302+ enqueue_work([this, window]
303+ {
304+ std::lock_guard<decltype(mutex)> lock{mutex};
305+ window_to_titlebar.erase(window);
306+ });
307+ };
308+ }
309 }
310 }
311
312
313=== modified file 'miral-shell/shell_main.cpp'
314--- miral-shell/shell_main.cpp 2017-03-02 13:47:28 +0000
315+++ miral-shell/shell_main.cpp 2017-03-16 18:12:17 +0000
316@@ -82,7 +82,7 @@
317 return runner.run_with(
318 {
319 CommandLineOption{[&](std::string const& ) { },
320- "desktop_file_hint", "Ignored for Unity8 compatability", "miral-shell.desktop"},
321+ "desktop_file_hint", "Ignored for Unity8 compatibility", "miral-shell.desktop"},
322 CursorTheme{"default"},
323 window_managers,
324 display_configuration_options,
325
326=== modified file 'miral-shell/spinner/miregl.h'
327--- miral-shell/spinner/miregl.h 2017-02-14 11:49:59 +0000
328+++ miral-shell/spinner/miregl.h 2017-03-16 18:12:17 +0000
329@@ -50,8 +50,6 @@
330 swap_buffers();
331 }
332
333- MirWindow* mir_window() { return window; }
334-
335 private:
336 void egl_make_current();
337
338
339=== modified file 'miral-shell/tiling_window_manager.h'
340--- miral-shell/tiling_window_manager.h 2017-01-26 11:30:51 +0000
341+++ miral-shell/tiling_window_manager.h 2017-03-16 18:12:17 +0000
342@@ -119,7 +119,6 @@
343
344 void push(std::shared_ptr<void> const& tile);
345 void erase(std::shared_ptr<void> const& tile);
346- auto top() const -> std::shared_ptr<void> const&;
347
348 using Enumerator = std::function<void(std::shared_ptr<void> const& tile)>;
349
350
351=== modified file 'miral/CMakeLists.txt'
352--- miral/CMakeLists.txt 2017-03-02 11:23:44 +0000
353+++ miral/CMakeLists.txt 2017-03-16 18:12:17 +0000
354@@ -47,12 +47,14 @@
355 window_management_options.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_options.h
356 window_specification.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_specification.h
357 internal_client.cpp ${CMAKE_SOURCE_DIR}/include/miral/internal_client.h
358- set_command_line_hander.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_command_line_hander.h
359+ set_command_line_handler.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_command_line_handler.h
360 set_terminator.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_terminator.h
361 set_window_managment_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_managment_policy.h
362 workspace_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/workspace_policy.h
363 window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h
364 window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h
365+ ${CMAKE_SOURCE_DIR}/include/mir/client/blob.h
366+ ${CMAKE_SOURCE_DIR}/include/mir/client/cookie.h
367 ${CMAKE_SOURCE_DIR}/include/mir/client/window_spec.h
368 ${CMAKE_SOURCE_DIR}/include/mir/client/window_id.h
369 ${CMAKE_SOURCE_DIR}/include/mir/client/connection.h
370
371=== modified file 'miral/basic_window_manager.cpp'
372--- miral/basic_window_manager.cpp 2017-03-02 14:29:04 +0000
373+++ miral/basic_window_manager.cpp 2017-03-16 18:12:17 +0000
374@@ -78,20 +78,7 @@
375 if (result)
376 return result;
377
378- struct NullWorkspacePolicy : miral::WorkspacePolicy
379- {
380- void advise_adding_to_workspace(
381- std::shared_ptr<miral::Workspace> const&, std::vector<miral::Window> const&) override
382- {
383- }
384-
385- void advise_removing_from_workspace(
386- std::shared_ptr<miral::Workspace> const&, std::vector<miral::Window> const&) override
387- {
388- }
389- };
390-
391- static NullWorkspacePolicy null_workspace_policy;
392+ static miral::WorkspacePolicy null_workspace_policy;
393
394 return &null_workspace_policy;
395 }
396@@ -1103,29 +1090,35 @@
397 {
398 case mir_window_state_hidden:
399 case mir_window_state_minimized:
400+ window_info.state(value);
401 if (window == active_window())
402 {
403- auto const workspaces_containing_window = workspaces_containing(window);
404-
405- // Try to activate to recently active window of any application
406- mru_active_windows.enumerate([&](Window& candidate)
407- {
408- if (candidate == window)
409- return true;
410- auto const w = candidate;
411- for (auto const& workspace : workspaces_containing(w))
412+ select_active_window(window);
413+
414+ if (window == active_window() || !active_window())
415+ {
416+ auto const workspaces_containing_window = workspaces_containing(window);
417+
418+ // Try to activate to recently active window of any application
419+ mru_active_windows.enumerate([&](Window& candidate)
420 {
421- for (auto const& ww : workspaces_containing_window)
422+ if (candidate == window)
423+ return true;
424+ auto const w = candidate;
425+ for (auto const& workspace : workspaces_containing(w))
426 {
427- if (ww == workspace)
428+ for (auto const& ww : workspaces_containing_window)
429 {
430- return !(select_active_window(w));
431+ if (ww == workspace)
432+ {
433+ return !(select_active_window(w));
434+ }
435 }
436 }
437- }
438
439- return true;
440- });
441+ return true;
442+ });
443+ }
444
445 // Try to activate to recently active window of any application
446 if (window == active_window() || !active_window())
447@@ -1141,7 +1134,6 @@
448 select_active_window({});
449 }
450
451- window_info.state(value);
452 mir_surface->configure(mir_window_attrib_state, value);
453 mir_surface->hide();
454
455@@ -1218,11 +1210,10 @@
456
457 for (auto const& child : info_for_hint.children())
458 {
459- if (std::shared_ptr<mir::scene::Surface> surface = child)
460- {
461- if (surface->type() == mir_window_type_dialog && surface->visible())
462- return select_active_window(child);
463- }
464+ auto const& info_for_child = info_for(child);
465+
466+ if (info_for_child.type() == mir_window_type_dialog && info_for_child.is_visible())
467+ return select_active_window(child);
468 }
469
470 if (info_for_hint.can_be_active() && info_for_hint.is_visible())
471
472=== renamed file 'miral/set_command_line_hander.cpp' => 'miral/set_command_line_handler.cpp'
473--- miral/set_command_line_hander.cpp 2016-08-17 08:40:51 +0000
474+++ miral/set_command_line_handler.cpp 2017-03-16 18:12:17 +0000
475@@ -16,7 +16,7 @@
476 * Authored by: Alan Griffiths <alan@octopull.co.uk>
477 */
478
479-#include "miral/set_command_line_hander.h"
480+#include "miral/set_command_line_handler.h"
481
482 #include <mir/server.h>
483
484
485=== modified file 'miral/set_window_managment_policy.cpp'
486--- miral/set_window_managment_policy.cpp 2016-09-29 10:06:22 +0000
487+++ miral/set_window_managment_policy.cpp 2017-03-16 18:12:17 +0000
488@@ -19,6 +19,7 @@
489 #include "miral/set_window_managment_policy.h"
490 #include "basic_window_manager.h"
491 #include "window_management_trace.h"
492+#include "both_versions.h"
493
494 #include <mir/server.h>
495 #include <mir/options/option.h>
496@@ -31,14 +32,30 @@
497 char const* const trace_option = "window-management-trace";
498 }
499
500-miral::SetWindowManagmentPolicy::SetWindowManagmentPolicy(WindowManagementPolicyBuilder const& builder) :
501+MIRAL_BOTH_VERSIONS(
502+ _ZN5miral24SetWindowManagmentPolicyC1ERKSt8functionIFSt10unique_ptrINS_22WindowManagementPolicyESt14default_deleteIS3_EERKNS_18WindowManagerToolsEEE,
503+ _ZN5miral25SetWindowManagementPolicyC1ERKSt8functionIFSt10unique_ptrINS_22WindowManagementPolicyESt14default_deleteIS3_EERKNS_18WindowManagerToolsEEE)
504+
505+MIRAL_BOTH_VERSIONS(
506+ _ZNK5miral24SetWindowManagmentPolicyclERN3mir6ServerE,
507+ _ZNK5miral25SetWindowManagementPolicyclERN3mir6ServerE)
508+
509+MIRAL_BOTH_VERSIONS(
510+ _ZN5miral24SetWindowManagmentPolicyD1Ev,
511+ _ZN5miral25SetWindowManagementPolicyD1Ev)
512+
513+MIRAL_BOTH_VERSIONS(
514+ _ZN5miral24SetWindowManagmentPolicyD2Ev,
515+ _ZN5miral25SetWindowManagementPolicyD2Ev)
516+
517+miral::SetWindowManagementPolicy::SetWindowManagementPolicy(WindowManagementPolicyBuilder const& builder) :
518 builder{builder}
519 {
520 }
521
522-miral::SetWindowManagmentPolicy::~SetWindowManagmentPolicy() = default;
523+miral::SetWindowManagementPolicy::~SetWindowManagementPolicy() = default;
524
525-void miral::SetWindowManagmentPolicy::operator()(mir::Server& server) const
526+void miral::SetWindowManagementPolicy::operator()(mir::Server& server) const
527 {
528 server.add_configuration_option(trace_option, "log trace message", mir::OptionType::null);
529
530
531=== modified file 'miral/symbols.map'
532--- miral/symbols.map 2017-03-02 17:40:20 +0000
533+++ miral/symbols.map 2017-03-16 18:12:17 +0000
534@@ -390,3 +390,14 @@
535 vtable?for?miral::WorkspacePolicy;
536 };
537 } MIRAL_1.2;
538+
539+MIRAL_1.3.1 {
540+global:
541+ extern "C++" {
542+ miral::SetWindowManagementPolicy::?SetWindowManagementPolicy*;
543+ miral::SetWindowManagementPolicy::SetWindowManagementPolicy*;
544+ miral::SetWindowManagementPolicy::operator*;
545+ typeinfo?for?miral::SetWindowManagementPolicy;
546+ vtable?for?miral::SetWindowManagementPolicy;
547+ };
548+} MIRAL_1.3;
549
550=== modified file 'scripts/process_doxygen_xml.py'
551--- scripts/process_doxygen_xml.py 2017-02-15 17:32:34 +0000
552+++ scripts/process_doxygen_xml.py 2017-03-16 18:12:17 +0000
553@@ -453,10 +453,33 @@
554
555 MIRAL_1.3 {
556 global:
557+ extern "C++" {
558+ miral::WindowManagerTools::add_tree_to_workspace*;
559+ miral::WindowManagerTools::create_workspace*;
560+ miral::WindowManagerTools::focus_prev_within_application*;
561+ miral::WindowManagerTools::for_each_window_in_workspace*;
562+ miral::WindowManagerTools::for_each_workspace_containing*;
563+ miral::WindowManagerTools::remove_tree_from_workspace*;
564+ miral::WindowManagerTools::move_workspace_content_to_workspace*;
565+ miral::WorkspacePolicy::?WorkspacePolicy*;
566+ miral::WorkspacePolicy::WorkspacePolicy*;
567+ miral::WorkspacePolicy::advise_adding_to_workspace*;
568+ miral::WorkspacePolicy::advise_removing_from_workspace*;
569+ miral::WorkspacePolicy::operator*;
570+ non-virtual?thunk?to?miral::WorkspacePolicy::?WorkspacePolicy*;
571+ non-virtual?thunk?to?miral::WorkspacePolicy::advise_adding_to_workspace*;
572+ non-virtual?thunk?to?miral::WorkspacePolicy::advise_removing_from_workspace*;
573+ typeinfo?for?miral::WorkspacePolicy;
574+ vtable?for?miral::WorkspacePolicy;
575+ };
576+} MIRAL_1.2;
577+
578+MIRAL_1.3.1 {
579+global:
580 extern "C++" {'''
581
582 END_NEW_STANZA = ''' };
583-} MIRAL_1.2;'''
584+} MIRAL_1.3;'''
585
586 def _print_report():
587 print OLD_STANZAS
588
589=== modified file 'tasks_for_the_interested_reader.md'
590--- tasks_for_the_interested_reader.md 2017-02-10 10:19:22 +0000
591+++ tasks_for_the_interested_reader.md 2017-03-16 18:12:17 +0000
592@@ -65,7 +65,7 @@
593
594 - Add a titlebar to the top of the screen. The titlebar should be split evenly
595 into horizontal blocks, one per tile. Each block containing the title of the
596- top-level window. The focussed tile is highlighted. Clicking on a title
597+ top-level window. The focused tile is highlighted. Clicking on a title
598 selects the corresponding window.
599
600 Art Resource
601
602=== modified file 'test/active_window.cpp'
603--- test/active_window.cpp 2017-03-02 17:35:05 +0000
604+++ test/active_window.cpp 2017-03-16 18:12:17 +0000
605@@ -28,6 +28,7 @@
606 #include <mir/test/signal.h>
607
608 #include <gtest/gtest.h>
609+#include <gmock/gmock.h>
610
611 using namespace testing;
612 using namespace mir::client;
613@@ -35,7 +36,7 @@
614 using miral::WindowManagerTools;
615
616 #if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
617-auto const mir_window_set_state = mir_surface_set_state;
618+auto const mir_event_type_window = mir_event_type_surface;
619 auto const mir_window_event_get_attribute = mir_surface_event_get_attribute;
620 auto const mir_event_get_window_event = mir_event_get_surface_event;
621 #endif
622@@ -359,3 +360,39 @@
623
624 assert_active_window_is(test_name);
625 }
626+
627+// lp:1671072
628+TEST_F(ActiveWindow, hiding_active_dialog_makes_parent_active)
629+{
630+ char const* const parent_name = __PRETTY_FUNCTION__;
631+ auto const dialog_name = "dialog";
632+ auto const connection = connect_client(parent_name);
633+
634+ auto const parent = create_surface(connection, parent_name, sync1);
635+ auto const dialog = create_dialog(connection, dialog_name, parent, sync2);
636+
637+ sync1.exec([&]{ mir_window_set_state(dialog, mir_window_state_hidden); });
638+
639+ EXPECT_TRUE(sync1.signal_raised());
640+
641+ assert_active_window_is(parent_name);
642+}
643+
644+TEST_F(ActiveWindow, when_another_window_is_about_hiding_active_dialog_makes_parent_active)
645+{
646+ FocusChangeSync sync3;
647+ char const* const parent_name = __PRETTY_FUNCTION__;
648+ auto const dialog_name = "dialog";
649+ auto const another_window_name = "another window";
650+ auto const connection = connect_client(parent_name);
651+
652+ auto const parent = create_surface(connection, parent_name, sync1);
653+ auto const another_window = create_surface(connection, another_window_name, sync2);
654+ auto const dialog = create_dialog(connection, dialog_name, parent, sync3);
655+
656+ sync1.exec([&]{ mir_window_set_state(dialog, mir_window_state_hidden); });
657+
658+ EXPECT_TRUE(sync1.signal_raised());
659+
660+ assert_active_window_is(parent_name);
661+}
662
663=== modified file 'test/display_reconfiguration.cpp'
664--- test/display_reconfiguration.cpp 2017-01-13 18:17:01 +0000
665+++ test/display_reconfiguration.cpp 2017-03-16 18:12:17 +0000
666@@ -34,8 +34,6 @@
667 Rectangle const display_area{{display_left, display_top},
668 {display_width, display_height}};
669
670-auto const null_window = Window{};
671-
672 struct DisplayConfiguration : TestWindowManagerTools
673 {
674 Size const initial_window_size{600, 400};
675
676=== modified file 'test/drag_active_window.cpp'
677--- test/drag_active_window.cpp 2017-02-02 17:18:42 +0000
678+++ test/drag_active_window.cpp 2017-03-16 18:12:17 +0000
679@@ -34,8 +34,6 @@
680 Rectangle const display_area{{display_left, display_top},
681 {display_width, display_height}};
682
683-auto const null_window = Window{};
684-
685 struct DragActiveWindow : TestWindowManagerTools, WithParamInterface<MirWindowType>
686 {
687 Size const initial_parent_size{600, 400};
688
689=== modified file 'test/modify_window_state.cpp'
690--- test/modify_window_state.cpp 2017-01-13 18:17:01 +0000
691+++ test/modify_window_state.cpp 2017-03-16 18:12:17 +0000
692@@ -34,8 +34,6 @@
693 Rectangle const display_area{{display_left, display_top},
694 {display_width, display_height}};
695
696-auto const null_window = Window{};
697-
698 struct ModifyWindowState : TestWindowManagerTools, WithParamInterface<MirWindowType>
699 {
700 Size const initial_parent_size{600, 400};
701
702=== modified file 'test/raise_tree.cpp'
703--- test/raise_tree.cpp 2017-01-20 15:02:54 +0000
704+++ test/raise_tree.cpp 2017-03-16 18:12:17 +0000
705@@ -35,21 +35,11 @@
706 {
707 Size const initial_parent_size{600, 400};
708 Size const initial_child_size{300, 300};
709- Rectangle const rectangle_away_from_rhs{{20, 20}, {20, 20}};
710- Rectangle const rectangle_near_rhs{{590, 20}, {10, 20}};
711- Rectangle const rectangle_away_from_bottom{{20, 20}, {20, 20}};
712- Rectangle const rectangle_near_bottom{{20, 380}, {20, 20}};
713- Rectangle const rectangle_near_both_sides{{0, 20}, {600, 20}};
714- Rectangle const rectangle_near_both_sides_and_bottom{{0, 380}, {600, 20}};
715- Rectangle const rectangle_near_all_sides{{0, 20}, {600, 380}};
716- Rectangle const rectangle_near_both_bottom_right{{400, 380}, {200, 20}};
717
718 Window parent;
719 Window child;
720 Window another_window;
721
722- WindowSpecification modification;
723-
724 void SetUp() override
725 {
726 basic_window_manager.add_display(display_area);
727
728=== modified file 'test/window_id.cpp'
729--- test/window_id.cpp 2017-02-14 11:49:59 +0000
730+++ test/window_id.cpp 2017-03-16 18:12:17 +0000
731@@ -93,12 +93,12 @@
732 using namespace mir::client;
733
734 auto const connection = connect_client(test_name);
735- auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
736+ auto const spec = WindowSpec::for_normal_window(connection, 50, 50, mir_pixel_format_argb_8888)
737 .set_name(test_name);
738
739- Window const surface{spec.create_surface()};
740+ Window const surface{spec.create_window()};
741
742- mir::client::PersistentId client_surface_id{surface};
743+ mir::client::WindowId client_surface_id{surface};
744
745 invoke_tools([&](miral::WindowManagerTools& tools)
746 {
747@@ -112,14 +112,14 @@
748 using namespace mir::client;
749
750 auto const connection = connect_client(test_name);
751- auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
752+ auto const spec = WindowSpec::for_normal_window(connection, 50, 50, mir_pixel_format_argb_8888)
753 .set_name(test_name);
754
755- Window const surface{spec.create_surface()};
756-
757- mir::client::PersistentId client_surface_id{surface};
758-
759- invoke_tools([](miral::WindowManagerTools& tools)
760+ Window const surface{spec.create_window()};
761+
762+ mir::client::WindowId client_surface_id{surface};
763+
764+ invoke_tools([&](miral::WindowManagerTools& tools)
765 {
766 auto window = get_first_window(tools);
767 EXPECT_THROW(tools.id_for_window(window), std::runtime_error);
768
769=== modified file 'test/workspaces.cpp'
770--- test/workspaces.cpp 2017-03-02 10:25:27 +0000
771+++ test/workspaces.cpp 2017-03-16 18:12:17 +0000
772@@ -36,11 +36,6 @@
773
774 namespace
775 {
776-#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
777-auto const mir_window_get_buffer_stream = mir_surface_get_buffer_stream;
778-auto const mir_window_set_state = mir_surface_set_state;
779-#endif
780-
781 std::string const top_level{"top level"};
782 std::string const dialog{"dialog"};
783 std::string const tip{"tip"};

Subscribers

People subscribed via source and target branches