Merge lp:~mir-team/miral/miral-0.26 into lp:miral/release

Proposed by Cemil Azizoglu
Status: Merged
Approved by: Cemil Azizoglu
Approved revision: 497
Merged at revision: 351
Proposed branch: lp:~mir-team/miral/miral-0.26
Merge into: lp:miral/release
Diff against target: 4244 lines (+1486/-502)
52 files modified
CMakeLists.txt (+13/-9)
debian/changelog (+17/-0)
debian/control (+1/-0)
debian/libmiral2.symbols (+8/-1)
include/miral/canonical_window_manager.h (+1/-2)
include/miral/detail/mir_forward_compatibility.h (+42/-0)
include/miral/toolkit/persistent_id.h (+11/-1)
include/miral/toolkit/window.h (+21/-14)
include/miral/toolkit/window_spec.h (+136/-43)
include/miral/window_info.h (+6/-6)
include/miral/window_management_policy.h (+5/-3)
include/miral/window_specification.h (+5/-5)
miral-kiosk/kiosk_window_manager.cpp (+4/-4)
miral-kiosk/sw_splash.cpp (+28/-3)
miral-shell/miral-screencast.sh (+3/-1)
miral-shell/spinner/eglapp.cpp (+37/-1)
miral-shell/spinner/miregl.cpp (+58/-23)
miral-shell/spinner/miregl.h (+4/-4)
miral-shell/tiling_window_manager.cpp (+16/-16)
miral-shell/tiling_window_manager.h (+3/-3)
miral-shell/titlebar_provider.cpp (+28/-16)
miral-shell/titlebar_provider.h (+4/-4)
miral-shell/titlebar_window_manager.cpp (+12/-12)
miral-shell/titlebar_window_manager.h (+3/-3)
miral/CMakeLists.txt (+4/-3)
miral/active_outputs.cpp (+5/-0)
miral/basic_window_manager.cpp (+118/-115)
miral/basic_window_manager.h (+2/-2)
miral/both_versions.h (+48/-0)
miral/canonical_window_manager.cpp (+8/-1)
miral/coordinate_translator.cpp (+5/-0)
miral/coordinate_translator.h (+10/-0)
miral/keymap.cpp (+8/-1)
miral/symbols.map (+41/-5)
miral/window_info.cpp (+66/-51)
miral/window_management_policy.cpp (+6/-1)
miral/window_management_trace.cpp (+97/-45)
miral/window_management_trace.h (+2/-2)
miral/window_specification.cpp (+6/-6)
scripts/process_doxygen_xml.py (+346/-3)
test/CMakeLists.txt (+10/-7)
test/active_window.cpp (+53/-16)
test/display_reconfiguration.cpp (+4/-4)
test/drag_active_window.cpp (+2/-2)
test/modify_window_state.cpp (+15/-15)
test/persistent_surface_store.cpp (+12/-12)
test/raise_tree.cpp (+95/-0)
test/select_active_window.cpp (+6/-6)
test/test_window_manager_tools.h (+14/-13)
test/window_placement.cpp (+3/-3)
test/window_placement_anchors_to_parent.cpp (+1/-1)
test/window_placement_client_api.cpp (+33/-14)
To merge this branch: bzr merge lp:~mir-team/miral/miral-0.26
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Review via email: mp+315599@code.launchpad.net

Commit message

Adaptations for Mir 0.26.

Description of the change

Adaptations for Mir 0.26.

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) :
review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The hack for generating backward-compatible synonyms fails to account for the case of building against earlier versions of Mir. In which case it fails to generate forward-compatible synonyms.

That is, MirAL 1.1 built against Mir 0.25 is not ABI compatible with MirAL 1.1 built against Mir 0.26.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> The hack for generating backward-compatible synonyms fails to account for the
> case of building against earlier versions of Mir. In which case it fails to
> generate forward-compatible synonyms.
>
> That is, MirAL 1.1 built against Mir 0.25 is not ABI compatible with MirAL 1.1
> built against Mir 0.26.

I've an MP against lp:miral that addresses this. My preference would be to land that (and anything else that's been approved) and re-sync this release branch.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTM now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-01-18 18:15:55 +0000
+++ CMakeLists.txt 2017-01-26 16:46:42 +0000
@@ -1,4 +1,4 @@
1cmake_minimum_required(VERSION 3.0)1cmake_minimum_required(VERSION 3.1)
2project(miral)2project(miral)
33
4if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)4if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -16,16 +16,20 @@
16set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)16set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
17set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)17set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
1818
19set(CMAKE_CXX_STANDARD 14)
20set(CMAKE_CXX_STANDARD_REQUIRED on)
21set(CMAKE_CXX_EXTENSIONS off)
22
23set(CMAKE_C_STANDARD 99)
24set(CMAKE_C_STANDARD_REQUIRED on)
25set(CMAKE_C_EXTENSIONS off)
26
19set(MIRAL_COMPILER_FLAGS "-pthread -g -Werror -Wall -pedantic -Wextra -fPIC")27set(MIRAL_COMPILER_FLAGS "-pthread -g -Werror -Wall -pedantic -Wextra -fPIC")
20set(MIRAL_LINKER_FLAGS "-Wl,-z,defs")28set(MIRAL_LINKER_FLAGS "-Wl,-z,defs")
2129
22check_cxx_compiler_flag(-Wno-mismatched-tags MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS)
23if (MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS)
24 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-mismatched-tags")
25endif()
26
27set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MIRAL_COMPILER_FLAGS}")30set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MIRAL_COMPILER_FLAGS}")
28set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MIRAL_COMPILER_FLAGS} -Wnon-virtual-dtor -std=c++14")31set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MIRAL_COMPILER_FLAGS} -Wnon-virtual-dtor")
32set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long") # fix spurious FTBFS on X+O
29set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}")33set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}")
30set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}")34set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}")
31set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}")35set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MIRAL_LINKER_FLAGS}")
@@ -37,8 +41,8 @@
37include_directories(include SYSTEM ${MIRCLIENT_INCLUDE_DIRS})41include_directories(include SYSTEM ${MIRCLIENT_INCLUDE_DIRS})
3842
39set(MIRAL_VERSION_MAJOR 1)43set(MIRAL_VERSION_MAJOR 1)
40set(MIRAL_VERSION_MINOR 0)44set(MIRAL_VERSION_MINOR 1)
41set(MIRAL_VERSION_PATCH 2)45set(MIRAL_VERSION_PATCH 0)
4246
43set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH})47set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH})
4448
4549
=== modified file 'debian/changelog'
--- debian/changelog 2017-01-18 18:17:47 +0000
+++ debian/changelog 2017-01-26 16:46:42 +0000
@@ -1,3 +1,20 @@
1miral (1.1.0) UNRELEASED; urgency=medium
2
3 * New upstream release 1.1.0 (https://launchpad.net/miral/+milestone/1.1)
4 - ABI summary:
5 . miral ABI unchanged at 2
6 - Enhancements:
7 . Compatibility with Mir 0.26 and update API to use the new Mir types and
8 enums.
9 . Logging of exceptions added to --window-management-trace
10 . Rename WindowManagementPolicy::place_new_surface => place_new_window"
11 - Bugs fixed:
12 . top-level window is not raised along with its child (LP: #1658085)
13 . miral-shell depends on default cursor theme being installed
14 (LP: #1658159)
15
16 -- Alan Griffiths <alan.griffiths@canonical.com> Wed, 14 Dec 2016 16:31:08 +0000
17
1miral (1.0.2+17.04.20170118.1-0ubuntu1) zesty; urgency=medium18miral (1.0.2+17.04.20170118.1-0ubuntu1) zesty; urgency=medium
219
3 * New upstream release 1.0.1 (https://launchpad.net/miral/+milestone/1.0)20 * New upstream release 1.0.1 (https://launchpad.net/miral/+milestone/1.0)
421
=== modified file 'debian/control'
--- debian/control 2016-12-20 15:45:29 +0000
+++ debian/control 2017-01-26 16:46:42 +0000
@@ -63,6 +63,7 @@
63Architecture: linux-any63Architecture: linux-any
64Depends: ${misc:Depends},64Depends: ${misc:Depends},
65 ${shlibs:Depends},65 ${shlibs:Depends},
66Recommends: dmz-cursor-theme,
66Description: Display server for Ubuntu - demonstration programs67Description: Display server for Ubuntu - demonstration programs
67 MirAL provides an ABI-stable abstraction layer for Mir based shells,68 MirAL provides an ABI-stable abstraction layer for Mir based shells,
68 insulating them from mirserver ABI breaks.69 insulating them from mirserver ABI breaks.
6970
=== modified file 'debian/libmiral2.symbols'
--- debian/libmiral2.symbols 2016-12-13 13:07:15 +0000
+++ debian/libmiral2.symbols 2017-01-26 16:46:42 +0000
@@ -354,4 +354,11 @@
354 (c++)"typeinfo for miral::CanonicalWindowManagerPolicy@MIRAL_1.0" 1.0.0354 (c++)"typeinfo for miral::CanonicalWindowManagerPolicy@MIRAL_1.0" 1.0.0
355 (c++)"vtable for miral::ActiveOutputsListener@MIRAL_1.0" 1.0.0355 (c++)"vtable for miral::ActiveOutputsListener@MIRAL_1.0" 1.0.0
356 (c++)"vtable for miral::WindowManagementPolicy@MIRAL_1.0" 1.0.0356 (c++)"vtable for miral::WindowManagementPolicy@MIRAL_1.0" 1.0.0
357 (c++)"vtable for miral::CanonicalWindowManagerPolicy@MIRAL_1.0" 1.0.0
358\ No newline at end of file357\ No newline at end of file
358 (c++)"vtable for miral::CanonicalWindowManagerPolicy@MIRAL_1.0" 1.0.0
359 MIRAL_1.1@MIRAL_1.1 1.1.0
360 (c++)"miral::WindowInfo::needs_titlebar(MirWindowType)@MIRAL_1.1" 1.1.0
361 (c++)"miral::WindowInfo::type(MirWindowType)@MIRAL_1.1" 1.1.0
362 (c++)"miral::WindowInfo::state(MirWindowState)@MIRAL_1.1" 1.1.0
363 (c++)"miral::WindowManagementPolicy::advise_state_change(miral::WindowInfo const&, MirWindowState)@MIRAL_1.1" 1.1.0
364 (c++)"miral::WindowInfo::can_morph_to(MirWindowType) const@MIRAL_1.1" 1.1.0
365 (c++)"miral::CanonicalWindowManagerPolicy::place_new_window(miral::ApplicationInfo const&, miral::WindowSpecification const&)@MIRAL_1.1" 1.1.0
359\ No newline at end of file366\ No newline at end of file
360367
=== modified file 'include/miral/canonical_window_manager.h'
--- include/miral/canonical_window_manager.h 2016-12-05 09:46:35 +0000
+++ include/miral/canonical_window_manager.h 2017-01-26 16:46:42 +0000
@@ -31,8 +31,7 @@
3131
32 explicit CanonicalWindowManagerPolicy(WindowManagerTools const& tools);32 explicit CanonicalWindowManagerPolicy(WindowManagerTools const& tools);
3333
34 /// places the surfaces as requested34 auto place_new_window(
35 auto place_new_surface(
36 ApplicationInfo const& app_info,35 ApplicationInfo const& app_info,
37 WindowSpecification const& request_parameters)36 WindowSpecification const& request_parameters)
38 -> WindowSpecification override;37 -> WindowSpecification override;
3938
=== modified file 'include/miral/detail/mir_forward_compatibility.h'
--- include/miral/detail/mir_forward_compatibility.h 2016-09-23 13:59:34 +0000
+++ include/miral/detail/mir_forward_compatibility.h 2017-01-26 16:46:42 +0000
@@ -20,8 +20,50 @@
20#define MIRAL_MIR_FORWARD_COMPATIBILITY_H20#define MIRAL_MIR_FORWARD_COMPATIBILITY_H
2121
22#include <mir_toolkit/version.h>22#include <mir_toolkit/version.h>
23#include <mir_toolkit/common.h>
23#include <miral/detail/mir_features.h>24#include <miral/detail/mir_features.h>
2425
26#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
27using MirWindowAttrib = MirSurfaceAttrib;
28auto const mir_window_attrib_type = mir_surface_attrib_type;
29auto const mir_window_attrib_state = mir_surface_attrib_state;
30auto const mir_window_attrib_swapinterval = mir_surface_attrib_swapinterval;
31auto const mir_window_attrib_focus = mir_surface_attrib_focus;
32auto const mir_window_attrib_dpi = mir_surface_attrib_dpi;
33auto const mir_window_attrib_visibility = mir_surface_attrib_visibility;
34auto const mir_window_attrib_preferred_orientation = mir_surface_attrib_preferred_orientation;
35auto const mir_window_attribs = mir_surface_attribs;
36
37using MirWindowType = MirSurfaceType;
38auto const mir_window_type_normal = mir_surface_type_normal;
39auto const mir_window_type_utility = mir_surface_type_utility;
40auto const mir_window_type_dialog = mir_surface_type_dialog;
41auto const mir_window_type_gloss = mir_surface_type_gloss;
42auto const mir_window_type_freestyle = mir_surface_type_freestyle;
43auto const mir_window_type_menu = mir_surface_type_menu;
44auto const mir_window_type_inputmethod = mir_surface_type_inputmethod;
45auto const mir_window_type_satellite = mir_surface_type_satellite;
46auto const mir_window_type_tip = mir_surface_type_tip;
47auto const mir_window_types = mir_surface_types;
48
49using MirWindowState = MirSurfaceState;
50auto const mir_window_state_unknown = mir_surface_state_unknown;
51auto const mir_window_state_restored = mir_surface_state_restored;
52auto const mir_window_state_minimized = mir_surface_state_minimized;
53auto const mir_window_state_maximized = mir_surface_state_maximized;
54auto const mir_window_state_vertmaximized = mir_surface_state_vertmaximized;
55auto const mir_window_state_fullscreen = mir_surface_state_fullscreen;
56auto const mir_window_state_horizmaximized = mir_surface_state_horizmaximized;
57auto const mir_window_state_hidden = mir_surface_state_hidden;
58auto const mir_window_states = mir_surface_states;
59
60typedef struct MirSurface MirWindow;
61typedef struct MirSurfaceParameters MirWindowParameters;
62typedef struct MirSurfacePlacementEvent MirWindowPlacementEvent;
63typedef struct MirSurfaceSpec MirWindowSpec;
64#endif
65
66
25// Types that don't exist in earlier versions of Mir's toolkit67// Types that don't exist in earlier versions of Mir's toolkit
26#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 4, 0)68#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 4, 0)
2769
2870
=== modified file 'include/miral/toolkit/persistent_id.h'
--- include/miral/toolkit/persistent_id.h 2016-08-11 10:53:11 +0000
+++ include/miral/toolkit/persistent_id.h 2017-01-26 16:46:42 +0000
@@ -19,7 +19,13 @@
19#ifndef MIRAL_TOOLKIT_PERSISTENT_ID_H19#ifndef MIRAL_TOOLKIT_PERSISTENT_ID_H
20#define MIRAL_TOOLKIT_PERSISTENT_ID_H20#define MIRAL_TOOLKIT_PERSISTENT_ID_H
2121
22#include <miral/detail/mir_forward_compatibility.h>
23#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
22#include <mir_toolkit/mir_surface.h>24#include <mir_toolkit/mir_surface.h>
25#else
26#include <mir_toolkit/mir_window.h>
27#include <mir_toolkit/mir_persistent_id.h>
28#endif
2329
24#include <memory>30#include <memory>
2531
@@ -32,7 +38,11 @@
32{38{
33public:39public:
34 explicit PersistentId(MirPersistentId* id) : self{id, deleter} {}40 explicit PersistentId(MirPersistentId* id) : self{id, deleter} {}
35 explicit PersistentId(MirSurface* surface) : PersistentId{mir_surface_request_persistent_id_sync(surface)} {}41#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
42 explicit PersistentId(MirWindow* surface) : PersistentId{mir_surface_request_persistent_id_sync(surface)} {}
43#else
44 explicit PersistentId(MirWindow* surface) : PersistentId{mir_window_request_persistent_id_sync(surface)} {}
45#endif
3646
37 auto c_str() const -> char const* { return mir_persistent_id_as_string(self.get()); }47 auto c_str() const -> char const* { return mir_persistent_id_as_string(self.get()); }
3848
3949
=== renamed file 'include/miral/toolkit/surface.h' => 'include/miral/toolkit/window.h'
--- include/miral/toolkit/surface.h 2016-09-13 17:09:04 +0000
+++ include/miral/toolkit/window.h 2017-01-26 16:46:42 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2016 Canonical Ltd.2 * Copyright © 2016-2017 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU General Public License version 3,
@@ -16,10 +16,17 @@
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */17 */
1818
19#ifndef MIRAL_TOOLKIT_SURFACE_H19#ifndef MIRAL_TOOLKIT_WINDOW_H
20#define MIRAL_TOOLKIT_SURFACE_H20#define MIRAL_TOOLKIT_WINDOW_H
2121
22#include <miral/detail/mir_forward_compatibility.h>
23
24#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
22#include <mir_toolkit/mir_surface.h>25#include <mir_toolkit/mir_surface.h>
26auto const mir_window_release_sync = mir_surface_release_sync;
27#else
28#include <mir_toolkit/mir_window.h>
29#endif
2330
24#include <memory>31#include <memory>
2532
@@ -27,23 +34,23 @@
27{34{
28namespace toolkit35namespace toolkit
29{36{
30/// Handle class for MirSurface - provides automatic reference counting.37/// Handle class for MirWindow - provides automatic reference counting.
31class Surface38class Window
32{39{
33public:40public:
34 Surface() = default;41 Window() = default;
35 explicit Surface(MirSurface* spec) : self{spec, deleter} {}42 explicit Window(MirWindow* spec) : self{spec, deleter} {}
3643
3744
38 operator MirSurface*() const { return self.get(); }45 operator MirWindow*() const { return self.get(); }
3946
40 void reset() { self.reset(); }47 void reset() { self.reset(); }
4148
42private:49private:
43 static void deleter(MirSurface* surface) { mir_surface_release_sync(surface); }50 static void deleter(MirWindow* window) { mir_window_release_sync(window); }
44 std::shared_ptr<MirSurface> self;51 std::shared_ptr<MirWindow> self;
45};52};
46}53}
47}54}
4855
49#endif //MIRAL_TOOLKIT_SURFACE_H56#endif //MIRAL_TOOLKIT_WINDOW_H
5057
=== renamed file 'include/miral/toolkit/surface_spec.h' => 'include/miral/toolkit/window_spec.h'
--- include/miral/toolkit/surface_spec.h 2016-11-30 08:22:39 +0000
+++ include/miral/toolkit/window_spec.h 2017-01-26 16:46:42 +0000
@@ -16,10 +16,11 @@
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */17 */
1818
19#ifndef MIRAL_TOOLKIT_SURFACE_SPEC_H19#ifndef MIRAL_TOOLKIT_WINDOW_SPEC_H
20#define MIRAL_TOOLKIT_SURFACE_SPEC_H20#define MIRAL_TOOLKIT_WINDOW_SPEC_H
2121
22#include <miral/toolkit/surface.h>22#include <miral/toolkit/window.h>
23#include <miral/detail/mir_forward_compatibility.h>
2324
24#include <mir_toolkit/mir_surface.h>25#include <mir_toolkit/mir_surface.h>
25#include <mir_toolkit/mir_connection.h>26#include <mir_toolkit/mir_connection.h>
@@ -31,26 +32,38 @@
31{32{
32namespace toolkit33namespace toolkit
33{34{
34/// Handle class for MirSurfaceSpec - provides automatic reference counting, method chaining.35/// Handle class for MirWindowSpec - provides automatic reference counting, method chaining.
35class SurfaceSpec36class WindowSpec
36{37{
37public:38public:
38 explicit SurfaceSpec(MirSurfaceSpec* spec) : self{spec, deleter} {}39 explicit WindowSpec(MirWindowSpec* spec) : self{spec, deleter} {}
3940
40 static auto for_normal_surface(MirConnection* connection, int width, int height, MirPixelFormat format) -> SurfaceSpec41 static auto for_normal_surface(MirConnection* connection, int width, int height, MirPixelFormat format) -> WindowSpec
41 {42 {
42 return SurfaceSpec{mir_connection_create_spec_for_normal_surface(connection, width, height, format)};43#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
44 return WindowSpec{mir_connection_create_spec_for_normal_surface(connection, width, height, format)};
45#else
46 auto spec = WindowSpec{mir_create_normal_window_spec(connection, width, height)};
47 mir_window_spec_set_pixel_format(spec, format);
48 return spec;
49#endif
43 }50 }
4451
45 static auto for_menu(MirConnection* connection,52 static auto for_menu(MirConnection* connection,
46 int width,53 int width,
47 int height,54 int height,
48 MirPixelFormat format,55 MirPixelFormat format,
49 MirSurface* parent,56 MirWindow* parent,
50 MirRectangle* rect,57 MirRectangle* rect,
51 MirEdgeAttachment edge) -> SurfaceSpec58 MirEdgeAttachment edge) -> WindowSpec
52 {59 {
53 return SurfaceSpec{mir_connection_create_spec_for_menu(connection, width, height, format, parent, rect, edge)};60#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
61 return WindowSpec{mir_connection_create_spec_for_menu(connection, width, height, format, parent, rect, edge)};
62#else
63 auto spec = WindowSpec{mir_create_menu_window_spec(connection, width, height, parent, rect, edge)};
64 mir_window_spec_set_pixel_format(spec, format);
65 return spec;
66#endif
54 }67 }
5568
56#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)69#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)
@@ -58,87 +71,143 @@
58 int width,71 int width,
59 int height,72 int height,
60 MirPixelFormat format,73 MirPixelFormat format,
61 MirSurface* parent,74 MirWindow* parent,
62 MirRectangle* rect,75 MirRectangle* rect,
63 MirEdgeAttachment edge) -> SurfaceSpec76 MirEdgeAttachment edge) -> WindowSpec
64 {77 {
65 return SurfaceSpec{mir_connection_create_spec_for_tip(connection, width, height, format, parent, rect, edge)};78#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
79 return WindowSpec{mir_connection_create_spec_for_tip(connection, width, height, format, parent, rect, edge)};
80#else
81 auto spec = WindowSpec{mir_create_tip_window_spec(connection, width, height, parent, rect, edge)};
82 mir_window_spec_set_pixel_format(spec, format);
83 return spec;
84#endif
66 }85 }
67#endif86#endif
6887
69 static auto for_dialog(MirConnection* connection,88 static auto for_dialog(MirConnection* connection,
70 int width,89 int width,
71 int height,90 int height,
72 MirPixelFormat format)-> SurfaceSpec91 MirPixelFormat format)-> WindowSpec
73 {92 {
74 return SurfaceSpec{mir_connection_create_spec_for_dialog(connection, width, height, format)};93#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
94 return WindowSpec{mir_connection_create_spec_for_dialog(connection, width, height, format)};
95#else
96 auto spec = WindowSpec{mir_create_dialog_window_spec(connection, width, height)};
97 mir_window_spec_set_pixel_format(spec, format);
98 return spec;
99#endif
75 }100 }
76101
77 static auto for_dialog(MirConnection* connection,102 static auto for_dialog(MirConnection* connection,
78 int width,103 int width,
79 int height,104 int height,
80 MirPixelFormat format,105 MirPixelFormat format,
81 MirSurface* parent) -> SurfaceSpec106 MirWindow* parent) -> WindowSpec
82 {107 {
83 return for_dialog(connection, width, height, format).set_parent(parent);108 return for_dialog(connection, width, height, format).set_parent(parent);
84 }109 }
85110
86 static auto for_changes(MirConnection* connection) -> SurfaceSpec111 static auto for_changes(MirConnection* connection) -> WindowSpec
87 {112 {
88 return SurfaceSpec{mir_connection_create_spec_for_changes(connection)};113#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
114 return WindowSpec{mir_connection_create_spec_for_changes(connection)};
115#else
116 return WindowSpec{mir_create_window_spec(connection)};
117#endif
89 }118 }
90119
91 auto set_buffer_usage(MirBufferUsage usage) -> SurfaceSpec&120 auto set_buffer_usage(MirBufferUsage usage) -> WindowSpec&
92 {121 {
122#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
93 mir_surface_spec_set_buffer_usage(*this, usage);123 mir_surface_spec_set_buffer_usage(*this, usage);
124#else
125 mir_window_spec_set_buffer_usage(*this, usage);
126#endif
94 return *this;127 return *this;
95 }128 }
96129
97 auto set_type(MirSurfaceType type) -> SurfaceSpec&130 auto set_type(MirWindowType type) -> WindowSpec&
98 {131 {
132#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
99 mir_surface_spec_set_type(*this, type);133 mir_surface_spec_set_type(*this, type);
134#else
135 mir_window_spec_set_type(*this, type);
136#endif
100 return *this;137 return *this;
101 }138 }
102139
103 auto set_min_size(int min_width, int min_height) -> SurfaceSpec&140 auto set_min_size(int min_width, int min_height) -> WindowSpec&
104 {141 {
142#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
105 mir_surface_spec_set_min_width(*this, min_width);143 mir_surface_spec_set_min_width(*this, min_width);
106 mir_surface_spec_set_min_height(*this, min_height);144 mir_surface_spec_set_min_height(*this, min_height);
145#else
146 mir_window_spec_set_min_width(*this, min_width);
147 mir_window_spec_set_min_height(*this, min_height);
148#endif
107 return *this;149 return *this;
108 }150 }
109151
110 auto set_max_size(int max_width, int max_height) -> SurfaceSpec&152 auto set_max_size(int max_width, int max_height) -> WindowSpec&
111 {153 {
154#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
112 mir_surface_spec_set_max_width(*this, max_width);155 mir_surface_spec_set_max_width(*this, max_width);
113 mir_surface_spec_set_max_height(*this, max_height);156 mir_surface_spec_set_max_height(*this, max_height);
157#else
158 mir_window_spec_set_max_width(*this, max_width);
159 mir_window_spec_set_max_height(*this, max_height);
160#endif
114 return *this;161 return *this;
115 }162 }
116163
117 auto set_size_inc(int width_inc, int height_inc) -> SurfaceSpec&164 auto set_size_inc(int width_inc, int height_inc) -> WindowSpec&
118 {165 {
166#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
119 mir_surface_spec_set_width_increment(*this, width_inc);167 mir_surface_spec_set_width_increment(*this, width_inc);
120 mir_surface_spec_set_height_increment(*this, height_inc);168 mir_surface_spec_set_height_increment(*this, height_inc);
169#else
170 mir_window_spec_set_width_increment(*this, width_inc);
171 mir_window_spec_set_height_increment(*this, height_inc);
172#endif
121 return *this;173 return *this;
122 }174 }
123175
124 auto set_size(int width, int height) -> SurfaceSpec&176 auto set_size(int width, int height) -> WindowSpec&
125 {177 {
178#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
126 mir_surface_spec_set_width(*this, width);179 mir_surface_spec_set_width(*this, width);
127 mir_surface_spec_set_height(*this, height);180 mir_surface_spec_set_height(*this, height);
181#else
182 mir_window_spec_set_width(*this, width);
183 mir_window_spec_set_height(*this, height);
184#endif
128 return *this;185 return *this;
129 }186 }
130187
131 auto set_name(char const* name) -> SurfaceSpec&188 auto set_name(char const* name) -> WindowSpec&
132 {189 {
190#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
133 mir_surface_spec_set_name(*this, name);191 mir_surface_spec_set_name(*this, name);
192#else
193 mir_window_spec_set_name(*this, name);
194#endif
134 return *this;195 return *this;
135 }196 }
136197
137 auto set_event_handler(mir_surface_event_callback callback, void* context) -> SurfaceSpec&198#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
199 auto set_event_handler(mir_surface_event_callback callback, void* context) -> WindowSpec&
138 {200 {
139 mir_surface_spec_set_event_handler(*this, callback, context);201 mir_surface_spec_set_event_handler(*this, callback, context);
140 return *this;202 return *this;
141 }203 }
204#else
205 auto set_event_handler(MirWindowEventCallback callback, void* context) -> WindowSpec&
206 {
207 mir_window_spec_set_event_handler(*this, callback, context);
208 return *this;
209 }
210#endif
142211
143#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)212#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)
144 auto set_placement(const MirRectangle* rect,213 auto set_placement(const MirRectangle* rect,
@@ -146,42 +215,66 @@
146 MirPlacementGravity surface_gravity,215 MirPlacementGravity surface_gravity,
147 MirPlacementHints placement_hints,216 MirPlacementHints placement_hints,
148 int offset_dx,217 int offset_dx,
149 int offset_dy) -> SurfaceSpec&218 int offset_dy) -> WindowSpec&
150 {219 {
220#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
151 mir_surface_spec_set_placement(*this, rect, rect_gravity, surface_gravity, placement_hints, offset_dx, offset_dy);221 mir_surface_spec_set_placement(*this, rect, rect_gravity, surface_gravity, placement_hints, offset_dx, offset_dy);
222#else
223 mir_window_spec_set_placement(*this, rect, rect_gravity, surface_gravity, placement_hints, offset_dx, offset_dy);
224#endif
152 return *this;225 return *this;
153 }226 }
154#endif227#endif
155228
156 auto set_parent(MirSurface* parent) -> SurfaceSpec&229 auto set_parent(MirWindow* parent) -> WindowSpec&
157 {230 {
231#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
158 mir_surface_spec_set_parent(*this, parent);232 mir_surface_spec_set_parent(*this, parent);
233#else
234 mir_window_spec_set_parent(*this, parent);
235#endif
159 return *this;236 return *this;
160 }237 }
161238
162 template<typename Context>239 template<typename Context>
163 void create_surface(void (*callback)(MirSurface*, Context*), Context* context) const240 void create_surface(void (*callback)(MirWindow*, Context*), Context* context) const
164 {241 {
242#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
165 mir_surface_create(*this, reinterpret_cast<mir_surface_callback>(callback), context);243 mir_surface_create(*this, reinterpret_cast<mir_surface_callback>(callback), context);
166 }244#else
167245 mir_create_window(*this, reinterpret_cast<MirWindowCallback>(callback), context);
168 auto create_surface() const -> Surface246#endif
169 {247 }
170 return Surface{mir_surface_create_sync(*this)};248
171 }249 auto create_surface() const -> Window
172250 {
173 void apply_to(MirSurface* surface) const251#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
174 {252 return Window{mir_surface_create_sync(*this)};
253#else
254 return Window{mir_create_window_sync(*this)};
255#endif
256 }
257
258 void apply_to(MirWindow* surface) const
259 {
260#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
175 mir_surface_apply_spec(surface, *this);261 mir_surface_apply_spec(surface, *this);
262#else
263 mir_window_apply_spec(surface, *this);
264#endif
176 }265 }
177266
178 operator MirSurfaceSpec*() const { return self.get(); }267 operator MirWindowSpec*() const { return self.get(); }
179268
180private:269private:
181 static void deleter(MirSurfaceSpec* spec) { mir_surface_spec_release(spec); }270#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
182 std::shared_ptr<MirSurfaceSpec> self;271 static void deleter(MirWindowSpec* spec) { mir_surface_spec_release(spec); }
272#else
273 static void deleter(MirWindowSpec* spec) { mir_window_spec_release(spec); }
274#endif
275 std::shared_ptr<MirWindowSpec> self;
183};276};
184}277}
185}278}
186279
187#endif //MIRAL_TOOLKIT_SURFACE_SPEC_H_H280#endif //MIRAL_TOOLKIT_WINDOW_SPEC_H_H
188281
=== modified file 'include/miral/window_info.h'
--- include/miral/window_info.h 2016-12-13 13:07:15 +0000
+++ include/miral/window_info.h 2017-01-26 16:46:42 +0000
@@ -41,7 +41,7 @@
4141
42 bool can_be_active() const;42 bool can_be_active() const;
4343
44 bool can_morph_to(MirSurfaceType new_type) const;44 bool can_morph_to(MirWindowType new_type) const;
4545
46 bool must_have_parent() const;46 bool must_have_parent() const;
4747
@@ -49,7 +49,7 @@
4949
50 bool is_visible() const;50 bool is_visible() const;
5151
52 static bool needs_titlebar(MirSurfaceType type);52 static bool needs_titlebar(MirWindowType type);
5353
54 void constrain_resize(mir::geometry::Point& requested_pos, mir::geometry::Size& requested_size) const;54 void constrain_resize(mir::geometry::Point& requested_pos, mir::geometry::Size& requested_size) const;
5555
@@ -58,11 +58,11 @@
58 auto name() const -> std::string;58 auto name() const -> std::string;
59 void name(std::string const& name);59 void name(std::string const& name);
6060
61 auto type() const -> MirSurfaceType;61 auto type() const -> MirWindowType;
62 void type(MirSurfaceType type);62 void type(MirWindowType type);
6363
64 auto state() const -> MirSurfaceState;64 auto state() const -> MirWindowState;
65 void state(MirSurfaceState state);65 void state(MirWindowState state);
6666
67 auto restore_rect() const -> mir::geometry::Rectangle;67 auto restore_rect() const -> mir::geometry::Rectangle;
68 void restore_rect(mir::geometry::Rectangle const& restore_rect);68 void restore_rect(mir::geometry::Rectangle const& restore_rect);
6969
=== modified file 'include/miral/window_management_policy.h'
--- include/miral/window_management_policy.h 2016-12-05 09:46:35 +0000
+++ include/miral/window_management_policy.h 2017-01-26 16:46:42 +0000
@@ -23,6 +23,8 @@
23#include <mir/geometry/rectangles.h>23#include <mir/geometry/rectangles.h>
24#include <mir_toolkit/event.h>24#include <mir_toolkit/event.h>
2525
26#include <miral/detail/mir_forward_compatibility.h>
27
26namespace miral28namespace miral
27{29{
28class Window;30class Window;
@@ -44,11 +46,11 @@
4446
45 /** Customize initial window placement47 /** Customize initial window placement
46 *48 *
47 * @param app_info the application requesting a new surface49 * @param app_info the application requesting a new window
48 * @param requested_specification the requested specification (updated with default placement)50 * @param requested_specification the requested specification (updated with default placement)
49 * @return the customized specification51 * @return the customized specification
50 */52 */
51 virtual auto place_new_surface(53 virtual auto place_new_window(
52 ApplicationInfo const& app_info,54 ApplicationInfo const& app_info,
53 WindowSpecification const& requested_specification) -> WindowSpecification = 0;55 WindowSpecification const& requested_specification) -> WindowSpecification = 0;
5456
@@ -141,7 +143,7 @@
141 * @param window_info the window143 * @param window_info the window
142 * @param state the new state144 * @param state the new state
143 */145 */
144 virtual void advise_state_change(WindowInfo const& window_info, MirSurfaceState state);146 virtual void advise_state_change(WindowInfo const& window_info, MirWindowState state);
145147
146 /** Notification that a window is about to move148 /** Notification that a window is about to move
147 *149 *
148150
=== modified file 'include/miral/window_specification.h'
--- include/miral/window_specification.h 2016-09-30 16:29:43 +0000
+++ include/miral/window_specification.h 2017-01-26 16:46:42 +0000
@@ -21,7 +21,7 @@
2121
22#include <mir_toolkit/common.h>22#include <mir_toolkit/common.h>
2323
24#include "miral/detail/mir_forward_compatibility.h"24#include <miral/detail/mir_forward_compatibility.h>
2525
26#include <mir/geometry/displacement.h>26#include <mir/geometry/displacement.h>
27#include <mir/geometry/rectangles.h>27#include <mir/geometry/rectangles.h>
@@ -76,8 +76,8 @@
76 auto size() const -> mir::optional_value<Size> const&;76 auto size() const -> mir::optional_value<Size> const&;
77 auto name() const -> mir::optional_value<std::string> const&;77 auto name() const -> mir::optional_value<std::string> const&;
78 auto output_id() const -> mir::optional_value<int> const&;78 auto output_id() const -> mir::optional_value<int> const&;
79 auto type() const -> mir::optional_value<MirSurfaceType> const&;79 auto type() const -> mir::optional_value<MirWindowType> const&;
80 auto state() const -> mir::optional_value<MirSurfaceState> const&;80 auto state() const -> mir::optional_value<MirWindowState> const&;
81 auto preferred_orientation() const -> mir::optional_value<MirOrientationMode> const&;81 auto preferred_orientation() const -> mir::optional_value<MirOrientationMode> const&;
82 auto aux_rect() const -> mir::optional_value<Rectangle> const&;82 auto aux_rect() const -> mir::optional_value<Rectangle> const&;
83 auto placement_hints() const -> mir::optional_value<MirPlacementHints> const&;83 auto placement_hints() const -> mir::optional_value<MirPlacementHints> const&;
@@ -104,8 +104,8 @@
104 auto size() -> mir::optional_value<Size>&;104 auto size() -> mir::optional_value<Size>&;
105 auto name() -> mir::optional_value<std::string>&;105 auto name() -> mir::optional_value<std::string>&;
106 auto output_id() -> mir::optional_value<int>&;106 auto output_id() -> mir::optional_value<int>&;
107 auto type() -> mir::optional_value<MirSurfaceType>&;107 auto type() -> mir::optional_value<MirWindowType>&;
108 auto state() -> mir::optional_value<MirSurfaceState>&;108 auto state() -> mir::optional_value<MirWindowState>&;
109 auto preferred_orientation() -> mir::optional_value<MirOrientationMode>&;109 auto preferred_orientation() -> mir::optional_value<MirOrientationMode>&;
110 auto aux_rect() -> mir::optional_value<Rectangle>&;110 auto aux_rect() -> mir::optional_value<Rectangle>&;
111 auto placement_hints() -> mir::optional_value<MirPlacementHints>&;111 auto placement_hints() -> mir::optional_value<MirPlacementHints>&;
112112
=== modified file 'miral-kiosk/kiosk_window_manager.cpp'
--- miral-kiosk/kiosk_window_manager.cpp 2016-11-08 11:16:10 +0000
+++ miral-kiosk/kiosk_window_manager.cpp 2017-01-26 16:46:42 +0000
@@ -125,16 +125,16 @@
125125
126void KioskWindowManagerPolicy::advise_new_window(WindowInfo const& window_info)126void KioskWindowManagerPolicy::advise_new_window(WindowInfo const& window_info)
127{127{
128 // We do this here, not in place_new_surface() so that clients get a resize event.128 // We do this here, not in place_new_window() so that clients get a resize event.
129 // This shouldn't be necessary, but works better with the gtk-mir backend.129 // This shouldn't be necessary, but works better with the gtk-mir backend.
130 if (maximize_root_windows &&130 if (maximize_root_windows &&
131 window_info.type() == mir_surface_type_normal &&131 window_info.type() == mir_window_type_normal &&
132 !window_info.parent() &&132 !window_info.parent() &&
133 window_info.state() == mir_surface_state_restored)133 window_info.state() == mir_window_state_restored)
134 {134 {
135 WindowSpecification specification;135 WindowSpecification specification;
136136
137 specification.state() = mir_surface_state_maximized;137 specification.state() = mir_window_state_maximized;
138138
139 tools.place_and_size_for_state(specification, window_info);139 tools.place_and_size_for_state(specification, window_info);
140 tools.modify_window(window_info.window(), specification);140 tools.modify_window(window_info.window(), specification);
141141
=== modified file 'miral-kiosk/sw_splash.cpp'
--- miral-kiosk/sw_splash.cpp 2016-05-11 11:45:10 +0000
+++ miral-kiosk/sw_splash.cpp 2017-01-26 16:46:42 +0000
@@ -18,8 +18,14 @@
1818
19#include "sw_splash.h"19#include "sw_splash.h"
2020
21#include <miral/detail/mir_forward_compatibility.h>
22
21#include <mir_toolkit/mir_connection.h>23#include <mir_toolkit/mir_connection.h>
24#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
22#include <mir_toolkit/mir_surface.h>25#include <mir_toolkit/mir_surface.h>
26#else
27#include <mir_toolkit/mir_window.h>
28#endif
23#include <mir_toolkit/mir_buffer_stream.h>29#include <mir_toolkit/mir_buffer_stream.h>
2430
25#include <chrono>31#include <chrono>
@@ -59,9 +65,9 @@
59 return *pixel_formats;65 return *pixel_formats;
60}66}
6167
62auto create_surface(MirConnection* connection, MirPixelFormat pixel_format) -> MirSurface*68auto create_window(MirConnection* connection, MirPixelFormat pixel_format) -> MirWindow*
63{69{
6470#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
65 auto* spec = mir_connection_create_spec_for_normal_surface(connection, 42, 42, pixel_format);71 auto* spec = mir_connection_create_spec_for_normal_surface(connection, 42, 42, pixel_format);
6672
67 mir_surface_spec_set_name(spec, "splash");73 mir_surface_spec_set_name(spec, "splash");
@@ -70,6 +76,17 @@
7076
71 auto const surface = mir_surface_create_sync(spec);77 auto const surface = mir_surface_create_sync(spec);
72 mir_surface_spec_release(spec);78 mir_surface_spec_release(spec);
79#else
80 auto* spec = mir_create_normal_window_spec(connection, 42, 42);
81
82 mir_window_spec_set_name(spec, "splash");
83 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
84 mir_window_spec_set_fullscreen_on_output(spec, 0);
85 mir_window_spec_set_pixel_format(spec, pixel_format);
86
87 auto const surface = mir_create_window_sync(spec);
88 mir_window_spec_release(spec);
89#endif
7390
74 return surface;91 return surface;
75}92}
@@ -133,10 +150,14 @@
133 return;150 return;
134 };151 };
135152
136 auto const surface = create_surface(connection, pixel_format);153 auto const surface = create_window(connection, pixel_format);
137154
138 MirGraphicsRegion graphics_region;155 MirGraphicsRegion graphics_region;
156#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
139 MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface);157 MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface);
158#else
159 MirBufferStream* buffer_stream = mir_window_get_buffer_stream(surface);
160#endif
140161
141 auto const time_limit = std::chrono::steady_clock::now() + std::chrono::seconds(2);162 auto const time_limit = std::chrono::steady_clock::now() + std::chrono::seconds(2);
142163
@@ -154,5 +175,9 @@
154 }175 }
155 while (std::chrono::steady_clock::now() < time_limit);176 while (std::chrono::steady_clock::now() < time_limit);
156177
178#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
157 mir_surface_release_sync(surface);179 mir_surface_release_sync(surface);
180#else
181 mir_window_release_sync(surface);
182#endif
158}183}
159184
=== modified file 'miral-shell/miral-screencast.sh'
--- miral-shell/miral-screencast.sh 2016-11-10 15:10:32 +0000
+++ miral-shell/miral-screencast.sh 2017-01-26 16:46:42 +0000
@@ -16,11 +16,13 @@
16 echo " --height set the capture height [${height}]"16 echo " --height set the capture height [${height}]"
17 echo " --output set the output filename [${output}]"17 echo " --output set the output filename [${output}]"
18 echo " --socket set the mir socket [${socket}]"18 echo " --socket set the mir socket [${socket}]"
19 echo " --tmpfile specify the temporary work file"
19 exit 020 exit 0
20 elif [ "$1" == "--socket" ]; then shift; socket=$121 elif [ "$1" == "--socket" ]; then shift; socket=$1
21 elif [ "$1" == "--output" ]; then shift; output=$122 elif [ "$1" == "--output" ]; then shift; output=$1
22 elif [ "$1" == "--width" ]; then shift; width=$123 elif [ "$1" == "--width" ]; then shift; width=$1
23 elif [ "$1" == "--height" ]; then shift; height=$124 elif [ "$1" == "--height" ]; then shift; height=$1
25 elif [ "$1" == "--tmpfile" ]; then shift; tempfile=$1
24 fi26 fi
25 shift27 shift
26done28done
@@ -36,7 +38,7 @@
36if [ -e ${output} ]; then echo "Output exists, moving to ${output}~"; mv ${output} ${output}~ ;fi38if [ -e ${output} ]; then echo "Output exists, moving to ${output}~"; mv ${output} ${output}~ ;fi
37while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done39while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
3840
39tempfile=$(mktemp)41if [ ! -v tempfile ]; then tempfile=$(mktemp); fi
40mirscreencast --size ${width} ${height} -m ${socket} -f ${tempfile}& mirscreencast_pid=$!42mirscreencast --size ${width} ${height} -m ${socket} -f ${tempfile}& mirscreencast_pid=$!
41trap 'kill ${mirscreencast_pid}; rm -f -- "${tempfile}"; exit 0' INT TERM HUP EXIT43trap 'kill ${mirscreencast_pid}; rm -f -- "${tempfile}"; exit 0' INT TERM HUP EXIT
4244
4345
=== modified file 'miral-shell/spinner/eglapp.cpp'
--- miral-shell/spinner/eglapp.cpp 2016-10-07 11:06:14 +0000
+++ miral-shell/spinner/eglapp.cpp 2017-01-26 16:46:42 +0000
@@ -18,6 +18,7 @@
1818
19#include "miregl.h"19#include "miregl.h"
2020
21#include <mir_toolkit/version.h>
2122
2223
23float mir_eglapp_background_opacity = 1.0f;24float mir_eglapp_background_opacity = 1.0f;
@@ -31,6 +32,7 @@
31{32{
32 /* eglapps are interested in the screen size, so33 /* eglapps are interested in the screen size, so
33 use mir_connection_create_display_config */34 use mir_connection_create_display_config */
35#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
34 MirDisplayConfiguration* display_config =36 MirDisplayConfiguration* display_config =
35 mir_connection_create_display_config(connection);37 mir_connection_create_display_config(connection);
3638
@@ -48,6 +50,25 @@
48 }50 }
4951
50 mir_display_config_destroy(display_config);52 mir_display_config_destroy(display_config);
53#else
54 MirDisplayConfig* display_config =
55 mir_connection_create_display_configuration(connection);
56
57 int const n = mir_display_config_get_num_outputs(display_config);
58
59 for (int i = 0; i != n; ++i)
60 {
61 MirOutput const *const output = mir_display_config_get_output(display_config, i);
62 if (mir_output_is_enabled(output) &&
63 mir_output_get_connection_state(output) == mir_output_connection_state_connected &&
64 mir_output_get_num_modes(output) &&
65 mir_output_get_current_mode_index(output) < (size_t)mir_output_get_num_modes(output))
66 {
67 handler(output);
68 }
69 }
70 mir_display_config_release(display_config);
71#endif
51}72}
5273
53MirPixelFormat select_pixel_format(MirConnection* connection)74MirPixelFormat select_pixel_format(MirConnection* connection)
@@ -72,7 +93,7 @@
7293
73std::vector<std::shared_ptr<MirEglSurface>> mir_eglapp_init(MirConnection* const connection)94std::vector<std::shared_ptr<MirEglSurface>> mir_eglapp_init(MirConnection* const connection)
74{95{
75 MirSurfaceParameters surfaceparm =96 MirWindowParameters surfaceparm =
76 {97 {
77 "eglappsurface",98 "eglappsurface",
78 0, 0,99 0, 0,
@@ -108,6 +129,7 @@
108 }129 }
109130
110 // but normally, we're fullscreen on every active output131 // but normally, we're fullscreen on every active output
132#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
111 for_each_active_output(connection, [&](MirDisplayOutput const* output)133 for_each_active_output(connection, [&](MirDisplayOutput const* output)
112 {134 {
113 auto const& mode = output->modes[output->current_mode];135 auto const& mode = output->modes[output->current_mode];
@@ -120,6 +142,20 @@
120 surfaceparm.output_id = output->output_id;142 surfaceparm.output_id = output->output_id;
121 result.push_back(std::make_shared<MirEglSurface>(mir_egl_app, surfaceparm, swapinterval));143 result.push_back(std::make_shared<MirEglSurface>(mir_egl_app, surfaceparm, swapinterval));
122 });144 });
145#else
146 for_each_active_output(connection, [&](MirOutput const* output)
147 {
148 auto const& mode = mir_output_get_current_mode(output);
149
150 printf("Active output [%u] at (%d, %d) is %dx%d\n",
151 mir_output_get_id(output),
152 mir_output_get_position_x(output), mir_output_get_position_y(output),
153 mir_output_mode_get_width(mode), mir_output_mode_get_height(mode));
154
155 surfaceparm.output_id = mir_output_get_id(output);
156 result.push_back(std::make_shared<MirEglSurface>(mir_egl_app, surfaceparm, swapinterval));
157 });
158#endif
123159
124 if (result.empty())160 if (result.empty())
125 throw std::runtime_error("No active outputs found.");161 throw std::runtime_error("No active outputs found.");
126162
=== modified file 'miral-shell/spinner/miregl.cpp'
--- miral-shell/spinner/miregl.cpp 2016-09-16 16:07:56 +0000
+++ miral-shell/spinner/miregl.cpp 2017-01-26 16:46:42 +0000
@@ -15,6 +15,7 @@
15 */15 */
1616
17#include "miregl.h"17#include "miregl.h"
18#include <mir_toolkit/version.h>
1819
19#include <cstring>20#include <cstring>
2021
@@ -25,7 +26,7 @@
25public:26public:
26 MirEglApp(MirConnection* const connection, MirPixelFormat pixel_format);27 MirEglApp(MirConnection* const connection, MirPixelFormat pixel_format);
2728
28 EGLSurface create_surface(MirSurface* surface);29 EGLSurface create_surface(MirWindow* window);
2930
30 void make_current(EGLSurface eglsurface) const;31 void make_current(EGLSurface eglsurface) const;
3132
@@ -58,19 +59,20 @@
5859
59namespace60namespace
60{61{
61MirSurface* create_surface(MirConnection* const connection, MirSurfaceParameters const& surfaceparm)62MirWindow* create_surface(MirConnection* const connection, MirWindowParameters const& parameters)
62{63{
64#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
63 auto const spec = mir_connection_create_spec_for_normal_surface(65 auto const spec = mir_connection_create_spec_for_normal_surface(
64 connection,66 connection,
65 surfaceparm.width,67 parameters.width,
66 surfaceparm.height,68 parameters.height,
67 surfaceparm.pixel_format);69 parameters.pixel_format);
6870
69 mir_surface_spec_set_name(spec, surfaceparm.name);71 mir_surface_spec_set_name(spec, parameters.name);
70 mir_surface_spec_set_buffer_usage(spec, surfaceparm.buffer_usage);72 mir_surface_spec_set_buffer_usage(spec, parameters.buffer_usage);
7173
72 if (!surfaceparm.width && !surfaceparm.height)74 if (!parameters.width && !parameters.height)
73 mir_surface_spec_set_fullscreen_on_output(spec, surfaceparm.output_id);75 mir_surface_spec_set_fullscreen_on_output(spec, parameters.output_id);
7476
75 auto const surface = mir_surface_create_sync(spec);77 auto const surface = mir_surface_create_sync(spec);
76 mir_surface_spec_release(spec);78 mir_surface_spec_release(spec);
@@ -78,17 +80,39 @@
78 if (!mir_surface_is_valid(surface))80 if (!mir_surface_is_valid(surface))
79 throw std::runtime_error(std::string("Can't create a surface ") + mir_surface_get_error_message(surface));81 throw std::runtime_error(std::string("Can't create a surface ") + mir_surface_get_error_message(surface));
8082
81 if (surfaceparm.output_id != mir_display_output_id_invalid)83 if (parameters.output_id != mir_display_output_id_invalid)
82 mir_surface_set_state(surface, mir_surface_state_fullscreen);84 mir_surface_set_state(surface, mir_surface_state_fullscreen);
8385#else
86 auto const spec = mir_create_normal_window_spec(
87 connection,
88 parameters.width,
89 parameters.height);
90
91 mir_window_spec_set_pixel_format(spec, parameters.pixel_format);
92 mir_window_spec_set_name(spec, parameters.name);
93 mir_window_spec_set_buffer_usage(spec, parameters.buffer_usage);
94
95 if (!parameters.width && !parameters.height)
96 mir_window_spec_set_fullscreen_on_output(spec, parameters.output_id);
97
98 auto const surface = mir_create_window_sync(spec);
99 mir_window_spec_release(spec);
100
101 if (!mir_window_is_valid(surface))
102 throw std::runtime_error(std::string("Can't create a surface ") + mir_window_get_error_message(surface));
103
104 if (parameters.output_id != mir_display_output_id_invalid)
105 mir_window_set_state(surface, mir_window_state_fullscreen);
106#endif
84 return surface;107 return surface;
85}108}
86}109}
87110
88MirEglSurface::MirEglSurface(std::shared_ptr<MirEglApp> const& mir_egl_app, MirSurfaceParameters const& surfaceparm, int swapinterval) :111MirEglSurface::MirEglSurface(
112 std::shared_ptr<MirEglApp> const& mir_egl_app, MirWindowParameters const& parm, int swapinterval) :
89 mir_egl_app{mir_egl_app},113 mir_egl_app{mir_egl_app},
90 surface{create_surface(mir_egl_app->connection, surfaceparm)},114 window{create_surface(mir_egl_app->connection, parm)},
91 eglsurface{mir_egl_app->create_surface(surface)},115 eglsurface{mir_egl_app->create_surface(window)},
92 width_{0},116 width_{0},
93 height_{0}117 height_{0}
94{118{
@@ -98,7 +122,11 @@
98MirEglSurface::~MirEglSurface()122MirEglSurface::~MirEglSurface()
99{123{
100 mir_egl_app->destroy_surface(eglsurface);124 mir_egl_app->destroy_surface(eglsurface);
101 mir_surface_release_sync(surface);125#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
126 mir_surface_release_sync(window);
127#else
128 mir_window_release_sync(window);
129#endif
102}130}
103131
104void MirEglSurface::egl_make_current()132void MirEglSurface::egl_make_current()
@@ -173,7 +201,7 @@
173 EGL_HEIGHT, 1,201 EGL_HEIGHT, 1,
174 EGL_NONE202 EGL_NONE
175 };203 };
176 204
177 dummy_surface = eglCreatePbufferSurface(egldisplay, eglconfig, dummy_pbuffer_attribs);205 dummy_surface = eglCreatePbufferSurface(egldisplay, eglconfig, dummy_pbuffer_attribs);
178 if (dummy_surface == EGL_NO_SURFACE)206 if (dummy_surface == EGL_NO_SURFACE)
179 throw std::runtime_error("eglCreatePbufferSurface failed");207 throw std::runtime_error("eglCreatePbufferSurface failed");
@@ -182,12 +210,19 @@
182 make_current(dummy_surface);210 make_current(dummy_surface);
183}211}
184212
185EGLSurface MirEglApp::create_surface(MirSurface* surface)213EGLSurface MirEglApp::create_surface(MirWindow* window)
186{214{
187 auto const eglsurface = eglCreateWindowSurface(215#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
188 egldisplay,216 auto const eglsurface = eglCreateWindowSurface(
189 eglconfig,217 egldisplay,
190 (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(surface)), NULL);218 eglconfig,
219 (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(window)), NULL);
220#else
221 auto const eglsurface = eglCreateWindowSurface(
222 egldisplay,
223 eglconfig,
224 (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_window_get_buffer_stream(window)), NULL);
225#endif
191226
192 if (eglsurface == EGL_NO_SURFACE)227 if (eglsurface == EGL_NO_SURFACE)
193 throw std::runtime_error("eglCreateWindowSurface failed");228 throw std::runtime_error("eglCreateWindowSurface failed");
194229
=== modified file 'miral-shell/spinner/miregl.h'
--- miral-shell/spinner/miregl.h 2016-09-16 16:07:56 +0000
+++ miral-shell/spinner/miregl.h 2017-01-26 16:46:42 +0000
@@ -17,7 +17,7 @@
17#ifndef UNITYSYSTEMCOMPOSITOR_MIREGL_H17#ifndef UNITYSYSTEMCOMPOSITOR_MIREGL_H
18#define UNITYSYSTEMCOMPOSITOR_MIREGL_H18#define UNITYSYSTEMCOMPOSITOR_MIREGL_H
1919
20#include <mir_toolkit/common.h>20#include <miral/detail/mir_forward_compatibility.h>
21#include <mir_toolkit/client_types.h>21#include <mir_toolkit/client_types.h>
22#include "mir_toolkit/mir_client_library.h"22#include "mir_toolkit/mir_client_library.h"
2323
@@ -37,7 +37,7 @@
37public:37public:
38 MirEglSurface(38 MirEglSurface(
39 std::shared_ptr<MirEglApp> const& mir_egl_app,39 std::shared_ptr<MirEglApp> const& mir_egl_app,
40 MirSurfaceParameters const& surfaceparm,40 MirWindowParameters const& parm,
41 int swapinterval);41 int swapinterval);
4242
43 ~MirEglSurface();43 ~MirEglSurface();
@@ -50,7 +50,7 @@
50 swap_buffers();50 swap_buffers();
51 }51 }
5252
53 MirSurface* mir_surface() { return surface; }53 MirWindow* mir_window() { return window; }
5454
55private:55private:
56 void egl_make_current();56 void egl_make_current();
@@ -60,7 +60,7 @@
60 unsigned int height() const;60 unsigned int height() const;
6161
62 std::shared_ptr<MirEglApp> const mir_egl_app;62 std::shared_ptr<MirEglApp> const mir_egl_app;
63 MirSurface* const surface;63 MirWindow* const window;
64 EGLSurface const eglsurface;64 EGLSurface const eglsurface;
65 int width_;65 int width_;
66 int height_;66 int height_;
6767
=== modified file 'miral-shell/tiling_window_manager.cpp'
--- miral-shell/tiling_window_manager.cpp 2017-01-18 17:41:46 +0000
+++ miral-shell/tiling_window_manager.cpp 2017-01-26 16:46:42 +0000
@@ -108,7 +108,7 @@
108 }108 }
109}109}
110110
111auto TilingWindowManagerPolicy::place_new_surface(111auto TilingWindowManagerPolicy::place_new_window(
112 ApplicationInfo const& app_info,112 ApplicationInfo const& app_info,
113 WindowSpecification const& request_parameters)113 WindowSpecification const& request_parameters)
114 -> WindowSpecification114 -> WindowSpecification
@@ -117,7 +117,7 @@
117117
118 parameters.userdata() = app_info.userdata();118 parameters.userdata() = app_info.userdata();
119 parameters.state() = parameters.state().is_set() ?119 parameters.state() = parameters.state().is_set() ?
120 transform_set_state(parameters.state().value()) : mir_surface_state_restored;120 transform_set_state(parameters.state().value()) : mir_window_state_restored;
121121
122 if (app_info.application() != spinner.session())122 if (app_info.application() != spinner.session())
123 {123 {
@@ -147,13 +147,13 @@
147147
148void TilingWindowManagerPolicy::advise_new_window(WindowInfo const& window_info)148void TilingWindowManagerPolicy::advise_new_window(WindowInfo const& window_info)
149{149{
150 if (window_info.type() == mir_surface_type_normal &&150 if (window_info.type() == mir_window_type_normal &&
151 !window_info.parent() &&151 !window_info.parent() &&
152 window_info.state() == mir_surface_state_restored)152 window_info.state() == mir_window_state_restored)
153 {153 {
154 WindowSpecification specification;154 WindowSpecification specification;
155155
156 specification.state() = mir_surface_state_maximized;156 specification.state() = mir_window_state_maximized;
157157
158 tools.place_and_size_for_state(specification, window_info);158 tools.place_and_size_for_state(specification, window_info);
159 constrain_size_and_place(specification, window_info.window(), tile_for(window_info));159 constrain_size_and_place(specification, window_info.window(), tile_for(window_info));
@@ -229,17 +229,17 @@
229 reset(mods.top_left());229 reset(mods.top_left());
230}230}
231231
232auto TilingWindowManagerPolicy::transform_set_state(MirSurfaceState value)232auto TilingWindowManagerPolicy::transform_set_state(MirWindowState value)
233-> MirSurfaceState233-> MirWindowState
234{234{
235 switch (value)235 switch (value)
236 {236 {
237 default:237 default:
238 return mir_surface_state_restored;238 return mir_window_state_restored;
239239
240 case mir_surface_state_hidden:240 case mir_window_state_hidden:
241 case mir_surface_state_minimized:241 case mir_window_state_minimized:
242 return mir_surface_state_hidden;242 return mir_window_state_hidden;
243 }243 }
244}244}
245245
@@ -285,15 +285,15 @@
285 switch (modifiers & modifier_mask)285 switch (modifiers & modifier_mask)
286 {286 {
287 case mir_input_event_modifier_alt:287 case mir_input_event_modifier_alt:
288 toggle(mir_surface_state_maximized);288 toggle(mir_window_state_maximized);
289 return true;289 return true;
290290
291 case mir_input_event_modifier_shift:291 case mir_input_event_modifier_shift:
292 toggle(mir_surface_state_vertmaximized);292 toggle(mir_window_state_vertmaximized);
293 return true;293 return true;
294294
295 case mir_input_event_modifier_ctrl:295 case mir_input_event_modifier_ctrl:
296 toggle(mir_surface_state_horizmaximized);296 toggle(mir_window_state_horizmaximized);
297 return true;297 return true;
298298
299 default:299 default:
@@ -427,14 +427,14 @@
427 return consumes_event;427 return consumes_event;
428}428}
429429
430void TilingWindowManagerPolicy::toggle(MirSurfaceState state)430void TilingWindowManagerPolicy::toggle(MirWindowState state)
431{431{
432 if (auto window = tools.active_window())432 if (auto window = tools.active_window())
433 {433 {
434 auto& window_info = tools.info_for(window);434 auto& window_info = tools.info_for(window);
435435
436 if (window_info.state() == state)436 if (window_info.state() == state)
437 state = mir_surface_state_restored;437 state = mir_window_state_restored;
438438
439 WindowSpecification mods;439 WindowSpecification mods;
440 mods.state() = transform_set_state(state);440 mods.state() = transform_set_state(state);
441441
=== modified file 'miral-shell/tiling_window_manager.h'
--- miral-shell/tiling_window_manager.h 2016-12-05 09:46:35 +0000
+++ miral-shell/tiling_window_manager.h 2017-01-26 16:46:42 +0000
@@ -54,7 +54,7 @@
5454
55 ~TilingWindowManagerPolicy();55 ~TilingWindowManagerPolicy();
5656
57 auto place_new_surface(57 auto place_new_window(
58 miral::ApplicationInfo const& app_info,58 miral::ApplicationInfo const& app_info,
59 miral::WindowSpecification const& request_parameters)59 miral::WindowSpecification const& request_parameters)
60 -> miral::WindowSpecification override;60 -> miral::WindowSpecification override;
@@ -91,14 +91,14 @@
91 void click(Point cursor);91 void click(Point cursor);
92 void resize(Point cursor);92 void resize(Point cursor);
93 void drag(Point cursor);93 void drag(Point cursor);
94 void toggle(MirSurfaceState state);94 void toggle(MirWindowState state);
9595
96 miral::Application application_under(Point position);96 miral::Application application_under(Point position);
9797
98 void update_tiles(Rectangles const& displays);98 void update_tiles(Rectangles const& displays);
99 void update_surfaces(miral::ApplicationInfo& info, Rectangle const& old_tile, Rectangle const& new_tile);99 void update_surfaces(miral::ApplicationInfo& info, Rectangle const& old_tile, Rectangle const& new_tile);
100100
101 auto transform_set_state(MirSurfaceState value) -> MirSurfaceState;101 auto transform_set_state(MirWindowState value) -> MirWindowState;
102102
103 static void clip_to_tile(miral::WindowSpecification& parameters, Rectangle const& tile);103 static void clip_to_tile(miral::WindowSpecification& parameters, Rectangle const& tile);
104 static void resize(miral::Window window, Point cursor, Point old_cursor, Rectangle bounds);104 static void resize(miral::Window window, Point cursor, Point old_cursor, Rectangle bounds);
105105
=== modified file 'miral-shell/titlebar_provider.cpp'
--- miral-shell/titlebar_provider.cpp 2016-10-27 14:07:51 +0000
+++ miral-shell/titlebar_provider.cpp 2017-01-26 16:46:42 +0000
@@ -19,7 +19,7 @@
19#include "titlebar_provider.h"19#include "titlebar_provider.h"
20#include "titlebar_config.h"20#include "titlebar_config.h"
2121
22#include <miral/toolkit/surface_spec.h>22#include <miral/toolkit/window_spec.h>
2323
24#include <mir_toolkit/mir_buffer_stream.h>24#include <mir_toolkit/mir_buffer_stream.h>
2525
@@ -38,7 +38,7 @@
38{38{
39int const title_bar_height = 12;39int const title_bar_height = 12;
4040
41void null_surface_callback(MirSurface*, void*) {}41void null_surface_callback(MirWindow*, void*) {}
4242
43struct Printer43struct Printer
44{44{
@@ -57,9 +57,13 @@
57 FT_Face face;57 FT_Face face;
58};58};
5959
60void paint_surface(MirSurface* surface, std::string const& title, int const intensity)60void paint_surface(MirWindow* surface, std::string const& title, int const intensity)
61{61{
62#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
62 MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface);63 MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface);
64#else
65 MirBufferStream* buffer_stream = mir_window_get_buffer_stream(surface);
66#endif
6367
64 // TODO sometimes buffer_stream is nullptr - find out why (and fix).68 // TODO sometimes buffer_stream is nullptr - find out why (and fix).
65 // (Only observed when creating a lot of clients at once)69 // (Only observed when creating a lot of clients at once)
@@ -204,10 +208,10 @@
204208
205 buffer << std::shared_ptr<mir::scene::Surface>(window).get();209 buffer << std::shared_ptr<mir::scene::Surface>(window).get();
206210
207 auto const spec = SurfaceSpec::for_normal_surface(211 auto const spec = WindowSpec::for_normal_surface(
208 connection, window.size().width.as_int(), title_bar_height, mir_pixel_format_xrgb_8888)212 connection, window.size().width.as_int(), title_bar_height, mir_pixel_format_xrgb_8888)
209 .set_buffer_usage(mir_buffer_usage_software)213 .set_buffer_usage(mir_buffer_usage_software)
210 .set_type(mir_surface_type_gloss)214 .set_type(mir_window_type_gloss)
211 .set_name(buffer.str().c_str());215 .set_name(buffer.str().c_str());
212216
213 std::lock_guard<decltype(mutex)> lock{mutex};217 std::lock_guard<decltype(mutex)> lock{mutex};
@@ -230,7 +234,7 @@
230 }234 }
231 else235 else
232 {236 {
233 data->on_create = [this, title, intensity](MirSurface* surface)237 data->on_create = [this, title, intensity](MirWindow* surface)
234 { enqueue_work([this, surface, title, intensity]{ paint_surface(surface, title, intensity); }); };238 { enqueue_work([this, surface, title, intensity]{ paint_surface(surface, title, intensity); }); };
235 }239 }
236 }240 }
@@ -244,7 +248,11 @@
244 {248 {
245 enqueue_work([surface]249 enqueue_work([surface]
246 {250 {
251#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
247 mir_surface_release(surface, &null_surface_callback, nullptr);252 mir_surface_release(surface, &null_surface_callback, nullptr);
253#else
254 mir_window_release(surface, &null_surface_callback, nullptr);
255#endif
248 });256 });
249 }257 }
250258
@@ -299,23 +307,23 @@
299 tools.raise_tree(window_info.parent());307 tools.raise_tree(window_info.parent());
300}308}
301309
302void TitlebarProvider::advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state)310void TitlebarProvider::advise_state_change(miral::WindowInfo const& window_info, MirWindowState state)
303{311{
304 if (auto titlebar = find_titlebar_window(window_info.window()))312 if (auto titlebar = find_titlebar_window(window_info.window()))
305 {313 {
306 miral::WindowSpecification modifications;314 miral::WindowSpecification modifications;
307 switch (state)315 switch (state)
308 {316 {
309 case mir_surface_state_maximized:317 case mir_window_state_maximized:
310 case mir_surface_state_vertmaximized:318 case mir_window_state_vertmaximized:
311 case mir_surface_state_hidden:319 case mir_window_state_hidden:
312 case mir_surface_state_minimized:320 case mir_window_state_minimized:
313 case mir_surface_state_fullscreen:321 case mir_window_state_fullscreen:
314 modifications.state() = mir_surface_state_hidden;322 modifications.state() = mir_window_state_hidden;
315 break;323 break;
316324
317 default:325 default:
318 modifications.state() = mir_surface_state_restored;326 modifications.state() = mir_window_state_restored;
319 break;327 break;
320 }328 }
321329
@@ -338,10 +346,14 @@
338TitlebarProvider::Data::~Data()346TitlebarProvider::Data::~Data()
339{347{
340 if (auto surface = titlebar.exchange(nullptr))348 if (auto surface = titlebar.exchange(nullptr))
349#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
341 mir_surface_release(surface, &null_surface_callback, nullptr);350 mir_surface_release(surface, &null_surface_callback, nullptr);
351#else
352 mir_window_release(surface, &null_surface_callback, nullptr);
353#endif
342}354}
343355
344void TitlebarProvider::insert(MirSurface* surface, Data* data)356void TitlebarProvider::insert(MirWindow* surface, Data* data)
345{357{
346 data->on_create(surface);358 data->on_create(surface);
347 data->titlebar = surface;359 data->titlebar = surface;
@@ -401,4 +413,4 @@
401void Worker::stop_work()413void Worker::stop_work()
402{414{
403 enqueue_work([this] { work_done = true; });415 enqueue_work([this] { work_done = true; });
404}
405\ No newline at end of file416\ No newline at end of file
417}
406418
=== modified file 'miral-shell/titlebar_provider.h'
--- miral-shell/titlebar_provider.h 2016-10-27 14:04:09 +0000
+++ miral-shell/titlebar_provider.h 2017-01-26 16:46:42 +0000
@@ -71,15 +71,15 @@
71 void destroy_titlebar_for(miral::Window const& window);71 void destroy_titlebar_for(miral::Window const& window);
72 void resize_titlebar_for(miral::WindowInfo const& window_info, mir::geometry::Size const& size);72 void resize_titlebar_for(miral::WindowInfo const& window_info, mir::geometry::Size const& size);
73 void advise_new_titlebar(miral::WindowInfo const& window_info);73 void advise_new_titlebar(miral::WindowInfo const& window_info);
74 void advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state);74 void advise_state_change(miral::WindowInfo const& window_info, MirWindowState state);
7575
76 void stop();76 void stop();
7777
78private:78private:
79 struct Data79 struct Data
80 {80 {
81 std::atomic<MirSurface*> titlebar{nullptr};81 std::atomic<MirWindow*> titlebar{nullptr};
82 std::function<void(MirSurface* surface)> on_create{[](MirSurface*){}};82 std::function<void(MirWindow* surface)> on_create{[](MirWindow*){}};
83 miral::Window window;83 miral::Window window;
8484
85 ~Data();85 ~Data();
@@ -97,7 +97,7 @@
97 SurfaceMap window_to_titlebar;97 SurfaceMap window_to_titlebar;
98 TitleMap windows_awaiting_titlebar;98 TitleMap windows_awaiting_titlebar;
9999
100 static void insert(MirSurface* surface, Data* data);100 static void insert(MirWindow* surface, Data* data);
101 Data* find_titlebar_data(miral::Window const& window);101 Data* find_titlebar_data(miral::Window const& window);
102 miral::Window find_titlebar_window(miral::Window const& window) const;102 miral::Window find_titlebar_window(miral::Window const& window) const;
103 void repaint_titlebar_for(miral::WindowInfo const& window_info);103 void repaint_titlebar_for(miral::WindowInfo const& window_info);
104104
=== modified file 'miral-shell/titlebar_window_manager.cpp'
--- miral-shell/titlebar_window_manager.cpp 2016-10-27 14:04:09 +0000
+++ miral-shell/titlebar_window_manager.cpp 2017-01-26 16:46:42 +0000
@@ -109,7 +109,7 @@
109 }109 }
110 }110 }
111 }111 }
112 112
113 if (resizing && !is_resize_event)113 if (resizing && !is_resize_event)
114 end_resize();114 end_resize();
115115
@@ -312,7 +312,7 @@
312 }312 }
313}313}
314314
315void TitlebarWindowManagerPolicy::advise_state_change(WindowInfo const& window_info, MirSurfaceState state)315void TitlebarWindowManagerPolicy::advise_state_change(WindowInfo const& window_info, MirWindowState state)
316{316{
317 CanonicalWindowManagerPolicy::advise_state_change(window_info, state);317 CanonicalWindowManagerPolicy::advise_state_change(window_info, state);
318318
@@ -347,15 +347,15 @@
347 switch (modifiers)347 switch (modifiers)
348 {348 {
349 case mir_input_event_modifier_alt:349 case mir_input_event_modifier_alt:
350 toggle(mir_surface_state_maximized);350 toggle(mir_window_state_maximized);
351 return true;351 return true;
352352
353 case mir_input_event_modifier_shift:353 case mir_input_event_modifier_shift:
354 toggle(mir_surface_state_vertmaximized);354 toggle(mir_window_state_vertmaximized);
355 return true;355 return true;
356356
357 case mir_input_event_modifier_ctrl:357 case mir_input_event_modifier_ctrl:
358 toggle(mir_surface_state_horizmaximized);358 toggle(mir_window_state_horizmaximized);
359 return true;359 return true;
360360
361 default:361 default:
@@ -418,8 +418,8 @@
418 break;418 break;
419419
420 case KEY_UP:420 case KEY_UP:
421 if (window_info.state() != mir_surface_state_vertmaximized &&421 if (window_info.state() != mir_window_state_vertmaximized &&
422 window_info.state() != mir_surface_state_maximized)422 window_info.state() != mir_window_state_maximized)
423 {423 {
424 modifications.top_left() =424 modifications.top_left() =
425 Point{active_window.top_left().x, active_display.top_left.y} + DeltaY{title_bar_height};425 Point{active_window.top_left().x, active_display.top_left.y} + DeltaY{title_bar_height};
@@ -455,7 +455,7 @@
455 return false;455 return false;
456}456}
457457
458void TitlebarWindowManagerPolicy::toggle(MirSurfaceState state)458void TitlebarWindowManagerPolicy::toggle(MirWindowState state)
459{459{
460 if (auto const window = tools.active_window())460 if (auto const window = tools.active_window())
461 {461 {
@@ -463,7 +463,7 @@
463463
464 WindowSpecification modifications;464 WindowSpecification modifications;
465465
466 modifications.state() = (info.state() == state) ? mir_surface_state_restored : state;466 modifications.state() = (info.state() == state) ? mir_window_state_restored : state;
467 tools.place_and_size_for_state(modifications, info);467 tools.place_and_size_for_state(modifications, info);
468 tools.modify_window(info, modifications);468 tools.modify_window(info, modifications);
469 }469 }
@@ -558,14 +558,14 @@
558 }558 }
559}559}
560560
561WindowSpecification TitlebarWindowManagerPolicy::place_new_surface(561WindowSpecification TitlebarWindowManagerPolicy::place_new_window(
562 ApplicationInfo const& app_info, WindowSpecification const& request_parameters)562 ApplicationInfo const& app_info, WindowSpecification const& request_parameters)
563{563{
564 auto parameters = CanonicalWindowManagerPolicy::place_new_surface(app_info, request_parameters);564 auto parameters = CanonicalWindowManagerPolicy::place_new_window(app_info, request_parameters);
565565
566 bool const needs_titlebar = WindowInfo::needs_titlebar(parameters.type().value());566 bool const needs_titlebar = WindowInfo::needs_titlebar(parameters.type().value());
567567
568 if (parameters.state().value() != mir_surface_state_fullscreen && needs_titlebar)568 if (parameters.state().value() != mir_window_state_fullscreen && needs_titlebar)
569 parameters.top_left() = Point{parameters.top_left().value().x, parameters.top_left().value().y + DeltaY{title_bar_height}};569 parameters.top_left() = Point{parameters.top_left().value().x, parameters.top_left().value().y + DeltaY{title_bar_height}};
570570
571 if (app_info.application() == titlebar_provider->session())571 if (app_info.application() == titlebar_provider->session())
572572
=== modified file 'miral-shell/titlebar_window_manager.h'
--- miral-shell/titlebar_window_manager.h 2016-09-28 11:42:35 +0000
+++ miral-shell/titlebar_window_manager.h 2017-01-26 16:46:42 +0000
@@ -37,7 +37,7 @@
37 TitlebarWindowManagerPolicy(miral::WindowManagerTools const& tools, SpinnerSplash const& spinner, miral::InternalClientLauncher const& launcher);37 TitlebarWindowManagerPolicy(miral::WindowManagerTools const& tools, SpinnerSplash const& spinner, miral::InternalClientLauncher const& launcher);
38 ~TitlebarWindowManagerPolicy();38 ~TitlebarWindowManagerPolicy();
3939
40 virtual miral::WindowSpecification place_new_surface(40 virtual miral::WindowSpecification place_new_window(
41 miral::ApplicationInfo const& app_info, miral::WindowSpecification const& request_parameters) override;41 miral::ApplicationInfo const& app_info, miral::WindowSpecification const& request_parameters) override;
4242
43 /** @name example event handling:43 /** @name example event handling:
@@ -60,7 +60,7 @@
60 void handle_window_ready(miral::WindowInfo& window_info) override;60 void handle_window_ready(miral::WindowInfo& window_info) override;
61 void advise_focus_lost(miral::WindowInfo const& info) override;61 void advise_focus_lost(miral::WindowInfo const& info) override;
62 void advise_focus_gained(miral::WindowInfo const& info) override;62 void advise_focus_gained(miral::WindowInfo const& info) override;
63 void advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state) override;63 void advise_state_change(miral::WindowInfo const& window_info, MirWindowState state) override;
64 void advise_resize(miral::WindowInfo const& window_info, Size const& new_size) override;64 void advise_resize(miral::WindowInfo const& window_info, Size const& new_size) override;
65 void advise_delete_window(miral::WindowInfo const& window_info) override;65 void advise_delete_window(miral::WindowInfo const& window_info) override;
66 /** @} */66 /** @} */
@@ -74,7 +74,7 @@
74 mir_input_event_modifier_meta;74 mir_input_event_modifier_meta;
7575
76private:76private:
77 void toggle(MirSurfaceState state);77 void toggle(MirWindowState state);
7878
79 bool resize(miral::Window const& window, Point cursor, Point old_cursor);79 bool resize(miral::Window const& window, Point cursor, Point old_cursor);
8080
8181
=== modified file 'miral/CMakeLists.txt'
--- miral/CMakeLists.txt 2016-12-13 13:07:15 +0000
+++ miral/CMakeLists.txt 2017-01-26 16:46:42 +0000
@@ -21,9 +21,10 @@
21 window_management_trace.cpp window_management_trace.h21 window_management_trace.cpp window_management_trace.h
22 xcursor_loader.cpp xcursor_loader.h22 xcursor_loader.cpp xcursor_loader.h
23 xcursor.c xcursor.h23 xcursor.c xcursor.h
24 both_versions.h
24)25)
2526
26set_source_files_properties(xcursor.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_GNU_SOURCE")27set_source_files_properties(xcursor.c PROPERTIES COMPILE_DEFINITIONS _GNU_SOURCE)
2728
28add_library(miral SHARED29add_library(miral SHARED
29 active_outputs.cpp ${CMAKE_SOURCE_DIR}/include/miral/active_outputs.h30 active_outputs.cpp ${CMAKE_SOURCE_DIR}/include/miral/active_outputs.h
@@ -50,10 +51,10 @@
50 set_window_managment_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_managment_policy.h51 set_window_managment_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_managment_policy.h
51 window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h52 window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h
52 window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h53 window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h
53 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/surface_spec.h54 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/window_spec.h
54 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/persistent_id.h55 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/persistent_id.h
55 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/connection.h56 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/connection.h
56 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/surface.h57 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/window.h
57 ${CMAKE_SOURCE_DIR}/include/miral/detail/mir_forward_compatibility.h58 ${CMAKE_SOURCE_DIR}/include/miral/detail/mir_forward_compatibility.h
58)59)
5960
6061
=== modified file 'miral/active_outputs.cpp'
--- miral/active_outputs.cpp 2016-12-13 13:07:15 +0000
+++ miral/active_outputs.cpp 2017-01-26 16:46:42 +0000
@@ -70,6 +70,11 @@
7070
71 void base_configuration_updated(std::shared_ptr<mir::graphics::DisplayConfiguration const> const& ) override {}71 void base_configuration_updated(std::shared_ptr<mir::graphics::DisplayConfiguration const> const& ) override {}
7272
73 void session_configuration_applied(std::shared_ptr<mir::frontend::Session> const&,
74 std::shared_ptr<mir::graphics::DisplayConfiguration> const&) override {}
75
76 void session_configuration_removed(std::shared_ptr<mir::frontend::Session> const&) override {}
77
73 std::mutex mutex;78 std::mutex mutex;
74 std::vector<ActiveOutputsListener*> listeners;79 std::vector<ActiveOutputsListener*> listeners;
75 std::vector<Output> outputs;80 std::vector<Output> outputs;
7681
=== modified file 'miral/basic_window_manager.cpp'
--- miral/basic_window_manager.cpp 2017-01-18 17:41:46 +0000
+++ miral/basic_window_manager.cpp 2017-01-26 16:46:42 +0000
@@ -92,7 +92,7 @@
9292
93 auto& session_info = info_for(session);93 auto& session_info = info_for(session);
9494
95 WindowSpecification const& spec = policy->place_new_surface(session_info, place_new_surface(session_info, params));95 WindowSpecification const& spec = policy->place_new_window(session_info, place_new_surface(session_info, params));
96 scene::SurfaceCreationParameters parameters;96 scene::SurfaceCreationParameters parameters;
97 spec.update(parameters);97 spec.update(parameters);
98 auto const surface_id = build(session, parameters);98 auto const surface_id = build(session, parameters);
@@ -112,7 +112,7 @@
112 if (parent)112 if (parent)
113 info_for(parent).add_child(window);113 info_for(parent).add_child(window);
114114
115 if (window_info.state() == mir_surface_state_fullscreen)115 if (window_info.state() == mir_window_state_fullscreen)
116 fullscreen_surfaces.insert(window_info.window());116 fullscreen_surfaces.insert(window_info.window());
117117
118 policy->advise_new_window(window_info);118 policy->advise_new_window(window_info);
@@ -282,35 +282,35 @@
282int miral::BasicWindowManager::set_surface_attribute(282int miral::BasicWindowManager::set_surface_attribute(
283 std::shared_ptr<scene::Session> const& /*application*/,283 std::shared_ptr<scene::Session> const& /*application*/,
284 std::shared_ptr<scene::Surface> const& surface,284 std::shared_ptr<scene::Surface> const& surface,
285 MirSurfaceAttrib attrib,285 MirWindowAttrib attrib,
286 int value)286 int value)
287{287{
288 WindowSpecification modification;288 WindowSpecification modification;
289 switch (attrib)289 switch (attrib)
290 {290 {
291 case mir_surface_attrib_type:291 case mir_window_attrib_type:
292 modification.type() = MirSurfaceType(value);292 modification.type() = MirWindowType(value);
293 break;293 break;
294 case mir_surface_attrib_state:294 case mir_window_attrib_state:
295 modification.state() = MirSurfaceState(value);295 modification.state() = MirWindowState(value);
296 break;296 break;
297297
298 case mir_surface_attrib_preferred_orientation:298 case mir_window_attrib_preferred_orientation:
299 modification.preferred_orientation() = MirOrientationMode(value);299 modification.preferred_orientation() = MirOrientationMode(value);
300 break;300 break;
301301
302 case mir_surface_attrib_visibility:302 case mir_window_attrib_visibility:
303 // The client really shouldn't be trying to set this.303 // The client really shouldn't be trying to set this.
304 // But, as the legacy API exists, we treat it as a query304 // But, as the legacy API exists, we treat it as a query
305 return surface->query(mir_surface_attrib_visibility);305 return surface->query(mir_window_attrib_visibility);
306306
307 case mir_surface_attrib_focus:307 case mir_window_attrib_focus:
308 // The client really shouldn't be trying to set this.308 // The client really shouldn't be trying to set this.
309 // But, as the legacy API exists, we treat it as a query309 // But, as the legacy API exists, we treat it as a query
310 return surface->query(mir_surface_attrib_focus);310 return surface->query(mir_window_attrib_focus);
311311
312 case mir_surface_attrib_swapinterval:312 case mir_window_attrib_swapinterval:
313 case mir_surface_attrib_dpi:313 case mir_window_attrib_dpi:
314 default:314 default:
315 return surface->configure(attrib, value);315 return surface->configure(attrib, value);
316 }316 }
@@ -324,13 +324,13 @@
324324
325 switch (attrib)325 switch (attrib)
326 {326 {
327 case mir_surface_attrib_type:327 case mir_window_attrib_type:
328 return info.type();328 return info.type();
329329
330 case mir_surface_attrib_state:330 case mir_window_attrib_state:
331 return info.state();331 return info.state();
332332
333 case mir_surface_attrib_preferred_orientation:333 case mir_window_attrib_preferred_orientation:
334 return info.preferred_orientation();334 return info.preferred_orientation();
335 break;335 break;
336336
@@ -496,6 +496,11 @@
496496
497void miral::BasicWindowManager::raise_tree(Window const& root)497void miral::BasicWindowManager::raise_tree(Window const& root)
498{498{
499 auto const& info = info_for(root);
500
501 if (auto parent = info.parent())
502 raise_tree(parent);
503
499 std::vector<Window> windows;504 std::vector<Window> windows;
500505
501 std::function<void(WindowInfo const& info)> const add_children =506 std::function<void(WindowInfo const& info)> const add_children =
@@ -509,7 +514,7 @@
509 };514 };
510515
511 windows.push_back(root);516 windows.push_back(root);
512 add_children(info_for(root));517 add_children(info);
513518
514 policy->advise_raise(windows);519 policy->advise_raise(windows);
515 focus_controller->raise({begin(windows), end(windows)});520 focus_controller->raise({begin(windows), end(windows)});
@@ -589,7 +594,7 @@
589 auto& window = window_info.window();594 auto& window = window_info.window();
590595
591 if (window_info.type() != window_info_tmp.type())596 if (window_info.type() != window_info_tmp.type())
592 std::shared_ptr<scene::Surface>(window)->configure(mir_surface_attrib_type, window_info.type());597 std::shared_ptr<scene::Surface>(window)->configure(mir_window_attrib_type, window_info.type());
593598
594 if (window_info.parent() != window_info_tmp.parent())599 if (window_info.parent() != window_info_tmp.parent())
595 {600 {
@@ -616,12 +621,12 @@
616 {621 {
617 switch (window_info.state())622 switch (window_info.state())
618 {623 {
619 case mir_surface_state_restored:624 case mir_window_state_restored:
620 case mir_surface_state_hidden:625 case mir_window_state_hidden:
621 window_info.restore_rect({window.top_left(), window.size()});626 window_info.restore_rect({window.top_left(), window.size()});
622 break;627 break;
623628
624 case mir_surface_state_vertmaximized:629 case mir_window_state_vertmaximized:
625 {630 {
626 auto restore_rect = window_info.restore_rect();631 auto restore_rect = window_info.restore_rect();
627 restore_rect.top_left.x = window.top_left().x;632 restore_rect.top_left.x = window.top_left().x;
@@ -630,7 +635,7 @@
630 break;635 break;
631 }636 }
632637
633 case mir_surface_state_horizmaximized:638 case mir_window_state_horizmaximized:
634 {639 {
635 auto restore_rect = window_info.restore_rect();640 auto restore_rect = window_info.restore_rect();
636 restore_rect.top_left.y = window.top_left().y;641 restore_rect.top_left.y = window.top_left().y;
@@ -740,7 +745,7 @@
740745
741 switch (new_state)746 switch (new_state)
742 {747 {
743 case mir_surface_state_fullscreen:748 case mir_window_state_fullscreen:
744 if (modifications.output_id().is_set() &&749 if (modifications.output_id().is_set() &&
745 (!window_info.has_output_id() || modifications.output_id().value() != window_info.output_id()))750 (!window_info.has_output_id() || modifications.output_id().value() != window_info.output_id()))
746 break;751 break;
@@ -758,19 +763,19 @@
758 // window_info.restore_rect() was cached on last state change, update to reflect current window position763 // window_info.restore_rect() was cached on last state change, update to reflect current window position
759 switch (window_info.state())764 switch (window_info.state())
760 {765 {
761 case mir_surface_state_restored:766 case mir_window_state_restored:
762 case mir_surface_state_hidden:767 case mir_window_state_hidden:
763 restore_rect = {window.top_left(), window.size()};768 restore_rect = {window.top_left(), window.size()};
764 break;769 break;
765770
766 case mir_surface_state_vertmaximized:771 case mir_window_state_vertmaximized:
767 {772 {
768 restore_rect.top_left.x = window.top_left().x;773 restore_rect.top_left.x = window.top_left().x;
769 restore_rect.size.width = window.size().width;774 restore_rect.size.width = window.size().width;
770 break;775 break;
771 }776 }
772777
773 case mir_surface_state_horizmaximized:778 case mir_window_state_horizmaximized:
774 {779 {
775 restore_rect.top_left.y = window.top_left().y;780 restore_rect.top_left.y = window.top_left().y;
776 restore_rect.size.height= window.size().height;781 restore_rect.size.height= window.size().height;
@@ -793,33 +798,33 @@
793798
794 switch (new_state)799 switch (new_state)
795 {800 {
796 case mir_surface_state_restored:801 case mir_window_state_restored:
797 rect = restore_rect;802 rect = restore_rect;
798 break;803 break;
799804
800 case mir_surface_state_maximized:805 case mir_window_state_maximized:
801 rect = display_area;806 rect = display_area;
802 break;807 break;
803808
804 case mir_surface_state_horizmaximized:809 case mir_window_state_horizmaximized:
805 rect.top_left = {display_area.top_left.x, restore_rect.top_left.y};810 rect.top_left = {display_area.top_left.x, restore_rect.top_left.y};
806 rect.size = {display_area.size.width, restore_rect.size.height};811 rect.size = {display_area.size.width, restore_rect.size.height};
807 break;812 break;
808813
809 case mir_surface_state_vertmaximized:814 case mir_window_state_vertmaximized:
810 rect.top_left = {restore_rect.top_left.x, display_area.top_left.y};815 rect.top_left = {restore_rect.top_left.x, display_area.top_left.y};
811 rect.size = {restore_rect.size.width, display_area.size.height};816 rect.size = {restore_rect.size.width, display_area.size.height};
812 break;817 break;
813818
814 case mir_surface_state_fullscreen:819 case mir_window_state_fullscreen:
815 {820 {
816 rect = fullscreen_rect_for(window_info);821 rect = fullscreen_rect_for(window_info);
817822
818 break;823 break;
819 }824 }
820825
821 case mir_surface_state_hidden:826 case mir_window_state_hidden:
822 case mir_surface_state_minimized:827 case mir_window_state_minimized:
823 default:828 default:
824 return;829 return;
825 }830 }
@@ -845,12 +850,12 @@
845 return r;850 return r;
846}851}
847852
848void miral::BasicWindowManager::set_state(miral::WindowInfo& window_info, MirSurfaceState value)853void miral::BasicWindowManager::set_state(miral::WindowInfo& window_info, MirWindowState value)
849{854{
850 auto const window = window_info.window();855 auto const window = window_info.window();
851 auto const mir_surface = std::shared_ptr<scene::Surface>(window);856 auto const mir_surface = std::shared_ptr<scene::Surface>(window);
852857
853 if (value != mir_surface_state_fullscreen)858 if (value != mir_window_state_fullscreen)
854 {859 {
855 fullscreen_surfaces.erase(window);860 fullscreen_surfaces.erase(window);
856 }861 }
@@ -864,18 +869,18 @@
864 return;869 return;
865 }870 }
866871
867 bool const was_hidden = window_info.state() == mir_surface_state_hidden ||872 bool const was_hidden = window_info.state() == mir_window_state_hidden ||
868 window_info.state() == mir_surface_state_minimized;873 window_info.state() == mir_window_state_minimized;
869874
870 policy->advise_state_change(window_info, value);875 policy->advise_state_change(window_info, value);
871 window_info.state(value);876 window_info.state(value);
872877
873 mir_surface->configure(mir_surface_attrib_state, value);878 mir_surface->configure(mir_window_attrib_state, value);
874879
875 switch (value)880 switch (value)
876 {881 {
877 case mir_surface_state_hidden:882 case mir_window_state_hidden:
878 case mir_surface_state_minimized:883 case mir_window_state_minimized:
879 mir_surface->hide();884 mir_surface->hide();
880885
881 if (window == active_window())886 if (window == active_window())
@@ -885,8 +890,6 @@
885 {890 {
886 if (candidate == window)891 if (candidate == window)
887 return true;892 return true;
888 if (!std::shared_ptr<scene::Surface>(candidate)->visible())
889 return true;
890 auto const w = candidate;893 auto const w = candidate;
891 return !(select_active_window(w));894 return !(select_active_window(w));
892 });895 });
@@ -966,7 +969,7 @@
966 {969 {
967 if (std::shared_ptr<mir::scene::Surface> surface = child)970 if (std::shared_ptr<mir::scene::Surface> surface = child)
968 {971 {
969 if (surface->type() == mir_surface_type_dialog && surface->visible())972 if (surface->type() == mir_window_type_dialog && surface->visible())
970 return select_active_window(child);973 return select_active_window(child);
971 }974 }
972 }975 }
@@ -1009,43 +1012,43 @@
1009 // Mir and Unity: Surfaces, input, and displays (v0.3)1012 // Mir and Unity: Surfaces, input, and displays (v0.3)
1010 switch (window_info.type())1013 switch (window_info.type())
1011 {1014 {
1012 case mir_surface_type_normal: // regular1015 case mir_window_type_normal: // regular
1013 case mir_surface_type_utility: // floating regular1016 case mir_window_type_utility: // floating regular
1014 case mir_surface_type_dialog: // dialog1017 case mir_window_type_dialog: // dialog
1015 case mir_surface_type_satellite:// satellite1018 case mir_window_type_satellite:// satellite
1016 case mir_surface_type_freestyle:// freestyle1019 case mir_window_type_freestyle:// freestyle
1017 break;1020 break;
10181021
1019 case mir_surface_type_gloss:1022 case mir_window_type_gloss:
1020 case mir_surface_type_menu:1023 case mir_window_type_menu:
1021 case mir_surface_type_inputmethod:1024 case mir_window_type_inputmethod:
1022 case mir_surface_type_tip:1025 case mir_window_type_tip:
1023 case mir_surface_types:1026 case mir_window_types:
1024 return;1027 return;
1025 }1028 }
10261029
1027 switch (window_info.state())1030 switch (window_info.state())
1028 {1031 {
1029 case mir_surface_state_restored:1032 case mir_window_state_restored:
1030 break;1033 break;
10311034
1032 // "A vertically maximised window is anchored to the top and bottom of1035 // "A vertically maximised window is anchored to the top and bottom of
1033 // the available workspace and can have any width."1036 // the available workspace and can have any width."
1034 case mir_surface_state_vertmaximized:1037 case mir_window_state_vertmaximized:
1035 movement.dy = DeltaY(0);1038 movement.dy = DeltaY(0);
1036 break;1039 break;
10371040
1038 // "A horizontally maximised window is anchored to the left and right of1041 // "A horizontally maximised window is anchored to the left and right of
1039 // the available workspace and can have any height"1042 // the available workspace and can have any height"
1040 case mir_surface_state_horizmaximized:1043 case mir_window_state_horizmaximized:
1041 movement.dx = DeltaX(0);1044 movement.dx = DeltaX(0);
1042 break;1045 break;
10431046
1044 // "A maximised window is anchored to the top, bottom, left and right of the1047 // "A maximised window is anchored to the top, bottom, left and right of the
1045 // available workspace. For example, if the launcher is always-visible then1048 // available workspace. For example, if the launcher is always-visible then
1046 // the left-edge of the window is anchored to the right-edge of the launcher."1049 // the left-edge of the window is anchored to the right-edge of the launcher."
1047 case mir_surface_state_maximized:1050 case mir_window_state_maximized:
1048 case mir_surface_state_fullscreen:1051 case mir_window_state_fullscreen:
1049 default:1052 default:
1050 return;1053 return;
1051 }1054 }
@@ -1071,10 +1074,10 @@
1071-> WindowSpecification1074-> WindowSpecification
1072{1075{
1073 if (!parameters.type().is_set())1076 if (!parameters.type().is_set())
1074 parameters.type() = mir_surface_type_normal;1077 parameters.type() = mir_window_type_normal;
10751078
1076 if (!parameters.state().is_set())1079 if (!parameters.state().is_set())
1077 parameters.state() = mir_surface_state_restored;1080 parameters.state() = mir_window_state_restored;
10781081
1079 auto const active_display_area = active_display();1082 auto const active_display_area = active_display();
1080 auto const height = parameters.size().value().height.as_int();1083 auto const height = parameters.size().value().height.as_int();
@@ -1090,7 +1093,7 @@
1090 display_layout->place_in_output(id, rect);1093 display_layout->place_in_output(id, rect);
1091 parameters.top_left() = rect.top_left;1094 parameters.top_left() = rect.top_left;
1092 parameters.size() = rect.size;1095 parameters.size() = rect.size;
1093 parameters.state() = mir_surface_state_fullscreen;1096 parameters.state() = mir_window_state_fullscreen;
1094 positioned = true;1097 positioned = true;
1095 }1098 }
1096 else if (!has_parent) // No parent => client can't suggest positioning1099 else if (!has_parent) // No parent => client can't suggest positioning
@@ -1157,19 +1160,19 @@
11571160
1158 switch (parameters.state().value())1161 switch (parameters.state().value())
1159 {1162 {
1160 case mir_surface_state_fullscreen:1163 case mir_window_state_fullscreen:
1161 case mir_surface_state_maximized:1164 case mir_window_state_maximized:
1162 parameters.top_left() = active_display_area.top_left;1165 parameters.top_left() = active_display_area.top_left;
1163 parameters.size() = active_display_area.size;1166 parameters.size() = active_display_area.size;
1164 break;1167 break;
11651168
1166 case mir_surface_state_vertmaximized:1169 case mir_window_state_vertmaximized:
1167 centred.y = active_display_area.top_left.y;1170 centred.y = active_display_area.top_left.y;
1168 parameters.top_left() = centred;1171 parameters.top_left() = centred;
1169 parameters.size() = Size{parameters.size().value().width, active_display_area.size.height};1172 parameters.size() = Size{parameters.size().value().width, active_display_area.size.height};
1170 break;1173 break;
11711174
1172 case mir_surface_state_horizmaximized:1175 case mir_window_state_horizmaximized:
1173 centred.x = active_display_area.top_left.x;1176 centred.x = active_display_area.top_left.x;
1174 parameters.top_left() = centred;1177 parameters.top_left() = centred;
1175 parameters.size() = Size{active_display_area.size.width, parameters.size().value().height};1178 parameters.size() = Size{active_display_area.size.width, parameters.size().value().height};
@@ -1525,37 +1528,37 @@
15251528
1526 switch (original_type)1529 switch (original_type)
1527 {1530 {
1528 case mir_surface_type_normal:1531 case mir_window_type_normal:
1529 case mir_surface_type_utility:1532 case mir_window_type_utility:
1530 case mir_surface_type_dialog:1533 case mir_window_type_dialog:
1531 case mir_surface_type_satellite:1534 case mir_window_type_satellite:
1532 switch (target_type)1535 switch (target_type)
1533 {1536 {
1534 case mir_surface_type_normal:1537 case mir_window_type_normal:
1535 case mir_surface_type_utility:1538 case mir_window_type_utility:
1536 case mir_surface_type_dialog:1539 case mir_window_type_dialog:
1537 case mir_surface_type_satellite:1540 case mir_window_type_satellite:
1538 break;1541 break;
15391542
1540 default:1543 default:
1541 BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change"));1544 BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change"));
1542 }1545 }
15431546
1544 case mir_surface_type_menu:1547 case mir_window_type_menu:
1545 switch (target_type)1548 switch (target_type)
1546 {1549 {
1547 case mir_surface_type_menu:1550 case mir_window_type_menu:
1548 case mir_surface_type_satellite:1551 case mir_window_type_satellite:
1549 break;1552 break;
15501553
1551 default:1554 default:
1552 BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change"));1555 BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change"));
1553 }1556 }
15541557
1555 case mir_surface_type_gloss:1558 case mir_window_type_gloss:
1556 case mir_surface_type_freestyle:1559 case mir_window_type_freestyle:
1557 case mir_surface_type_inputmethod:1560 case mir_window_type_inputmethod:
1558 case mir_surface_type_tip:1561 case mir_window_type_tip:
1559 if (target_type != original_type)1562 if (target_type != original_type)
1560 BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change"));1563 BOOST_THROW_EXCEPTION(std::runtime_error("Invalid surface type change"));
1561 break;1564 break;
@@ -1567,23 +1570,23 @@
15671570
1568 switch (target_type)1571 switch (target_type)
1569 {1572 {
1570 case mir_surface_type_normal:1573 case mir_window_type_normal:
1571 case mir_surface_type_utility:1574 case mir_window_type_utility:
1572 if (modifications.parent().is_set() ? modifications.parent().value().lock() : window_info.parent())1575 if (modifications.parent().is_set() ? modifications.parent().value().lock() : window_info.parent())
1573 BOOST_THROW_EXCEPTION(std::runtime_error("Surface type must not have a parent"));1576 BOOST_THROW_EXCEPTION(std::runtime_error("Window type must not have a parent"));
1574 break;1577 break;
15751578
1576 case mir_surface_type_satellite:1579 case mir_window_type_satellite:
1577 case mir_surface_type_gloss:1580 case mir_window_type_gloss:
1578 case mir_surface_type_tip:1581 case mir_window_type_tip:
1579 if (modifications.parent().is_set() ? !modifications.parent().value().lock() : !window_info.parent())1582 if (modifications.parent().is_set() ? !modifications.parent().value().lock() : !window_info.parent())
1580 BOOST_THROW_EXCEPTION(std::runtime_error("Surface type must have a parent"));1583 BOOST_THROW_EXCEPTION(std::runtime_error("Window type must have a parent"));
1581 break;1584 break;
15821585
1583 case mir_surface_type_inputmethod:1586 case mir_window_type_inputmethod:
1584 case mir_surface_type_dialog:1587 case mir_window_type_dialog:
1585 case mir_surface_type_menu:1588 case mir_window_type_menu:
1586 case mir_surface_type_freestyle:1589 case mir_window_type_freestyle:
1587 break;1590 break;
15881591
1589 default:1592 default:
15901593
=== modified file 'miral/basic_window_manager.h'
--- miral/basic_window_manager.h 2016-12-20 15:34:11 +0000
+++ miral/basic_window_manager.h 2017-01-26 16:46:42 +0000
@@ -94,7 +94,7 @@
94 int set_surface_attribute(94 int set_surface_attribute(
95 std::shared_ptr<mir::scene::Session> const& /*application*/,95 std::shared_ptr<mir::scene::Session> const& /*application*/,
96 std::shared_ptr<mir::scene::Surface> const& surface,96 std::shared_ptr<mir::scene::Surface> const& surface,
97 MirSurfaceAttrib attrib,97 MirWindowAttrib attrib,
98 int value) override;98 int value) override;
9999
100 auto count_applications() const -> unsigned int override;100 auto count_applications() const -> unsigned int override;
@@ -172,7 +172,7 @@
172 void erase(miral::WindowInfo const& info);172 void erase(miral::WindowInfo const& info);
173 void validate_modification_request(WindowSpecification const& modifications, WindowInfo const& window_info) const;173 void validate_modification_request(WindowSpecification const& modifications, WindowInfo const& window_info) const;
174 void place_and_size(WindowInfo& root, Point const& new_pos, Size const& new_size);174 void place_and_size(WindowInfo& root, Point const& new_pos, Size const& new_size);
175 void set_state(miral::WindowInfo& window_info, MirSurfaceState value);175 void set_state(miral::WindowInfo& window_info, MirWindowState value);
176 auto fullscreen_rect_for(WindowInfo const& window_info) const -> Rectangle;176 auto fullscreen_rect_for(WindowInfo const& window_info) const -> Rectangle;
177 void remove_window(Application const& application, miral::WindowInfo const& info);177 void remove_window(Application const& application, miral::WindowInfo const& info);
178};178};
179179
=== added file 'miral/both_versions.h'
--- miral/both_versions.h 1970-01-01 00:00:00 +0000
+++ miral/both_versions.h 2017-01-26 16:46:42 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright © 2017 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#ifndef MIRAL_BOTH_VERSIONS_H
20#define MIRAL_BOTH_VERSIONS_H
21
22#include <mir/version.h>
23
24#if (MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 26, 0))
25 #ifndef __clang__
26 #define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\
27 extern "C" __attribute__((alias(#new_sym))) void old_sym();\
28 __asm__(".symver old_sym,old_sym@" #old_version);\
29 __asm__(".symver new_sym,new_sym@@" #new_version);
30 #else
31 #define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\
32 __asm__(".symver new_sym,old_sym@" #old_version);\
33 __asm__(".symver new_sym,new_sym@@@" #new_version);
34 #endif
35#else
36 #ifndef __clang__
37 #define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\
38 extern "C" __attribute__((alias(#old_sym))) void new_sym();\
39 __asm__(".symver old_sym,old_sym@" #old_version);\
40 __asm__(".symver new_sym,new_sym@@" #new_version);
41 #else
42#define MIRAL_BOTH_VERSIONS(old_sym, old_version, new_sym, new_version)\
43 __asm__(".symver old_sym,old_sym@" #old_version);\
44 __asm__(".symver old_sym,new_sym@@@" #new_version);
45 #endif
46#endif
47
48#endif //MIRAL_BOTH_VERSIONS_H
049
=== modified file 'miral/canonical_window_manager.cpp'
--- miral/canonical_window_manager.cpp 2017-01-18 17:41:46 +0000
+++ miral/canonical_window_manager.cpp 2017-01-26 16:46:42 +0000
@@ -30,7 +30,14 @@
30{30{
31}31}
3232
33auto miral::CanonicalWindowManagerPolicy::place_new_surface(33#ifndef __clang__
34extern "C" __attribute__((alias("_ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE"))) void _ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE();
35__asm__(".symver _ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE,_ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE@MIRAL_1.0");
36#else
37__asm__(".symver _ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE,_ZN5miral28CanonicalWindowManagerPolicy17place_new_surfaceERKNS_15ApplicationInfoERKNS_19WindowSpecificationE@MIRAL_1.0");
38__asm__(".symver _ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE,_ZN5miral28CanonicalWindowManagerPolicy16place_new_windowERKNS_15ApplicationInfoERKNS_19WindowSpecificationE@@@MIRAL_1.1");
39#endif
40auto miral::CanonicalWindowManagerPolicy::place_new_window(
34 miral::ApplicationInfo const& /*app_info*/,41 miral::ApplicationInfo const& /*app_info*/,
35 miral::WindowSpecification const& request_parameters)42 miral::WindowSpecification const& request_parameters)
36 -> miral::WindowSpecification43 -> miral::WindowSpecification
3744
=== modified file 'miral/coordinate_translator.cpp'
--- miral/coordinate_translator.cpp 2016-11-14 10:49:35 +0000
+++ miral/coordinate_translator.cpp 2017-01-26 16:46:42 +0000
@@ -44,3 +44,8 @@
44 auto const& scene_surface = std::dynamic_pointer_cast<mir::scene::Surface>(surface);44 auto const& scene_surface = std::dynamic_pointer_cast<mir::scene::Surface>(surface);
45 return scene_surface->top_left() + mir::geometry::Displacement{x, y};45 return scene_surface->top_left() + mir::geometry::Displacement{x, y};
46}46}
47
48bool miral::CoordinateTranslator::translation_supported() const
49{
50 return enabled;
51}
4752
=== modified file 'miral/coordinate_translator.h'
--- miral/coordinate_translator.h 2016-11-14 10:49:35 +0000
+++ miral/coordinate_translator.h 2017-01-26 16:46:42 +0000
@@ -23,6 +23,11 @@
2323
24#include <atomic>24#include <atomic>
2525
26#ifdef __clang__
27#pragma clang diagnostic push
28#pragma clang diagnostic ignored "-Winconsistent-missing-override"
29#endif
30
26namespace miral31namespace miral
27{32{
28class CoordinateTranslator : public mir::scene::CoordinateTranslator33class CoordinateTranslator : public mir::scene::CoordinateTranslator
@@ -34,9 +39,14 @@
34 auto surface_to_screen(std::shared_ptr<mir::frontend::Surface> surface, int32_t x, int32_t y)39 auto surface_to_screen(std::shared_ptr<mir::frontend::Surface> surface, int32_t x, int32_t y)
35 -> mir::geometry::Point override;40 -> mir::geometry::Point override;
3641
42 bool translation_supported() const;
43
37private:44private:
38 std::atomic<bool> enabled{false};45 std::atomic<bool> enabled{false};
39};46};
40}47}
48#ifdef __clang__
49#pragma clang diagnostic pop
50#endif
4151
42#endif //MIRAL_COORDINATE_TRANSLATOR_H52#endif //MIRAL_COORDINATE_TRANSLATOR_H
4353
=== modified file 'miral/keymap.cpp'
--- miral/keymap.cpp 2016-10-20 07:34:53 +0000
+++ miral/keymap.cpp 2017-01-26 16:46:42 +0000
@@ -25,7 +25,10 @@
25#include <mir/server.h>25#include <mir/server.h>
26#include <mir/version.h>26#include <mir/version.h>
2727
28#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 24, 1)28#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 26, 0)
29#include <mir/input/keymap.h>
30#include <mir/input/mir_keyboard_config.h>
31#elif MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 24, 1)
29#include <mir/input/keymap.h>32#include <mir/input/keymap.h>
30#include <mir/input/keyboard_configuration.h>33#include <mir/input/keyboard_configuration.h>
31#endif34#endif
@@ -112,7 +115,11 @@
112115
113 if (keyboard_config.is_set())116 if (keyboard_config.is_set())
114 {117 {
118#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 26, 0)
119 keymap = keyboard_config.value().device_keymap();
120#else
115 keymap = keyboard_config.value().device_keymap;121 keymap = keyboard_config.value().device_keymap;
122#endif
116 }123 }
117124
118 keymap.layout = layout;125 keymap.layout = layout;
119126
=== modified file 'miral/symbols.map'
--- miral/symbols.map 2016-12-13 13:07:15 +0000
+++ miral/symbols.map 2017-01-26 16:46:42 +0000
@@ -112,7 +112,6 @@
112 miral::WindowInfo::WindowInfo*;112 miral::WindowInfo::WindowInfo*;
113 miral::WindowInfo::add_child*;113 miral::WindowInfo::add_child*;
114 miral::WindowInfo::can_be_active*;114 miral::WindowInfo::can_be_active*;
115 miral::WindowInfo::can_morph_to*;
116 miral::WindowInfo::children*;115 miral::WindowInfo::children*;
117 miral::WindowInfo::confine_pointer*;116 miral::WindowInfo::confine_pointer*;
118 miral::WindowInfo::constrain_resize*;117 miral::WindowInfo::constrain_resize*;
@@ -128,15 +127,12 @@
128 miral::WindowInfo::must_have_parent*;127 miral::WindowInfo::must_have_parent*;
129 miral::WindowInfo::must_not_have_parent*;128 miral::WindowInfo::must_not_have_parent*;
130 miral::WindowInfo::name*;129 miral::WindowInfo::name*;
131 miral::WindowInfo::needs_titlebar*;
132 miral::WindowInfo::operator*;130 miral::WindowInfo::operator*;
133 miral::WindowInfo::output_id*;131 miral::WindowInfo::output_id*;
134 miral::WindowInfo::parent*;132 miral::WindowInfo::parent*;
135 miral::WindowInfo::preferred_orientation*;133 miral::WindowInfo::preferred_orientation*;
136 miral::WindowInfo::remove_child*;134 miral::WindowInfo::remove_child*;
137 miral::WindowInfo::restore_rect*;135 miral::WindowInfo::restore_rect*;
138 miral::WindowInfo::state*;
139 miral::WindowInfo::type*;
140 miral::WindowInfo::userdata*;136 miral::WindowInfo::userdata*;
141 miral::WindowInfo::width_inc*;137 miral::WindowInfo::width_inc*;
142 miral::WindowInfo::window*;138 miral::WindowInfo::window*;
@@ -153,7 +149,6 @@
153 miral::WindowManagementPolicy::advise_new_window*;149 miral::WindowManagementPolicy::advise_new_window*;
154 miral::WindowManagementPolicy::advise_raise*;150 miral::WindowManagementPolicy::advise_raise*;
155 miral::WindowManagementPolicy::advise_resize*;151 miral::WindowManagementPolicy::advise_resize*;
156 miral::WindowManagementPolicy::advise_state_change*;
157 miral::WindowManagementPolicy::operator*;152 miral::WindowManagementPolicy::operator*;
158 miral::WindowManagerOptions::WindowManagerOptions*;153 miral::WindowManagerOptions::WindowManagerOptions*;
159 miral::WindowManagerOptions::operator*;154 miral::WindowManagerOptions::operator*;
@@ -311,5 +306,46 @@
311 vtable?for?miral::toolkit::Surface;306 vtable?for?miral::toolkit::Surface;
312 vtable?for?miral::toolkit::SurfaceSpec;307 vtable?for?miral::toolkit::SurfaceSpec;
313 };308 };
309# miral::WindowInfo::can_morph_to*;
310 _ZNK5miral10WindowInfo12can_morph_toE14MirSurfaceType;
311
312# miral::WindowInfo::needs_titlebar*;
313 _ZN5miral10WindowInfo14needs_titlebarE14MirSurfaceType;
314
315# miral::WindowInfo::state*;
316 _ZNK5miral10WindowInfo5stateEv;
317 _ZN5miral10WindowInfo5stateE15MirSurfaceState;
318
319# miral::WindowInfo::type*;
320 _ZN5miral10WindowInfo4typeE14MirSurfaceType;
321 _ZNK5miral10WindowInfo4typeEv;
322
323# miral::WindowManagementPolicy::advise_state_change*;
324 _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE15MirSurfaceState;
314local: *;325local: *;
315};326};
327
328MIRAL_1.1 {
329global:
330 # miral::WindowInfo::can_morph_to*
331 _ZNK5miral10WindowInfo12can_morph_toE13MirWindowType;
332
333 #miral::WindowInfo::needs_titlebar*;
334 _ZN5miral10WindowInfo14needs_titlebarE13MirWindowType;
335
336 # miral::WindowInfo::state*;
337 _ZNK5miral10WindowInfo5stateEv;
338 _ZN5miral10WindowInfo5stateE14MirWindowState;
339
340 miral::WindowInfo::type*;
341 _ZN5miral10WindowInfo4typeE13MirWindowType;
342 _ZNK5miral10WindowInfo4typeEv;
343
344 # miral::WindowManagementPolicy::advise_state_change*;
345 _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE14MirWindowState;
346
347 extern "C++" {
348 miral::CanonicalWindowManagerPolicy::place_new_window*;
349 non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::place_new_window*;
350 };
351} MIRAL_1.0;
316352
=== modified file 'miral/window_info.cpp'
--- miral/window_info.cpp 2016-12-13 13:07:15 +0000
+++ miral/window_info.cpp 2017-01-26 16:46:42 +0000
@@ -18,7 +18,10 @@
1818
19#include "miral/window_info.h"19#include "miral/window_info.h"
2020
21#include "both_versions.h"
22
21#include <mir/scene/surface.h>23#include <mir/scene/surface.h>
24#include <mir/version.h>
2225
23#include <limits>26#include <limits>
2427
@@ -41,8 +44,8 @@
4144
42 Window window;45 Window window;
43 std::string name;46 std::string name;
44 MirSurfaceType type;47 MirWindowType type;
45 MirSurfaceState state;48 MirWindowState state;
46 mir::geometry::Rectangle restore_rect;49 mir::geometry::Rectangle restore_rect;
47 Window parent;50 Window parent;
48 std::vector <Window> children;51 std::vector <Window> children;
@@ -64,8 +67,8 @@
64miral::WindowInfo::Self::Self(Window window, WindowSpecification const& params) :67miral::WindowInfo::Self::Self(Window window, WindowSpecification const& params) :
65 window{window},68 window{window},
66 name{params.name().value()},69 name{params.name().value()},
67 type{optional_value_or_default(params.type(), mir_surface_type_normal)},70 type{optional_value_or_default(params.type(), mir_window_type_normal)},
68 state{optional_value_or_default(params.state(), mir_surface_state_restored)},71 state{optional_value_or_default(params.state(), mir_window_state_restored)},
69 restore_rect{params.top_left().value(), params.size().value()},72 restore_rect{params.top_left().value(), params.size().value()},
70 min_width{optional_value_or_default(params.min_width())},73 min_width{optional_value_or_default(params.min_width())},
71 min_height{optional_value_or_default(params.min_height())},74 min_height{optional_value_or_default(params.min_height())},
@@ -86,8 +89,8 @@
86}89}
8790
88miral::WindowInfo::Self::Self() :91miral::WindowInfo::Self::Self() :
89 type{mir_surface_type_normal},92 type{mir_window_type_normal},
90 state{mir_surface_state_unknown},93 state{mir_window_state_unknown},
91 preferred_orientation{mir_orientation_mode_any}94 preferred_orientation{mir_orientation_mode_any}
92{95{
93}96}
@@ -123,17 +126,17 @@
123{126{
124 switch (type())127 switch (type())
125 {128 {
126 case mir_surface_type_normal: /**< AKA "regular" */129 case mir_window_type_normal: /**< AKA "regular" */
127 case mir_surface_type_utility: /**< AKA "floating" */130 case mir_window_type_utility: /**< AKA "floating" */
128 case mir_surface_type_dialog:131 case mir_window_type_dialog:
129 case mir_surface_type_satellite: /**< AKA "toolbox"/"toolbar" */132 case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */
130 case mir_surface_type_freestyle:133 case mir_window_type_freestyle:
131 case mir_surface_type_menu:134 case mir_window_type_menu:
132 case mir_surface_type_inputmethod: /**< AKA "OSK" or handwriting etc. */135 case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */
133 return true;136 return true;
134137
135 case mir_surface_type_gloss:138 case mir_window_type_gloss:
136 case mir_surface_type_tip: /**< AKA "tooltip" */139 case mir_window_type_tip: /**< AKA "tooltip" */
137 default:140 default:
138 // Cannot have input focus141 // Cannot have input focus
139 return false;142 return false;
@@ -144,10 +147,10 @@
144{147{
145 switch (type())148 switch (type())
146 {149 {
147 case mir_surface_type_overlay:;150 case mir_window_type_gloss:;
148 case mir_surface_type_inputmethod:151 case mir_window_type_inputmethod:
149 case mir_surface_type_satellite:152 case mir_window_type_satellite:
150 case mir_surface_type_tip:153 case mir_window_type_tip:
151 return true;154 return true;
152155
153 default:156 default:
@@ -155,19 +158,22 @@
155 }158 }
156}159}
157160
158bool miral::WindowInfo::can_morph_to(MirSurfaceType new_type) const161MIRAL_BOTH_VERSIONS(
162 _ZNK5miral10WindowInfo12can_morph_toE14MirSurfaceType, MIRAL_1.0,
163 _ZNK5miral10WindowInfo12can_morph_toE13MirWindowType, MIRAL_1.1)
164bool miral::WindowInfo::can_morph_to(MirWindowType new_type) const
159{165{
160 switch (new_type)166 switch (new_type)
161 {167 {
162 case mir_surface_type_normal:168 case mir_window_type_normal:
163 case mir_surface_type_utility:169 case mir_window_type_utility:
164 case mir_surface_type_satellite:170 case mir_window_type_satellite:
165 switch (type())171 switch (type())
166 {172 {
167 case mir_surface_type_normal:173 case mir_window_type_normal:
168 case mir_surface_type_utility:174 case mir_window_type_utility:
169 case mir_surface_type_dialog:175 case mir_window_type_dialog:
170 case mir_surface_type_satellite:176 case mir_window_type_satellite:
171 return true;177 return true;
172178
173 default:179 default:
@@ -175,14 +181,14 @@
175 }181 }
176 break;182 break;
177183
178 case mir_surface_type_dialog:184 case mir_window_type_dialog:
179 switch (type())185 switch (type())
180 {186 {
181 case mir_surface_type_normal:187 case mir_window_type_normal:
182 case mir_surface_type_utility:188 case mir_window_type_utility:
183 case mir_surface_type_dialog:189 case mir_window_type_dialog:
184 case mir_surface_type_popover:190 case mir_window_type_menu:
185 case mir_surface_type_satellite:191 case mir_window_type_satellite:
186 return true;192 return true;
187193
188 default:194 default:
@@ -201,8 +207,8 @@
201{207{
202 switch (type())208 switch (type())
203 {209 {
204 case mir_surface_type_normal:210 case mir_window_type_normal:
205 case mir_surface_type_utility:211 case mir_window_type_utility:
206 return true;212 return true;
207213
208 default:214 default:
@@ -214,8 +220,8 @@
214{220{
215 switch (state())221 switch (state())
216 {222 {
217 case mir_surface_state_hidden:223 case mir_window_state_hidden:
218 case mir_surface_state_minimized:224 case mir_window_state_minimized:
219 return false;225 return false;
220 default:226 default:
221 if (std::shared_ptr<mir::scene::Surface> surface = window())227 if (std::shared_ptr<mir::scene::Surface> surface = window())
@@ -312,19 +318,19 @@
312318
313 switch (state())319 switch (state())
314 {320 {
315 case mir_surface_state_restored:321 case mir_window_state_restored:
316 break;322 break;
317323
318 // "A vertically maximised window is anchored to the top and bottom of324 // "A vertically maximised window is anchored to the top and bottom of
319 // the available workspace and can have any width."325 // the available workspace and can have any width."
320 case mir_surface_state_vertmaximized:326 case mir_window_state_vertmaximized:
321 new_pos.y = self->window.top_left().y;327 new_pos.y = self->window.top_left().y;
322 new_size.height = self->window.size().height;328 new_size.height = self->window.size().height;
323 break;329 break;
324330
325 // "A horizontally maximised window is anchored to the left and right of331 // "A horizontally maximised window is anchored to the left and right of
326 // the available workspace and can have any height"332 // the available workspace and can have any height"
327 case mir_surface_state_horizmaximized:333 case mir_window_state_horizmaximized:
328 new_pos.x = self->window.top_left().x;334 new_pos.x = self->window.top_left().x;
329 new_size.width = self->window.size().width;335 new_size.width = self->window.size().width;
330 break;336 break;
@@ -332,7 +338,7 @@
332 // "A maximised window is anchored to the top, bottom, left and right of the338 // "A maximised window is anchored to the top, bottom, left and right of the
333 // available workspace. For example, if the launcher is always-visible then339 // available workspace. For example, if the launcher is always-visible then
334 // the left-edge of the window is anchored to the right-edge of the launcher."340 // the left-edge of the window is anchored to the right-edge of the launcher."
335 case mir_surface_state_maximized:341 case mir_window_state_maximized:
336 default:342 default:
337 new_pos.x = self->window.top_left().x;343 new_pos.x = self->window.top_left().x;
338 new_pos.y = self->window.top_left().y;344 new_pos.y = self->window.top_left().y;
@@ -345,15 +351,18 @@
345 requested_size = new_size;351 requested_size = new_size;
346}352}
347353
348bool miral::WindowInfo::needs_titlebar(MirSurfaceType type)354MIRAL_BOTH_VERSIONS(
355 _ZN5miral10WindowInfo14needs_titlebarE14MirSurfaceType, MIRAL_1.0,
356 _ZN5miral10WindowInfo14needs_titlebarE13MirWindowType, MIRAL_1.1)
357bool miral::WindowInfo::needs_titlebar(MirWindowType type)
349{358{
350 switch (type)359 switch (type)
351 {360 {
352 case mir_surface_type_freestyle:361 case mir_window_type_freestyle:
353 case mir_surface_type_menu:362 case mir_window_type_menu:
354 case mir_surface_type_inputmethod:363 case mir_window_type_inputmethod:
355 case mir_surface_type_gloss:364 case mir_window_type_gloss:
356 case mir_surface_type_tip:365 case mir_window_type_tip:
357 // No decorations for these surface types366 // No decorations for these surface types
358 return false;367 return false;
359 default:368 default:
@@ -361,22 +370,28 @@
361 }370 }
362}371}
363372
364auto miral::WindowInfo::type() const -> MirSurfaceType373auto miral::WindowInfo::type() const -> MirWindowType
365{374{
366 return self->type;375 return self->type;
367}376}
368377
369void miral::WindowInfo::type(MirSurfaceType type)378MIRAL_BOTH_VERSIONS(
379 _ZN5miral10WindowInfo4typeE14MirSurfaceType, MIRAL_1.0,
380 _ZN5miral10WindowInfo4typeE13MirWindowType, MIRAL_1.1)
381void miral::WindowInfo::type(MirWindowType type)
370{382{
371 self->type = type;383 self->type = type;
372}384}
373385
374auto miral::WindowInfo::state() const -> MirSurfaceState386auto miral::WindowInfo::state() const -> MirWindowState
375{387{
376 return self->state;388 return self->state;
377}389}
378390
379void miral::WindowInfo::state(MirSurfaceState state)391MIRAL_BOTH_VERSIONS(
392 _ZN5miral10WindowInfo5stateE15MirSurfaceState, MIRAL_1.0,
393 _ZN5miral10WindowInfo5stateE14MirWindowState, MIRAL_1.1)
394void miral::WindowInfo::state(MirWindowState state)
380{395{
381 self->state = state;396 self->state = state;
382}397}
383398
=== modified file 'miral/window_management_policy.cpp'
--- miral/window_management_policy.cpp 2016-08-10 11:48:02 +0000
+++ miral/window_management_policy.cpp 2017-01-26 16:46:42 +0000
@@ -17,6 +17,7 @@
17 */17 */
1818
19#include "miral/window_management_policy.h"19#include "miral/window_management_policy.h"
20#include "both_versions.h"
2021
21void miral::WindowManagementPolicy::advise_begin() {}22void miral::WindowManagementPolicy::advise_begin() {}
22void miral::WindowManagementPolicy::advise_end() {}23void miral::WindowManagementPolicy::advise_end() {}
@@ -25,7 +26,11 @@
25void miral::WindowManagementPolicy::advise_new_window(WindowInfo const& /*window_info*/) {}26void miral::WindowManagementPolicy::advise_new_window(WindowInfo const& /*window_info*/) {}
26void miral::WindowManagementPolicy::advise_focus_lost(WindowInfo const& /*info*/) {}27void miral::WindowManagementPolicy::advise_focus_lost(WindowInfo const& /*info*/) {}
27void miral::WindowManagementPolicy::advise_focus_gained(WindowInfo const& /*info*/) {}28void miral::WindowManagementPolicy::advise_focus_gained(WindowInfo const& /*info*/) {}
28void miral::WindowManagementPolicy::advise_state_change(WindowInfo const& /*window_info*/, MirSurfaceState /*state*/) {}29
30MIRAL_BOTH_VERSIONS(
31 _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE15MirSurfaceState, MIRAL_1.0,
32 _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE14MirWindowState, MIRAL_1.1)
33void miral::WindowManagementPolicy::advise_state_change(WindowInfo const& /*window_info*/, MirWindowState /*state*/) {}
29void miral::WindowManagementPolicy::advise_move_to(WindowInfo const& /*window_info*/, Point /*top_left*/) {}34void miral::WindowManagementPolicy::advise_move_to(WindowInfo const& /*window_info*/, Point /*top_left*/) {}
30void miral::WindowManagementPolicy::advise_resize(WindowInfo const& /*window_info*/, Size const& /*new_size*/) {}35void miral::WindowManagementPolicy::advise_resize(WindowInfo const& /*window_info*/, Size const& /*new_size*/) {}
31void miral::WindowManagementPolicy::advise_delete_window(WindowInfo const& /*window_info*/) {}36void miral::WindowManagementPolicy::advise_delete_window(WindowInfo const& /*window_info*/) {}
3237
=== modified file 'miral/window_management_trace.cpp'
--- miral/window_management_trace.cpp 2016-12-05 09:46:35 +0000
+++ miral/window_management_trace.cpp 2017-01-26 16:46:42 +0000
@@ -29,9 +29,20 @@
2929
30#define MIR_LOG_COMPONENT "miral::Window Management"30#define MIR_LOG_COMPONENT "miral::Window Management"
31#include <mir/log.h>31#include <mir/log.h>
32#include <mir/report_exception.h>
3233
33using mir::operator<<;34using mir::operator<<;
3435
36#define MIRAL_TRACE_EXCEPTION \
37catch (std::exception const& x)\
38{\
39 std::stringstream out;\
40 mir::report_exception(out);\
41 mir::log_warning("%s throws %s", __func__, out.str().c_str());\
42 throw;\
43}
44
45
35namespace46namespace
36{47{
37std::string const null_ptr{"(null)"};48std::string const null_ptr{"(null)"};
@@ -273,7 +284,7 @@
273 return out.str();284 return out.str();
274}285}
275286
276auto dump_of(MirSurfaceState state) -> std::string287auto dump_of(MirWindowState state) -> std::string
277{288{
278 std::stringstream out;289 std::stringstream out;
279 out << state;290 out << state;
@@ -304,95 +315,105 @@
304}315}
305316
306auto miral::WindowManagementTrace::count_applications() const -> unsigned int317auto miral::WindowManagementTrace::count_applications() const -> unsigned int
307{318try {
308 log_input();319 log_input();
309 auto const result = wrapped.count_applications();320 auto const result = wrapped.count_applications();
310 mir::log_info("%s -> %d", __func__, result);321 mir::log_info("%s -> %d", __func__, result);
311 trace_count++;322 trace_count++;
312 return result;323 return result;
313}324}
325MIRAL_TRACE_EXCEPTION
314326
315void miral::WindowManagementTrace::for_each_application(std::function<void(miral::ApplicationInfo&)> const& functor)327void miral::WindowManagementTrace::for_each_application(std::function<void(miral::ApplicationInfo&)> const& functor)
316{328try {
317 log_input();329 log_input();
318 mir::log_info("%s", __func__);330 mir::log_info("%s", __func__);
319 trace_count++;331 trace_count++;
320 wrapped.for_each_application(functor);332 wrapped.for_each_application(functor);
321}333}
334MIRAL_TRACE_EXCEPTION
322335
323auto miral::WindowManagementTrace::find_application(std::function<bool(ApplicationInfo const& info)> const& predicate)336auto miral::WindowManagementTrace::find_application(std::function<bool(ApplicationInfo const& info)> const& predicate)
324-> Application337-> Application
325{338try {
326 log_input();339 log_input();
327 auto result = wrapped.find_application(predicate);340 auto result = wrapped.find_application(predicate);
328 mir::log_info("%s -> %s", __func__, dump_of(result).c_str());341 mir::log_info("%s -> %s", __func__, dump_of(result).c_str());
329 trace_count++;342 trace_count++;
330 return result;343 return result;
331}344}
345MIRAL_TRACE_EXCEPTION
332346
333auto miral::WindowManagementTrace::info_for(std::weak_ptr<mir::scene::Session> const& session) const -> ApplicationInfo&347auto miral::WindowManagementTrace::info_for(std::weak_ptr<mir::scene::Session> const& session) const -> ApplicationInfo&
334{348try {
335 log_input();349 log_input();
336 auto& result = wrapped.info_for(session);350 auto& result = wrapped.info_for(session);
337 mir::log_info("%s -> %s", __func__, result.application()->name().c_str());351 mir::log_info("%s -> %s", __func__, result.application()->name().c_str());
338 trace_count++;352 trace_count++;
339 return result;353 return result;
340}354}
355MIRAL_TRACE_EXCEPTION
341356
342auto miral::WindowManagementTrace::info_for(std::weak_ptr<mir::scene::Surface> const& surface) const -> WindowInfo&357auto miral::WindowManagementTrace::info_for(std::weak_ptr<mir::scene::Surface> const& surface) const -> WindowInfo&
343{358try {
344 log_input();359 log_input();
345 auto& result = wrapped.info_for(surface);360 auto& result = wrapped.info_for(surface);
346 mir::log_info("%s -> %s", __func__, result.name().c_str());361 mir::log_info("%s -> %s", __func__, result.name().c_str());
347 trace_count++;362 trace_count++;
348 return result;363 return result;
349}364}
365MIRAL_TRACE_EXCEPTION
350366
351auto miral::WindowManagementTrace::info_for(Window const& window) const -> WindowInfo&367auto miral::WindowManagementTrace::info_for(Window const& window) const -> WindowInfo&
352{368try {
353 log_input();369 log_input();
354 auto& result = wrapped.info_for(window);370 auto& result = wrapped.info_for(window);
355 mir::log_info("%s -> %s", __func__, result.name().c_str());371 mir::log_info("%s -> %s", __func__, result.name().c_str());
356 trace_count++;372 trace_count++;
357 return result;373 return result;
358}374}
375MIRAL_TRACE_EXCEPTION
359376
360void miral::WindowManagementTrace::ask_client_to_close(miral::Window const& window)377void miral::WindowManagementTrace::ask_client_to_close(miral::Window const& window)
361{378try {
362 log_input();379 log_input();
363 mir::log_info("%s -> %s", __func__, dump_of(window).c_str());380 mir::log_info("%s -> %s", __func__, dump_of(window).c_str());
364 trace_count++;381 trace_count++;
365 wrapped.ask_client_to_close(window);382 wrapped.ask_client_to_close(window);
366}383}
384MIRAL_TRACE_EXCEPTION
367385
368void miral::WindowManagementTrace::force_close(miral::Window const& window)386void miral::WindowManagementTrace::force_close(miral::Window const& window)
369{387try {
370 log_input();388 log_input();
371 mir::log_info("%s -> %s", __func__, dump_of(window).c_str());389 mir::log_info("%s -> %s", __func__, dump_of(window).c_str());
372 trace_count++;390 trace_count++;
373 wrapped.force_close(window);391 wrapped.force_close(window);
374}392}
393MIRAL_TRACE_EXCEPTION
375394
376auto miral::WindowManagementTrace::active_window() const -> Window395auto miral::WindowManagementTrace::active_window() const -> Window
377{396try {
378 log_input();397 log_input();
379 auto result = wrapped.active_window();398 auto result = wrapped.active_window();
380 mir::log_info("%s -> %s", __func__, dump_of(result).c_str());399 mir::log_info("%s -> %s", __func__, dump_of(result).c_str());
381 trace_count++;400 trace_count++;
382 return result;401 return result;
383}402}
403MIRAL_TRACE_EXCEPTION
384404
385auto miral::WindowManagementTrace::select_active_window(Window const& hint) -> Window405auto miral::WindowManagementTrace::select_active_window(Window const& hint) -> Window
386{406try {
387 log_input();407 log_input();
388 auto result = wrapped.select_active_window(hint);408 auto result = wrapped.select_active_window(hint);
389 mir::log_info("%s hint=%s -> %s", __func__, dump_of(hint).c_str(), dump_of(result).c_str());409 mir::log_info("%s hint=%s -> %s", __func__, dump_of(hint).c_str(), dump_of(result).c_str());
390 trace_count++;410 trace_count++;
391 return result;411 return result;
392}412}
413MIRAL_TRACE_EXCEPTION
393414
394auto miral::WindowManagementTrace::window_at(mir::geometry::Point cursor) const -> Window415auto miral::WindowManagementTrace::window_at(mir::geometry::Point cursor) const -> Window
395{416try {
396 log_input();417 log_input();
397 auto result = wrapped.window_at(cursor);418 auto result = wrapped.window_at(cursor);
398 std::stringstream out;419 std::stringstream out;
@@ -401,9 +422,10 @@
401 trace_count++;422 trace_count++;
402 return result;423 return result;
403}424}
425MIRAL_TRACE_EXCEPTION
404426
405auto miral::WindowManagementTrace::active_display() -> mir::geometry::Rectangle const427auto miral::WindowManagementTrace::active_display() -> mir::geometry::Rectangle const
406{428try {
407 log_input();429 log_input();
408 auto result = wrapped.active_display();430 auto result = wrapped.active_display();
409 std::stringstream out;431 std::stringstream out;
@@ -412,35 +434,39 @@
412 trace_count++;434 trace_count++;
413 return result;435 return result;
414}436}
437MIRAL_TRACE_EXCEPTION
415438
416auto miral::WindowManagementTrace::info_for_window_id(std::string const& id) const -> WindowInfo&439auto miral::WindowManagementTrace::info_for_window_id(std::string const& id) const -> WindowInfo&
417{440try {
418 log_input();441 log_input();
419 auto& result = wrapped.info_for_window_id(id);442 auto& result = wrapped.info_for_window_id(id);
420 mir::log_info("%s id=%s -> %s", __func__, id.c_str(), dump_of(result).c_str());443 mir::log_info("%s id=%s -> %s", __func__, id.c_str(), dump_of(result).c_str());
421 trace_count++;444 trace_count++;
422 return result;445 return result;
423}446}
447MIRAL_TRACE_EXCEPTION
424448
425auto miral::WindowManagementTrace::id_for_window(Window const& window) const -> std::string449auto miral::WindowManagementTrace::id_for_window(Window const& window) const -> std::string
426{450try {
427 log_input();451 log_input();
428 auto result = wrapped.id_for_window(window);452 auto result = wrapped.id_for_window(window);
429 mir::log_info("%s window=%s -> %s", __func__, dump_of(window).c_str(), result.c_str());453 mir::log_info("%s window=%s -> %s", __func__, dump_of(window).c_str(), result.c_str());
430 trace_count++;454 trace_count++;
431 return result;455 return result;
432}456}
457MIRAL_TRACE_EXCEPTION
433458
434void miral::WindowManagementTrace::place_and_size_for_state(459void miral::WindowManagementTrace::place_and_size_for_state(
435 WindowSpecification& modifications, WindowInfo const& window_info) const460 WindowSpecification& modifications, WindowInfo const& window_info) const
436{461try {
437 log_input();462 log_input();
438 mir::log_info("%s modifications=%s window_info=%s", __func__, dump_of(modifications).c_str(), dump_of(window_info).c_str());463 mir::log_info("%s modifications=%s window_info=%s", __func__, dump_of(modifications).c_str(), dump_of(window_info).c_str());
439 wrapped.place_and_size_for_state(modifications, window_info);464 wrapped.place_and_size_for_state(modifications, window_info);
440}465}
466MIRAL_TRACE_EXCEPTION
441467
442void miral::WindowManagementTrace::drag_active_window(mir::geometry::Displacement movement)468void miral::WindowManagementTrace::drag_active_window(mir::geometry::Displacement movement)
443{469try {
444 log_input();470 log_input();
445 std::stringstream out;471 std::stringstream out;
446 out << movement;472 out << movement;
@@ -448,79 +474,89 @@
448 trace_count++;474 trace_count++;
449 wrapped.drag_active_window(movement);475 wrapped.drag_active_window(movement);
450}476}
477MIRAL_TRACE_EXCEPTION
451478
452void miral::WindowManagementTrace::focus_next_application()479void miral::WindowManagementTrace::focus_next_application()
453{480try {
454 log_input();481 log_input();
455 mir::log_info("%s", __func__);482 mir::log_info("%s", __func__);
456 trace_count++;483 trace_count++;
457 wrapped.focus_next_application();484 wrapped.focus_next_application();
458}485}
486MIRAL_TRACE_EXCEPTION
459487
460void miral::WindowManagementTrace::focus_next_within_application()488void miral::WindowManagementTrace::focus_next_within_application()
461{489try {
462 log_input();490 log_input();
463 mir::log_info("%s", __func__);491 mir::log_info("%s", __func__);
464 trace_count++;492 trace_count++;
465 wrapped.focus_next_within_application();493 wrapped.focus_next_within_application();
466}494}
495MIRAL_TRACE_EXCEPTION
467496
468void miral::WindowManagementTrace::raise_tree(miral::Window const& root)497void miral::WindowManagementTrace::raise_tree(miral::Window const& root)
469{498try {
470 log_input();499 log_input();
471 mir::log_info("%s root=%s", __func__, dump_of(root).c_str());500 mir::log_info("%s root=%s", __func__, dump_of(root).c_str());
472 trace_count++;501 trace_count++;
473 wrapped.raise_tree(root);502 wrapped.raise_tree(root);
474}503}
504MIRAL_TRACE_EXCEPTION
475505
476void miral::WindowManagementTrace::modify_window(506void miral::WindowManagementTrace::modify_window(
477 miral::WindowInfo& window_info, miral::WindowSpecification const& modifications)507 miral::WindowInfo& window_info, miral::WindowSpecification const& modifications)
478{508try {
479 log_input();509 log_input();
480 mir::log_info("%s window_info=%s, modifications=%s",510 mir::log_info("%s window_info=%s, modifications=%s",
481 __func__, dump_of(window_info).c_str(), dump_of(modifications).c_str());511 __func__, dump_of(window_info).c_str(), dump_of(modifications).c_str());
482 trace_count++;512 trace_count++;
483 wrapped.modify_window(window_info, modifications);513 wrapped.modify_window(window_info, modifications);
484}514}
515MIRAL_TRACE_EXCEPTION
485516
486void miral::WindowManagementTrace::invoke_under_lock(std::function<void()> const& callback)517void miral::WindowManagementTrace::invoke_under_lock(std::function<void()> const& callback)
487{518try {
488 mir::log_info("%s", __func__);519 mir::log_info("%s", __func__);
489 wrapped.invoke_under_lock(callback);520 wrapped.invoke_under_lock(callback);
490}521}
522MIRAL_TRACE_EXCEPTION
491523
492auto miral::WindowManagementTrace::place_new_surface(524auto miral::WindowManagementTrace::place_new_window(
493 ApplicationInfo const& app_info,525 ApplicationInfo const& app_info,
494 WindowSpecification const& requested_specification) -> WindowSpecification526 WindowSpecification const& requested_specification) -> WindowSpecification
495{527try {
496 auto const result = policy->place_new_surface(app_info, requested_specification);528 auto const result = policy->place_new_window(app_info, requested_specification);
497 mir::log_info("%s app_info=%s, requested_specification=%s -> %s",529 mir::log_info("%s app_info=%s, requested_specification=%s -> %s",
498 __func__, dump_of(app_info).c_str(), dump_of(requested_specification).c_str(), dump_of(result).c_str());530 __func__, dump_of(app_info).c_str(), dump_of(requested_specification).c_str(), dump_of(result).c_str());
499 return result;531 return result;
500}532}
533MIRAL_TRACE_EXCEPTION
501534
502void miral::WindowManagementTrace::handle_window_ready(miral::WindowInfo& window_info)535void miral::WindowManagementTrace::handle_window_ready(miral::WindowInfo& window_info)
503{536try {
504 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());537 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());
505 policy->handle_window_ready(window_info);538 policy->handle_window_ready(window_info);
506}539}
540MIRAL_TRACE_EXCEPTION
507541
508void miral::WindowManagementTrace::handle_modify_window(542void miral::WindowManagementTrace::handle_modify_window(
509 miral::WindowInfo& window_info, miral::WindowSpecification const& modifications)543 miral::WindowInfo& window_info, miral::WindowSpecification const& modifications)
510{544try {
511 mir::log_info("%s window_info=%s, modifications=%s",545 mir::log_info("%s window_info=%s, modifications=%s",
512 __func__, dump_of(window_info).c_str(), dump_of(modifications).c_str());546 __func__, dump_of(window_info).c_str(), dump_of(modifications).c_str());
513 policy->handle_modify_window(window_info, modifications);547 policy->handle_modify_window(window_info, modifications);
514}548}
549MIRAL_TRACE_EXCEPTION
515550
516void miral::WindowManagementTrace::handle_raise_window(miral::WindowInfo& window_info)551void miral::WindowManagementTrace::handle_raise_window(miral::WindowInfo& window_info)
517{552try {
518 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());553 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());
519 policy->handle_raise_window(window_info);554 policy->handle_raise_window(window_info);
520}555}
556MIRAL_TRACE_EXCEPTION
521557
522bool miral::WindowManagementTrace::handle_keyboard_event(MirKeyboardEvent const* event)558bool miral::WindowManagementTrace::handle_keyboard_event(MirKeyboardEvent const* event)
523{559try {
524 log_input = [event, this]560 log_input = [event, this]
525 {561 {
526 mir::log_info("handle_keyboard_event event=%s", dump_of(event).c_str());562 mir::log_info("handle_keyboard_event event=%s", dump_of(event).c_str());
@@ -529,9 +565,10 @@
529565
530 return policy->handle_keyboard_event(event);566 return policy->handle_keyboard_event(event);
531}567}
568MIRAL_TRACE_EXCEPTION
532569
533bool miral::WindowManagementTrace::handle_touch_event(MirTouchEvent const* event)570bool miral::WindowManagementTrace::handle_touch_event(MirTouchEvent const* event)
534{571try {
535 log_input = [event, this]572 log_input = [event, this]
536 {573 {
537 mir::log_info("handle_touch_event event=%s", dump_of(event).c_str());574 mir::log_info("handle_touch_event event=%s", dump_of(event).c_str());
@@ -540,9 +577,10 @@
540577
541 return policy->handle_touch_event(event);578 return policy->handle_touch_event(event);
542}579}
580MIRAL_TRACE_EXCEPTION
543581
544bool miral::WindowManagementTrace::handle_pointer_event(MirPointerEvent const* event)582bool miral::WindowManagementTrace::handle_pointer_event(MirPointerEvent const* event)
545{583try {
546 log_input = [event, this]584 log_input = [event, this]
547 {585 {
548 mir::log_info("handle_pointer_event event=%s", dump_of(event).c_str());586 mir::log_info("handle_pointer_event event=%s", dump_of(event).c_str());
@@ -551,87 +589,101 @@
551589
552 return policy->handle_pointer_event(event);590 return policy->handle_pointer_event(event);
553}591}
592MIRAL_TRACE_EXCEPTION
554593
555auto miral::WindowManagementTrace::confirm_inherited_move(WindowInfo const& window_info, Displacement movement)594auto miral::WindowManagementTrace::confirm_inherited_move(WindowInfo const& window_info, Displacement movement)
556-> Rectangle595-> Rectangle
557{596try {
558 std::stringstream out;597 std::stringstream out;
559 out << movement;598 out << movement;
560 mir::log_info("%s window_info=%s, movement=%s", __func__, dump_of(window_info).c_str(), out.str().c_str());599 mir::log_info("%s window_info=%s, movement=%s", __func__, dump_of(window_info).c_str(), out.str().c_str());
561600
562 return policy->confirm_inherited_move(window_info, movement);601 return policy->confirm_inherited_move(window_info, movement);
563}602}
603MIRAL_TRACE_EXCEPTION
564604
565void miral::WindowManagementTrace::advise_begin()605void miral::WindowManagementTrace::advise_begin()
566{606try {
567 log_input = []{};607 log_input = []{};
568 trace_count.store(0);608 trace_count.store(0);
569 policy->advise_begin();609 policy->advise_begin();
570}610}
611MIRAL_TRACE_EXCEPTION
571612
572void miral::WindowManagementTrace::advise_end()613void miral::WindowManagementTrace::advise_end()
573{614try {
574 if (trace_count.load() > 0)615 if (trace_count.load() > 0)
575 mir::log_info("====");616 mir::log_info("====");
576 policy->advise_end();617 policy->advise_end();
577}618}
619MIRAL_TRACE_EXCEPTION
578620
579void miral::WindowManagementTrace::advise_new_app(miral::ApplicationInfo& application)621void miral::WindowManagementTrace::advise_new_app(miral::ApplicationInfo& application)
580{622try {
581 mir::log_info("%s application=%s", __func__, dump_of(application).c_str());623 mir::log_info("%s application=%s", __func__, dump_of(application).c_str());
582 policy->advise_new_app(application);624 policy->advise_new_app(application);
583}625}
626MIRAL_TRACE_EXCEPTION
584627
585void miral::WindowManagementTrace::advise_delete_app(miral::ApplicationInfo const& application)628void miral::WindowManagementTrace::advise_delete_app(miral::ApplicationInfo const& application)
586{629try {
587 mir::log_info("%s application=%s", __func__, dump_of(application).c_str());630 mir::log_info("%s application=%s", __func__, dump_of(application).c_str());
588 policy->advise_delete_app(application);631 policy->advise_delete_app(application);
589}632}
633MIRAL_TRACE_EXCEPTION
590634
591void miral::WindowManagementTrace::advise_new_window(miral::WindowInfo const& window_info)635void miral::WindowManagementTrace::advise_new_window(miral::WindowInfo const& window_info)
592{636try {
593 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());637 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());
594 policy->advise_new_window(window_info);638 policy->advise_new_window(window_info);
595}639}
640MIRAL_TRACE_EXCEPTION
596641
597void miral::WindowManagementTrace::advise_focus_lost(miral::WindowInfo const& window_info)642void miral::WindowManagementTrace::advise_focus_lost(miral::WindowInfo const& window_info)
598{643try {
599 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());644 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());
600 policy->advise_focus_lost(window_info);645 policy->advise_focus_lost(window_info);
601}646}
647MIRAL_TRACE_EXCEPTION
602648
603void miral::WindowManagementTrace::advise_focus_gained(miral::WindowInfo const& window_info)649void miral::WindowManagementTrace::advise_focus_gained(miral::WindowInfo const& window_info)
604{650try {
605 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());651 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());
606 policy->advise_focus_gained(window_info);652 policy->advise_focus_gained(window_info);
607}653}
654MIRAL_TRACE_EXCEPTION
608655
609void miral::WindowManagementTrace::advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state)656void miral::WindowManagementTrace::advise_state_change(miral::WindowInfo const& window_info, MirWindowState state)
610{657try {
611 mir::log_info("%s window_info=%s, state=%s", __func__, dump_of(window_info).c_str(), dump_of(state).c_str());658 mir::log_info("%s window_info=%s, state=%s", __func__, dump_of(window_info).c_str(), dump_of(state).c_str());
612 policy->advise_state_change(window_info, state);659 policy->advise_state_change(window_info, state);
613}660}
661MIRAL_TRACE_EXCEPTION
614662
615void miral::WindowManagementTrace::advise_move_to(miral::WindowInfo const& window_info, mir::geometry::Point top_left)663void miral::WindowManagementTrace::advise_move_to(miral::WindowInfo const& window_info, mir::geometry::Point top_left)
616{664try {
617 mir::log_info("%s window_info=%s, top_left=%s", __func__, dump_of(window_info).c_str(), dump_of(top_left).c_str());665 mir::log_info("%s window_info=%s, top_left=%s", __func__, dump_of(window_info).c_str(), dump_of(top_left).c_str());
618 policy->advise_move_to(window_info, top_left);666 policy->advise_move_to(window_info, top_left);
619}667}
668MIRAL_TRACE_EXCEPTION
620669
621void miral::WindowManagementTrace::advise_resize(miral::WindowInfo const& window_info, mir::geometry::Size const& new_size)670void miral::WindowManagementTrace::advise_resize(miral::WindowInfo const& window_info, mir::geometry::Size const& new_size)
622{671try {
623 mir::log_info("%s window_info=%s, new_size=%s", __func__, dump_of(window_info).c_str(), dump_of(new_size).c_str());672 mir::log_info("%s window_info=%s, new_size=%s", __func__, dump_of(window_info).c_str(), dump_of(new_size).c_str());
624 policy->advise_resize(window_info, new_size);673 policy->advise_resize(window_info, new_size);
625}674}
675MIRAL_TRACE_EXCEPTION
626676
627void miral::WindowManagementTrace::advise_delete_window(miral::WindowInfo const& window_info)677void miral::WindowManagementTrace::advise_delete_window(miral::WindowInfo const& window_info)
628{678try {
629 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());679 mir::log_info("%s window_info=%s", __func__, dump_of(window_info).c_str());
630 policy->advise_delete_window(window_info);680 policy->advise_delete_window(window_info);
631}681}
682MIRAL_TRACE_EXCEPTION
632683
633void miral::WindowManagementTrace::advise_raise(std::vector<miral::Window> const& windows)684void miral::WindowManagementTrace::advise_raise(std::vector<miral::Window> const& windows)
634{685try {
635 mir::log_info("%s window_info=%s", __func__, dump_of(windows).c_str());686 mir::log_info("%s window_info=%s", __func__, dump_of(windows).c_str());
636 policy->advise_raise(windows);687 policy->advise_raise(windows);
637}688}
689MIRAL_TRACE_EXCEPTION
638690
=== modified file 'miral/window_management_trace.h'
--- miral/window_management_trace.h 2016-12-05 09:46:35 +0000
+++ miral/window_management_trace.h 2017-01-26 16:46:42 +0000
@@ -71,7 +71,7 @@
7171
72 virtual void invoke_under_lock(std::function<void()> const& callback) override;72 virtual void invoke_under_lock(std::function<void()> const& callback) override;
7373
74 virtual auto place_new_surface(74 virtual auto place_new_window(
75 ApplicationInfo const& app_info,75 ApplicationInfo const& app_info,
76 WindowSpecification const& requested_specification) -> WindowSpecification override;76 WindowSpecification const& requested_specification) -> WindowSpecification override;
77 virtual void handle_window_ready(WindowInfo& window_info) override;77 virtual void handle_window_ready(WindowInfo& window_info) override;
@@ -103,7 +103,7 @@
103103
104 virtual void advise_focus_gained(WindowInfo const& window_info) override;104 virtual void advise_focus_gained(WindowInfo const& window_info) override;
105105
106 virtual void advise_state_change(WindowInfo const& window_info, MirSurfaceState state) override;106 virtual void advise_state_change(WindowInfo const& window_info, MirWindowState state) override;
107107
108 virtual void advise_move_to(WindowInfo const& window_info, Point top_left) override;108 virtual void advise_move_to(WindowInfo const& window_info, Point top_left) override;
109109
110110
=== modified file 'miral/window_specification.cpp'
--- miral/window_specification.cpp 2016-10-25 15:07:46 +0000
+++ miral/window_specification.cpp 2017-01-26 16:46:42 +0000
@@ -37,8 +37,8 @@
37 mir::optional_value<BufferUsage> buffer_usage;37 mir::optional_value<BufferUsage> buffer_usage;
38 mir::optional_value<std::string> name;38 mir::optional_value<std::string> name;
39 mir::optional_value<int> output_id;39 mir::optional_value<int> output_id;
40 mir::optional_value<MirSurfaceType> type;40 mir::optional_value<MirWindowType> type;
41 mir::optional_value<MirSurfaceState> state;41 mir::optional_value<MirWindowState> state;
42 mir::optional_value<MirOrientationMode> preferred_orientation;42 mir::optional_value<MirOrientationMode> preferred_orientation;
43 mir::optional_value<BufferStreamId> content_id;43 mir::optional_value<BufferStreamId> content_id;
44 mir::optional_value<Rectangle> aux_rect;44 mir::optional_value<Rectangle> aux_rect;
@@ -403,12 +403,12 @@
403 return self->output_id;403 return self->output_id;
404}404}
405405
406auto miral::WindowSpecification::type() const -> mir::optional_value<MirSurfaceType> const&406auto miral::WindowSpecification::type() const -> mir::optional_value<MirWindowType> const&
407{407{
408 return self->type;408 return self->type;
409}409}
410410
411auto miral::WindowSpecification::state() const -> mir::optional_value<MirSurfaceState> const&411auto miral::WindowSpecification::state() const -> mir::optional_value<MirWindowState> const&
412{412{
413 return self->state;413 return self->state;
414}414}
@@ -533,12 +533,12 @@
533 return self->output_id;533 return self->output_id;
534}534}
535535
536auto miral::WindowSpecification::type() -> mir::optional_value<MirSurfaceType>&536auto miral::WindowSpecification::type() -> mir::optional_value<MirWindowType>&
537{537{
538 return self->type;538 return self->type;
539}539}
540540
541auto miral::WindowSpecification::state() -> mir::optional_value<MirSurfaceState>&541auto miral::WindowSpecification::state() -> mir::optional_value<MirWindowState>&
542{542{
543 return self->state;543 return self->state;
544}544}
545545
=== modified file 'scripts/process_doxygen_xml.py'
--- scripts/process_doxygen_xml.py 2016-12-13 13:07:15 +0000
+++ scripts/process_doxygen_xml.py 2017-01-26 16:46:42 +0000
@@ -83,17 +83,360 @@
8383
84OLD_STANZAS = '''MIRAL_1.0 {84OLD_STANZAS = '''MIRAL_1.0 {
85global:85global:
86 extern "C++" {
87 miral::ActiveOutputsListener::?ActiveOutputsListener*;
88 miral::ActiveOutputsListener::ActiveOutputsListener*;
89 miral::ActiveOutputsListener::advise_output_begin*;
90 miral::ActiveOutputsListener::advise_output_create*;
91 miral::ActiveOutputsListener::advise_output_delete*;
92 miral::ActiveOutputsListener::advise_output_end*;
93 miral::ActiveOutputsListener::advise_output_update*;
94 miral::ActiveOutputsListener::operator*;
95 miral::ActiveOutputsMonitor::?ActiveOutputsMonitor*;
96 miral::ActiveOutputsMonitor::ActiveOutputsMonitor*;
97 miral::ActiveOutputsMonitor::add_listener*;
98 miral::ActiveOutputsMonitor::delete_listener*;
99 miral::ActiveOutputsMonitor::operator*;
100 miral::ActiveOutputsMonitor::process_outputs*;
101 miral::AddInitCallback::?AddInitCallback*;
102 miral::AddInitCallback::AddInitCallback*;
103 miral::AddInitCallback::operator*;
104 miral::AppendEventFilter::AppendEventFilter*;
105 miral::AppendEventFilter::operator*;
106 miral::ApplicationAuthorizer::?ApplicationAuthorizer*;
107 miral::ApplicationAuthorizer::ApplicationAuthorizer*;
108 miral::ApplicationAuthorizer::operator*;
109 miral::ApplicationCredentials::ApplicationCredentials*;
110 miral::ApplicationCredentials::gid*;
111 miral::ApplicationCredentials::pid*;
112 miral::ApplicationCredentials::uid*;
113 miral::ApplicationInfo::?ApplicationInfo*;
114 miral::ApplicationInfo::ApplicationInfo*;
115 miral::ApplicationInfo::add_window*;
116 miral::ApplicationInfo::application*;
117 miral::ApplicationInfo::name*;
118 miral::ApplicationInfo::operator*;
119 miral::ApplicationInfo::remove_window*;
120 miral::ApplicationInfo::userdata*;
121 miral::ApplicationInfo::windows*;
122 miral::BasicSetApplicationAuthorizer::?BasicSetApplicationAuthorizer*;
123 miral::BasicSetApplicationAuthorizer::BasicSetApplicationAuthorizer*;
124 miral::BasicSetApplicationAuthorizer::operator*;
125 miral::BasicSetApplicationAuthorizer::the_application_authorizer*;
126 miral::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy*;
127 miral::CanonicalWindowManagerPolicy::advise_focus_gained*;
128 miral::CanonicalWindowManagerPolicy::confirm_inherited_move*;
129 miral::CanonicalWindowManagerPolicy::handle_modify_window*;
130 miral::CanonicalWindowManagerPolicy::handle_raise_window*;
131 miral::CanonicalWindowManagerPolicy::handle_window_ready*;
132 miral::CanonicalWindowManagerPolicy::place_new_surface*;
133 miral::CommandLineOption::?CommandLineOption*;
134 miral::CommandLineOption::CommandLineOption*;
135 miral::CommandLineOption::operator*;
136 miral::CursorTheme::?CursorTheme*;
137 miral::CursorTheme::CursorTheme*;
138 miral::CursorTheme::operator*;
139 miral::DebugExtension::DebugExtension*;
140 miral::DebugExtension::disable*;
141 miral::DebugExtension::enable*;
142 miral::DebugExtension::operator*;
143 miral::InternalClientLauncher::?InternalClientLauncher*;
144 miral::InternalClientLauncher::InternalClientLauncher*;
145 miral::InternalClientLauncher::launch*;
146 miral::InternalClientLauncher::operator*;
147 miral::Keymap::?Keymap*;
148 miral::Keymap::Keymap*;
149 miral::Keymap::operator*;
150 miral::Keymap::set_keymap*;
151 miral::MirRunner::?MirRunner*;
152 miral::MirRunner::MirRunner*;
153 miral::MirRunner::add_start_callback*;
154 miral::MirRunner::add_stop_callback*;
155 miral::MirRunner::run_with*;
156 miral::MirRunner::set_exception_handler*;
157 miral::MirRunner::stop*;
158 miral::Output::?Output*;
159 miral::Output::Output*;
160 miral::Output::connected*;
161 miral::Output::extents*;
162 miral::Output::form_factor*;
163 miral::Output::is_same_output*;
164 miral::Output::operator*;
165 miral::Output::orientation*;
166 miral::Output::physical_size_mm*;
167 miral::Output::pixel_format*;
168 miral::Output::power_mode*;
169 miral::Output::refresh_rate*;
170 miral::Output::scale*;
171 miral::Output::type*;
172 miral::Output::used*;
173 miral::Output::valid*;
174 miral::SetCommandLineHandler::?SetCommandLineHandler*;
175 miral::SetCommandLineHandler::SetCommandLineHandler*;
176 miral::SetCommandLineHandler::operator*;
177 miral::SetTerminator::?SetTerminator*;
178 miral::SetTerminator::SetTerminator*;
179 miral::SetTerminator::operator*;
180 miral::SetWindowManagmentPolicy::?SetWindowManagmentPolicy*;
181 miral::SetWindowManagmentPolicy::SetWindowManagmentPolicy*;
182 miral::SetWindowManagmentPolicy::operator*;
183 miral::StartupInternalClient::?StartupInternalClient*;
184 miral::StartupInternalClient::StartupInternalClient*;
185 miral::StartupInternalClient::operator*;
186 miral::Window::?Window*;
187 miral::Window::Window*;
188 miral::Window::application*;
189 miral::Window::move_to*;
190 miral::Window::operator*;
191 miral::Window::resize*;
192 miral::Window::size*;
193 miral::Window::top_left*;
194 miral::WindowInfo::?WindowInfo*;
195 miral::WindowInfo::WindowInfo*;
196 miral::WindowInfo::add_child*;
197 miral::WindowInfo::can_be_active*;
198 miral::WindowInfo::children*;
199 miral::WindowInfo::confine_pointer*;
200 miral::WindowInfo::constrain_resize*;
201 miral::WindowInfo::has_output_id*;
202 miral::WindowInfo::height_inc*;
203 miral::WindowInfo::is_visible*;
204 miral::WindowInfo::max_aspect*;
205 miral::WindowInfo::max_height*;
206 miral::WindowInfo::max_width*;
207 miral::WindowInfo::min_aspect*;
208 miral::WindowInfo::min_height*;
209 miral::WindowInfo::min_width*;
210 miral::WindowInfo::must_have_parent*;
211 miral::WindowInfo::must_not_have_parent*;
212 miral::WindowInfo::name*;
213 miral::WindowInfo::operator*;
214 miral::WindowInfo::output_id*;
215 miral::WindowInfo::parent*;
216 miral::WindowInfo::preferred_orientation*;
217 miral::WindowInfo::remove_child*;
218 miral::WindowInfo::restore_rect*;
219 miral::WindowInfo::userdata*;
220 miral::WindowInfo::width_inc*;
221 miral::WindowInfo::window*;
222 miral::WindowManagementPolicy::?WindowManagementPolicy*;
223 miral::WindowManagementPolicy::WindowManagementPolicy*;
224 miral::WindowManagementPolicy::advise_begin*;
225 miral::WindowManagementPolicy::advise_delete_app*;
226 miral::WindowManagementPolicy::advise_delete_window*;
227 miral::WindowManagementPolicy::advise_end*;
228 miral::WindowManagementPolicy::advise_focus_gained*;
229 miral::WindowManagementPolicy::advise_focus_lost*;
230 miral::WindowManagementPolicy::advise_move_to*;
231 miral::WindowManagementPolicy::advise_new_app*;
232 miral::WindowManagementPolicy::advise_new_window*;
233 miral::WindowManagementPolicy::advise_raise*;
234 miral::WindowManagementPolicy::advise_resize*;
235 miral::WindowManagementPolicy::operator*;
236 miral::WindowManagerOptions::WindowManagerOptions*;
237 miral::WindowManagerOptions::operator*;
238 miral::WindowManagerTools::?WindowManagerTools*;
239 miral::WindowManagerTools::WindowManagerTools*;
240 miral::WindowManagerTools::active_display*;
241 miral::WindowManagerTools::active_window*;
242 miral::WindowManagerTools::ask_client_to_close*;
243 miral::WindowManagerTools::count_applications*;
244 miral::WindowManagerTools::drag_active_window*;
245 miral::WindowManagerTools::find_application*;
246 miral::WindowManagerTools::focus_next_application*;
247 miral::WindowManagerTools::focus_next_within_application*;
248 miral::WindowManagerTools::for_each_application*;
249 miral::WindowManagerTools::force_close*;
250 miral::WindowManagerTools::id_for_window*;
251 miral::WindowManagerTools::info_for*;
252 miral::WindowManagerTools::info_for_window_id*;
253 miral::WindowManagerTools::invoke_under_lock*;
254 miral::WindowManagerTools::modify_window*;
255 miral::WindowManagerTools::operator*;
256 miral::WindowManagerTools::place_and_size_for_state*;
257 miral::WindowManagerTools::raise_tree*;
258 miral::WindowManagerTools::select_active_window*;
259 miral::WindowManagerTools::window_at*;
260 miral::WindowSpecification::?WindowSpecification*;
261 miral::WindowSpecification::WindowSpecification*;
262 miral::WindowSpecification::aux_rect*;
263 miral::WindowSpecification::aux_rect_placement_gravity*;
264 miral::WindowSpecification::aux_rect_placement_offset*;
265 miral::WindowSpecification::confine_pointer*;
266 miral::WindowSpecification::height_inc*;
267 miral::WindowSpecification::input_mode*;
268 miral::WindowSpecification::input_shape*;
269 miral::WindowSpecification::max_aspect*;
270 miral::WindowSpecification::max_height*;
271 miral::WindowSpecification::max_width*;
272 miral::WindowSpecification::min_aspect*;
273 miral::WindowSpecification::min_height*;
274 miral::WindowSpecification::min_width*;
275 miral::WindowSpecification::name*;
276 miral::WindowSpecification::operator*;
277 miral::WindowSpecification::output_id*;
278 miral::WindowSpecification::parent*;
279 miral::WindowSpecification::placement_hints*;
280 miral::WindowSpecification::preferred_orientation*;
281 miral::WindowSpecification::shell_chrome*;
282 miral::WindowSpecification::size*;
283 miral::WindowSpecification::state*;
284 miral::WindowSpecification::top_left*;
285 miral::WindowSpecification::type*;
286 miral::WindowSpecification::update*;
287 miral::WindowSpecification::userdata*;
288 miral::WindowSpecification::width_inc*;
289 miral::WindowSpecification::window_placement_gravity*;
290 miral::apply_lifecycle_state_to*;
291 miral::display_configuration_options*;
292 miral::equivalent_display_area*;
293 miral::kill*;
294 miral::name_of*;
295 miral::operator*;
296 miral::pid_of*;
297 miral::toolkit::Connection::Connection*;
298 miral::toolkit::Surface::Surface*;
299 non-virtual?thunk?to?miral::ActiveOutputsListener::?ActiveOutputsListener*;
300 non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_begin*;
301 non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_create*;
302 non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_delete*;
303 non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_end*;
304 non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_update*;
305 non-virtual?thunk?to?miral::ApplicationAuthorizer::?ApplicationAuthorizer*;
306 non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::advise_focus_gained*;
307 non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::confirm_inherited_move*;
308 non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_modify_window*;
309 non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_raise_window*;
310 non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_window_ready*;
311 non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::place_new_surface*;
312 non-virtual?thunk?to?miral::WindowManagementPolicy::?WindowManagementPolicy*;
313 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_begin*;
314 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_delete_app*;
315 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_delete_window*;
316 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_end*;
317 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_focus_gained*;
318 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_focus_lost*;
319 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_move_to*;
320 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_new_app*;
321 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_new_window*;
322 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_raise*;
323 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_resize*;
324 non-virtual?thunk?to?miral::WindowManagementPolicy::advise_state_change*;
325 typeinfo?for?miral::ActiveOutputsListener;
326 typeinfo?for?miral::ActiveOutputsMonitor;
327 typeinfo?for?miral::AddInitCallback;
328 typeinfo?for?miral::AppendEventFilter;
329 typeinfo?for?miral::ApplicationAuthorizer;
330 typeinfo?for?miral::ApplicationCredentials;
331 typeinfo?for?miral::ApplicationInfo;
332 typeinfo?for?miral::BasicSetApplicationAuthorizer;
333 typeinfo?for?miral::CanonicalWindowManagerPolicy;
334 typeinfo?for?miral::CommandLineOption;
335 typeinfo?for?miral::CursorTheme;
336 typeinfo?for?miral::DebugExtension;
337 typeinfo?for?miral::InternalClientLauncher;
338 typeinfo?for?miral::Keymap;
339 typeinfo?for?miral::MirRunner;
340 typeinfo?for?miral::Output;
341 typeinfo?for?miral::Output::PhysicalSizeMM;
342 typeinfo?for?miral::SetCommandLineHandler;
343 typeinfo?for?miral::SetTerminator;
344 typeinfo?for?miral::SetWindowManagmentPolicy;
345 typeinfo?for?miral::StartupInternalClient;
346 typeinfo?for?miral::Window;
347 typeinfo?for?miral::WindowInfo;
348 typeinfo?for?miral::WindowManagementPolicy;
349 typeinfo?for?miral::WindowManagerOption;
350 typeinfo?for?miral::WindowManagerOptions;
351 typeinfo?for?miral::WindowManagerTools;
352 typeinfo?for?miral::WindowSpecification;
353 typeinfo?for?miral::WindowSpecification::AspectRatio;
354 typeinfo?for?miral::toolkit::Connection;
355 typeinfo?for?miral::toolkit::PersistentId;
356 typeinfo?for?miral::toolkit::Surface;
357 typeinfo?for?miral::toolkit::SurfaceSpec;
358 vtable?for?miral::ActiveOutputsListener;
359 vtable?for?miral::ActiveOutputsMonitor;
360 vtable?for?miral::AddInitCallback;
361 vtable?for?miral::AppendEventFilter;
362 vtable?for?miral::ApplicationAuthorizer;
363 vtable?for?miral::ApplicationCredentials;
364 vtable?for?miral::ApplicationInfo;
365 vtable?for?miral::BasicSetApplicationAuthorizer;
366 vtable?for?miral::CanonicalWindowManagerPolicy;
367 vtable?for?miral::CommandLineOption;
368 vtable?for?miral::CursorTheme;
369 vtable?for?miral::DebugExtension;
370 vtable?for?miral::InternalClientLauncher;
371 vtable?for?miral::Keymap;
372 vtable?for?miral::MirRunner;
373 vtable?for?miral::Output;
374 vtable?for?miral::Output::PhysicalSizeMM;
375 vtable?for?miral::SetCommandLineHandler;
376 vtable?for?miral::SetTerminator;
377 vtable?for?miral::SetWindowManagmentPolicy;
378 vtable?for?miral::StartupInternalClient;
379 vtable?for?miral::Window;
380 vtable?for?miral::WindowInfo;
381 vtable?for?miral::WindowManagementPolicy;
382 vtable?for?miral::WindowManagerOption;
383 vtable?for?miral::WindowManagerOptions;
384 vtable?for?miral::WindowManagerTools;
385 vtable?for?miral::WindowSpecification;
386 vtable?for?miral::WindowSpecification::AspectRatio;
387 vtable?for?miral::toolkit::Connection;
388 vtable?for?miral::toolkit::PersistentId;
389 vtable?for?miral::toolkit::Surface;
390 vtable?for?miral::toolkit::SurfaceSpec;
391 };
392# miral::WindowInfo::can_morph_to*;
393 _ZNK5miral10WindowInfo12can_morph_toE14MirSurfaceType;
394
395# miral::WindowInfo::needs_titlebar*;
396 _ZN5miral10WindowInfo14needs_titlebarE14MirSurfaceType;
397
398# miral::WindowInfo::state*;
399 _ZNK5miral10WindowInfo5stateEv;
400 _ZN5miral10WindowInfo5stateE15MirSurfaceState;
401
402# miral::WindowInfo::type*;
403 _ZN5miral10WindowInfo4typeE14MirSurfaceType;
404 _ZNK5miral10WindowInfo4typeEv;
405
406# miral::WindowManagementPolicy::advise_state_change*;
407 _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE15MirSurfaceState;
408local: *;
409};
410
411MIRAL_1.1 {
412global:
413 # miral::WindowInfo::can_morph_to*
414 _ZNK5miral10WindowInfo12can_morph_toE13MirWindowType;
415
416 #miral::WindowInfo::needs_titlebar*;
417 _ZN5miral10WindowInfo14needs_titlebarE13MirWindowType;
418
419 # miral::WindowInfo::state*;
420 _ZNK5miral10WindowInfo5stateEv;
421 _ZN5miral10WindowInfo5stateE14MirWindowState;
422
423 miral::WindowInfo::type*;
424 _ZN5miral10WindowInfo4typeE13MirWindowType;
425 _ZNK5miral10WindowInfo4typeEv;
426
427 # miral::WindowManagementPolicy::advise_state_change*;
428 _ZN5miral22WindowManagementPolicy19advise_state_changeERKNS_10WindowInfoE14MirWindowState;
429
86 extern "C++" {'''430 extern "C++" {'''
87431
88END_NEW_STANZA = ''' };432END_NEW_STANZA = ''' };
89local: *;433} MIRAL_1.0;'''
90};'''
91434
92def _print_report():435def _print_report():
93 print OLD_STANZAS436 print OLD_STANZAS
94 for symbol in sorted(SYMBOLS['public']):437 for symbol in sorted(SYMBOLS['public']):
95 formatted_symbol = ' {};'.format(symbol)438 formatted_symbol = ' {};'.format(symbol)
96 if formatted_symbol not in OLD_STANZAS:439 if formatted_symbol not in OLD_STANZAS and 'miral::toolkit::' not in formatted_symbol:
97 print formatted_symbol440 print formatted_symbol
98 print END_NEW_STANZA441 print END_NEW_STANZA
99442
100443
=== modified file 'test/CMakeLists.txt'
--- test/CMakeLists.txt 2016-11-29 10:33:42 +0000
+++ test/CMakeLists.txt 2017-01-26 16:46:42 +0000
@@ -1,11 +1,11 @@
1if (MIRTEST_VERSION VERSION_LESS 0.25)1if (MIRTEST_VERSION VERSION_LESS 0.26)
2 # Mir used mix struct and class in public test headers (fixed -r 3606 in lp:mir)2 # Mir used mix struct and class in public test headers (fixed -r 3606 in lp:mir)
3 check_cxx_compiler_flag(-Wno-mismatched-tags MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS)3 check_cxx_compiler_flag(-Wno-mismatched-tags MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS)
4 if (MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS)4 if (MIRAL_COMPILE_WITH_W_NO_MISMATCHED_TAGS)
5 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-mismatched-tags")5 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-mismatched-tags")
6 endif()6 endif()
77
8 if (NOT MIRTEST_VERSION VERSION_LESS 0.24)8 if (MIRTEST_VERSION VERSION_EQUAL 0.24)
9 # Mir 0.24 shipped with inconsistent override use in mirtest/mir/test/doubles/stub_session.h (lp:1609612)9 # Mir 0.24 shipped with inconsistent override use in mirtest/mir/test/doubles/stub_session.h (lp:1609612)
10 check_cxx_compiler_flag(-Wno-inconsistent-missing-override MIRAL_COMPILE_WITH_W_NO_INCONSISTENT_MISSING_OVERRIDE)10 check_cxx_compiler_flag(-Wno-inconsistent-missing-override MIRAL_COMPILE_WITH_W_NO_INCONSISTENT_MISSING_OVERRIDE)
11 if (MIRAL_COMPILE_WITH_W_NO_INCONSISTENT_MISSING_OVERRIDE)11 if (MIRAL_COMPILE_WITH_W_NO_INCONSISTENT_MISSING_OVERRIDE)
@@ -13,11 +13,13 @@
13 endif()13 endif()
14 endif()14 endif()
1515
16 # Mir uses "C" linkage to avoid name-mangling some functions that are not16 if (MIRTEST_VERSION VERSION_LESS 0.25)
17 # intended not for C compatibility (lp:1615587) (fixed -r 3668 in lp:mir)17 # Mir uses "C" linkage to avoid name-mangling some functions that are not
18 check_cxx_compiler_flag(-Wno-return-type-c-linkage MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE)18 # intended not for C compatibility (lp:1615587) (fixed -r 3668 in lp:mir)
19 if (MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE)19 check_cxx_compiler_flag(-Wno-return-type-c-linkage MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE)
20 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")20 if (MIRAL_COMPILE_WITH_W_RETURN_TYPE_C_LINKAGE)
21 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")
22 endif()
21 endif()23 endif()
22endif()24endif()
2325
@@ -52,6 +54,7 @@
52 test_window_manager_tools.h54 test_window_manager_tools.h
53 display_reconfiguration.cpp55 display_reconfiguration.cpp
54 active_window.cpp56 active_window.cpp
57 raise_tree.cpp
55)58)
5659
57target_link_libraries(miral-test60target_link_libraries(miral-test
5861
=== modified file 'test/active_window.cpp'
--- test/active_window.cpp 2016-11-30 17:01:17 +0000
+++ test/active_window.cpp 2017-01-26 16:46:42 +0000
@@ -18,8 +18,8 @@
1818
19#include "test_server.h"19#include "test_server.h"
2020
21#include <miral/toolkit/surface.h>21#include <miral/toolkit/window.h>
22#include <miral/toolkit/surface_spec.h>22#include <miral/toolkit/window_spec.h>
23#include <mir_toolkit/mir_buffer_stream.h>23#include <mir_toolkit/mir_buffer_stream.h>
24#include <mir_toolkit/version.h>24#include <mir_toolkit/version.h>
2525
@@ -30,9 +30,9 @@
30#include <gtest/gtest.h>30#include <gtest/gtest.h>
3131
32using namespace testing;32using namespace testing;
33using namespace miral;
34using namespace miral::toolkit;33using namespace miral::toolkit;
35using namespace std::chrono_literals;34using namespace std::chrono_literals;
35using miral::WindowManagerTools;
3636
37namespace37namespace
38{38{
@@ -46,10 +46,15 @@
46 signal.wait_for(100ms);46 signal.wait_for(100ms);
47 }47 }
4848
49 static void raise_signal_on_focus_change(MirSurface* /*surface*/, MirEvent const* event, void* context)49 static void raise_signal_on_focus_change(MirWindow* /*surface*/, MirEvent const* event, void* context)
50 {50 {
51#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
51 if (mir_event_get_type(event) == mir_event_type_surface &&52 if (mir_event_get_type(event) == mir_event_type_surface &&
52 mir_surface_event_get_attribute(mir_event_get_surface_event(event)) == mir_surface_attrib_focus)53 mir_surface_event_get_attribute(mir_event_get_surface_event(event)) == mir_surface_attrib_focus)
54#else
55 if (mir_event_get_type(event) == mir_event_type_window &&
56 mir_window_event_get_attribute(mir_event_get_window_event(event)) == mir_window_attrib_focus)
57#endif
53 {58 {
54 ((FocusChangeSync*)context)->signal.raise();59 ((FocusChangeSync*)context)->signal.raise();
55 }60 }
@@ -61,55 +66,67 @@
61 mir::test::Signal signal;66 mir::test::Signal signal;
62};67};
6368
64struct ActiveWindow : public TestServer69struct ActiveWindow : public miral::TestServer
65{70{
66 FocusChangeSync sync1;71 FocusChangeSync sync1;
67 FocusChangeSync sync2;72 FocusChangeSync sync2;
6873
69 auto create_surface(Connection const& connection, char const* name, FocusChangeSync& sync) -> Surface74 auto create_surface(Connection const& connection, char const* name, FocusChangeSync& sync) -> Window
70 {75 {
71 auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)76 auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
72 .set_buffer_usage(mir_buffer_usage_software)77 .set_buffer_usage(mir_buffer_usage_software)
73 .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync)78 .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync)
74 .set_name(name);79 .set_name(name);
7580
76 Surface const surface{spec.create_surface()};81 Window const surface{spec.create_surface()};
7782
83#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
78 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); });84 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); });
85#else
86 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(surface)); });
87#endif
79 EXPECT_TRUE(sync.signal_raised());88 EXPECT_TRUE(sync.signal_raised());
8089
81 return surface;90 return surface;
82 }91 }
8392
84#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)93#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3, 4, 0)
85 auto create_tip(Connection const& connection, char const* name, Surface const& parent, FocusChangeSync& sync) -> Surface94 auto create_tip(Connection const& connection, char const* name, Window const& parent, FocusChangeSync& sync) -> Window
86 {95 {
87 MirRectangle aux_rect{10, 10, 10, 10};96 MirRectangle aux_rect{10, 10, 10, 10};
88 auto const spec = SurfaceSpec::for_tip(connection, 50, 50, mir_pixel_format_argb_8888, parent, &aux_rect, mir_edge_attachment_any)97 auto const spec = WindowSpec::for_tip(connection, 50, 50, mir_pixel_format_argb_8888, parent, &aux_rect, mir_edge_attachment_any)
89 .set_buffer_usage(mir_buffer_usage_software)98 .set_buffer_usage(mir_buffer_usage_software)
90 .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync)99 .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync)
91 .set_name(name);100 .set_name(name);
92101
93 Surface const surface{spec.create_surface()};102 Window const surface{spec.create_surface()};
94103
95 // Expect this to timeout: A tip should not receive focus104 // Expect this to timeout: A tip should not receive focus
105#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
96 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); });106 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); });
107#else
108 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(surface)); });
109#endif
97 EXPECT_FALSE(sync.signal_raised());110 EXPECT_FALSE(sync.signal_raised());
98111
99 return surface;112 return surface;
100 }113 }
101#endif114#endif
102115
103 auto create_dialog(Connection const& connection, char const* name, Surface const& parent, FocusChangeSync& sync) -> Surface116 auto create_dialog(Connection const& connection, char const* name, Window const& parent, FocusChangeSync& sync) -> Window
104 {117 {
105 auto const spec = SurfaceSpec::for_dialog(connection, 50, 50, mir_pixel_format_argb_8888, parent)118 auto const spec = WindowSpec::for_dialog(connection, 50, 50, mir_pixel_format_argb_8888, parent)
106 .set_buffer_usage(mir_buffer_usage_software)119 .set_buffer_usage(mir_buffer_usage_software)
107 .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync)120 .set_event_handler(&FocusChangeSync::raise_signal_on_focus_change, &sync)
108 .set_name(name);121 .set_name(name);
109122
110 Surface const surface{spec.create_surface()};123 Window const surface{spec.create_surface()};
111124
125#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
112 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); });126 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface)); });
127#else
128 sync.exec([&]{ mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(surface)); });
129#endif
113 EXPECT_TRUE(sync.signal_raised());130 EXPECT_TRUE(sync.signal_raised());
114131
115 return surface;132 return surface;
@@ -155,7 +172,11 @@
155 auto const connection = connect_client(test_name);172 auto const connection = connect_client(test_name);
156 auto const surface = create_surface(connection, test_name, sync1);173 auto const surface = create_surface(connection, test_name, sync1);
157174
175#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
158 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });176 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });
177#else
178 sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); });
179#endif
159180
160 EXPECT_TRUE(sync1.signal_raised());181 EXPECT_TRUE(sync1.signal_raised());
161 assert_no_active_window();182 assert_no_active_window();
@@ -166,9 +187,15 @@
166 char const* const test_name = __PRETTY_FUNCTION__;187 char const* const test_name = __PRETTY_FUNCTION__;
167 auto const connection = connect_client(test_name);188 auto const connection = connect_client(test_name);
168 auto const surface = create_surface(connection, test_name, sync1);189 auto const surface = create_surface(connection, test_name, sync1);
190#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
169 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });191 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });
170192
171 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_restored); });193 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_restored); });
194#else
195 sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); });
196
197 sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_restored); });
198#endif
172 EXPECT_TRUE(sync1.signal_raised());199 EXPECT_TRUE(sync1.signal_raised());
173200
174 assert_active_window_is(test_name);201 assert_active_window_is(test_name);
@@ -193,7 +220,11 @@
193 auto const first_surface = create_surface(connection, test_name, sync1);220 auto const first_surface = create_surface(connection, test_name, sync1);
194 auto const surface = create_surface(connection, another_name, sync2);221 auto const surface = create_surface(connection, another_name, sync2);
195222
223#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
196 sync2.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });224 sync2.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });
225#else
226 sync2.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); });
227#endif
197228
198 EXPECT_TRUE(sync2.signal_raised());229 EXPECT_TRUE(sync2.signal_raised());
199 assert_active_window_is(test_name);230 assert_active_window_is(test_name);
@@ -207,11 +238,17 @@
207 auto const first_surface = create_surface(connection, test_name, sync1);238 auto const first_surface = create_surface(connection, test_name, sync1);
208 auto const surface = create_surface(connection, another_name, sync2);239 auto const surface = create_surface(connection, another_name, sync2);
209240
241#if MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 4, 0)
210 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });242 sync1.exec([&]{ mir_surface_set_state(surface, mir_surface_state_hidden); });
211243
212 // Expect this to timeout244 // Expect this to timeout
213 sync2.exec([&]{ mir_surface_set_state(surface, mir_surface_state_restored); });245 sync2.exec([&]{ mir_surface_set_state(surface, mir_surface_state_restored); });
246#else
247 sync1.exec([&]{ mir_window_set_state(surface, mir_window_state_hidden); });
214248
249 // Expect this to timeout
250 sync2.exec([&]{ mir_window_set_state(surface, mir_window_state_restored); });
251#endif
215 EXPECT_THAT(sync2.signal_raised(), Eq(false));252 EXPECT_THAT(sync2.signal_raised(), Eq(false));
216 assert_active_window_is(test_name);253 assert_active_window_is(test_name);
217}254}
@@ -271,7 +308,7 @@
271308
272 auto const parent = create_surface(connection, test_name, sync1);309 auto const parent = create_surface(connection, test_name, sync1);
273310
274 Window parent_window;311 miral::Window parent_window;
275 invoke_tools([&](WindowManagerTools& tools){ parent_window = tools.active_window(); });312 invoke_tools([&](WindowManagerTools& tools){ parent_window = tools.active_window(); });
276313
277 // Steal the focus314 // Steal the focus
@@ -299,7 +336,7 @@
299336
300 auto const parent = create_surface(connection, test_name, sync1);337 auto const parent = create_surface(connection, test_name, sync1);
301338
302 Window parent_window;339 miral::Window parent_window;
303 invoke_tools([&](WindowManagerTools& tools){ parent_window = tools.active_window(); });340 invoke_tools([&](WindowManagerTools& tools){ parent_window = tools.active_window(); });
304341
305 auto const dialog = create_dialog(connection, dialog_name, parent, sync2);342 auto const dialog = create_dialog(connection, dialog_name, parent, sync2);
306343
=== modified file 'test/display_reconfiguration.cpp'
--- test/display_reconfiguration.cpp 2016-11-10 17:25:38 +0000
+++ test/display_reconfiguration.cpp 2017-01-26 16:46:42 +0000
@@ -51,9 +51,9 @@
51 void create_fullscreen_window()51 void create_fullscreen_window()
52 {52 {
53 mir::scene::SurfaceCreationParameters creation_parameters;53 mir::scene::SurfaceCreationParameters creation_parameters;
54 creation_parameters.type = mir_surface_type_normal;54 creation_parameters.type = mir_window_type_normal;
55 creation_parameters.size = initial_window_size;55 creation_parameters.size = initial_window_size;
56 creation_parameters.state = mir_surface_state_fullscreen;56 creation_parameters.state = mir_window_state_fullscreen;
57 creation_parameters.output_id = mir::graphics::DisplayConfigurationOutputId{0};57 creation_parameters.output_id = mir::graphics::DisplayConfigurationOutputId{0};
5858
59 EXPECT_CALL(*window_manager_policy, advise_new_window(_))59 EXPECT_CALL(*window_manager_policy, advise_new_window(_))
@@ -77,9 +77,9 @@
77 create_fullscreen_window();77 create_fullscreen_window();
7878
79 WindowSpecification mods;79 WindowSpecification mods;
80 mods.state() = mir_surface_state_hidden;80 mods.state() = mir_window_state_hidden;
81 window_manager_tools.modify_window(window, mods);81 window_manager_tools.modify_window(window, mods);
82 mods.state() = mir_surface_state_fullscreen;82 mods.state() = mir_window_state_fullscreen;
83 window_manager_tools.modify_window(window, mods);83 window_manager_tools.modify_window(window, mods);
8484
85 Rectangle const new_display{display_area.top_left+as_displacement({display_width, Height{0}}), display_area.size};85 Rectangle const new_display{display_area.top_left+as_displacement({display_width, Height{0}}), display_area.size};
8686
=== modified file 'test/drag_active_window.cpp'
--- test/drag_active_window.cpp 2016-11-07 12:09:04 +0000
+++ test/drag_active_window.cpp 2017-01-26 16:46:42 +0000
@@ -36,7 +36,7 @@
3636
37auto const null_window = Window{};37auto const null_window = Window{};
3838
39struct DragActiveWindow : TestWindowManagerTools, WithParamInterface<MirSurfaceType>39struct DragActiveWindow : TestWindowManagerTools, WithParamInterface<MirWindowType>
40{40{
41 Size const initial_parent_size{600, 400};41 Size const initial_parent_size{600, 400};
4242
@@ -48,7 +48,7 @@
48 basic_window_manager.add_session(session);48 basic_window_manager.add_session(session);
49 }49 }
5050
51 void create_window_of_type(MirSurfaceType type)51 void create_window_of_type(MirWindowType type)
52 {52 {
53 mir::scene::SurfaceCreationParameters creation_parameters;53 mir::scene::SurfaceCreationParameters creation_parameters;
54 creation_parameters.type = type;54 creation_parameters.type = type;
5555
=== modified file 'test/modify_window_state.cpp'
--- test/modify_window_state.cpp 2016-11-07 12:09:11 +0000
+++ test/modify_window_state.cpp 2017-01-26 16:46:42 +0000
@@ -36,7 +36,7 @@
3636
37auto const null_window = Window{};37auto const null_window = Window{};
3838
39struct ModifyWindowState : TestWindowManagerTools, WithParamInterface<MirSurfaceType>39struct ModifyWindowState : TestWindowManagerTools, WithParamInterface<MirWindowType>
40{40{
41 Size const initial_parent_size{600, 400};41 Size const initial_parent_size{600, 400};
4242
@@ -48,7 +48,7 @@
48 basic_window_manager.add_session(session);48 basic_window_manager.add_session(session);
49 }49 }
5050
51 void create_window_of_type(MirSurfaceType type)51 void create_window_of_type(MirWindowType type)
52 {52 {
53 mir::scene::SurfaceCreationParameters creation_parameters;53 mir::scene::SurfaceCreationParameters creation_parameters;
54 creation_parameters.type = type;54 creation_parameters.type = type;
@@ -72,11 +72,11 @@
7272
73TEST_P(ForNormalSurface, state)73TEST_P(ForNormalSurface, state)
74{74{
75 auto const original_state = mir_surface_state_restored;75 auto const original_state = mir_window_state_restored;
76 auto const new_state = MirSurfaceState(GetParam());76 auto const new_state = MirWindowState(GetParam());
77 auto const state_is_visible = (new_state != mir_surface_state_minimized) && (new_state != mir_surface_state_hidden);77 auto const state_is_visible = (new_state != mir_window_state_minimized) && (new_state != mir_window_state_hidden);
7878
79 create_window_of_type(mir_surface_type_normal);79 create_window_of_type(mir_window_type_normal);
80 auto const& info = window_manager_tools.info_for(window);80 auto const& info = window_manager_tools.info_for(window);
8181
82 WindowSpecification mods;82 WindowSpecification mods;
@@ -95,13 +95,13 @@
95}95}
9696
97INSTANTIATE_TEST_CASE_P(ModifyWindowState, ForNormalSurface, ::testing::Values(97INSTANTIATE_TEST_CASE_P(ModifyWindowState, ForNormalSurface, ::testing::Values(
98// mir_surface_state_unknown,98// mir_window_state_unknown,
99 mir_surface_state_restored,99 mir_window_state_restored,
100 mir_surface_state_minimized,100 mir_window_state_minimized,
101 mir_surface_state_maximized,101 mir_window_state_maximized,
102 mir_surface_state_vertmaximized,102 mir_window_state_vertmaximized,
103 mir_surface_state_fullscreen,103 mir_window_state_fullscreen,
104 mir_surface_state_horizmaximized,104 mir_window_state_horizmaximized,
105 mir_surface_state_hidden105 mir_window_state_hidden
106// mir_surface_states106// mir_window_states
107));107));
108108
=== modified file 'test/persistent_surface_store.cpp'
--- test/persistent_surface_store.cpp 2016-11-23 09:51:02 +0000
+++ test/persistent_surface_store.cpp 2017-01-26 16:46:42 +0000
@@ -17,8 +17,8 @@
17 */17 */
1818
19#include <miral/toolkit/persistent_id.h>19#include <miral/toolkit/persistent_id.h>
20#include <miral/toolkit/surface.h>20#include <miral/toolkit/window.h>
21#include <miral/toolkit/surface_spec.h>21#include <miral/toolkit/window_spec.h>
2222
23#include <miral/application_info.h>23#include <miral/application_info.h>
2424
@@ -49,10 +49,10 @@
49 using namespace miral::toolkit;49 using namespace miral::toolkit;
5050
51 auto const connection = connect_client(test_name);51 auto const connection = connect_client(test_name);
52 auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)52 auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
53 .set_name(test_name);53 .set_name(test_name);
5454
55 Surface const surface{spec.create_surface()};55 Window const surface{spec.create_surface()};
5656
57 miral::toolkit::PersistentId client_surface_id{surface};57 miral::toolkit::PersistentId client_surface_id{surface};
5858
@@ -71,10 +71,10 @@
71 using namespace miral::toolkit;71 using namespace miral::toolkit;
7272
73 auto const connection = connect_client(test_name);73 auto const connection = connect_client(test_name);
74 auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)74 auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
75 .set_name(test_name);75 .set_name(test_name);
7676
77 Surface const surface{spec.create_surface()};77 Window const surface{spec.create_surface()};
7878
79 miral::toolkit::PersistentId client_surface_id{surface};79 miral::toolkit::PersistentId client_surface_id{surface};
8080
@@ -93,10 +93,10 @@
93 using namespace miral::toolkit;93 using namespace miral::toolkit;
9494
95 auto const connection = connect_client(test_name);95 auto const connection = connect_client(test_name);
96 auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)96 auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
97 .set_name(test_name);97 .set_name(test_name);
9898
99 Surface const surface{spec.create_surface()};99 Window const surface{spec.create_surface()};
100100
101 miral::toolkit::PersistentId client_surface_id{surface};101 miral::toolkit::PersistentId client_surface_id{surface};
102102
@@ -112,10 +112,10 @@
112 using namespace miral::toolkit;112 using namespace miral::toolkit;
113113
114 auto const connection = connect_client(test_name);114 auto const connection = connect_client(test_name);
115 auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)115 auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
116 .set_name(test_name);116 .set_name(test_name);
117117
118 Surface const surface{spec.create_surface()};118 Window const surface{spec.create_surface()};
119119
120 miral::toolkit::PersistentId client_surface_id{surface};120 miral::toolkit::PersistentId client_surface_id{surface};
121121
@@ -133,10 +133,10 @@
133 using namespace miral::toolkit;133 using namespace miral::toolkit;
134134
135 auto const connection = connect_client(test_name);135 auto const connection = connect_client(test_name);
136 auto const spec = SurfaceSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)136 auto const spec = WindowSpec::for_normal_surface(connection, 50, 50, mir_pixel_format_argb_8888)
137 .set_name(test_name);137 .set_name(test_name);
138138
139 Surface const surface{spec.create_surface()};139 Window const surface{spec.create_surface()};
140140
141 miral::toolkit::PersistentId client_surface_id{surface};141 miral::toolkit::PersistentId client_surface_id{surface};
142142
143143
=== added file 'test/raise_tree.cpp'
--- test/raise_tree.cpp 1970-01-01 00:00:00 +0000
+++ test/raise_tree.cpp 2017-01-26 16:46:42 +0000
@@ -0,0 +1,95 @@
1/*
2 * Copyright © 2017 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#include "test_window_manager_tools.h"
20
21using namespace miral;
22using namespace testing;
23namespace mt = mir::test;
24
25namespace
26{
27X const display_left{0};
28Y const display_top{0};
29Width const display_width{640};
30Height const display_height{480};
31
32Rectangle const display_area{{display_left, display_top}, {display_width, display_height}};
33
34struct RaiseTree : TestWindowManagerTools
35{
36 Size const initial_parent_size{600, 400};
37 Size const initial_child_size{300, 300};
38 Rectangle const rectangle_away_from_rhs{{20, 20}, {20, 20}};
39 Rectangle const rectangle_near_rhs{{590, 20}, {10, 20}};
40 Rectangle const rectangle_away_from_bottom{{20, 20}, {20, 20}};
41 Rectangle const rectangle_near_bottom{{20, 380}, {20, 20}};
42 Rectangle const rectangle_near_both_sides{{0, 20}, {600, 20}};
43 Rectangle const rectangle_near_both_sides_and_bottom{{0, 380}, {600, 20}};
44 Rectangle const rectangle_near_all_sides{{0, 20}, {600, 380}};
45 Rectangle const rectangle_near_both_bottom_right{{400, 380}, {200, 20}};
46
47 Window parent;
48 Window child;
49 Window another_window;
50
51 WindowSpecification modification;
52
53 void SetUp() override
54 {
55 basic_window_manager.add_display(display_area);
56
57 mir::scene::SurfaceCreationParameters creation_parameters;
58 basic_window_manager.add_session(session);
59
60 EXPECT_CALL(*window_manager_policy, advise_new_window(_))
61 .WillOnce(Invoke([this](WindowInfo const& window_info){ parent = window_info.window(); }))
62 .WillOnce(Invoke([this](WindowInfo const& window_info){ child = window_info.window(); }))
63 .WillOnce(Invoke([this](WindowInfo const& window_info){ another_window = window_info.window(); }));
64
65 creation_parameters.size = initial_parent_size;
66 basic_window_manager.add_surface(session, creation_parameters, &create_surface);
67
68 creation_parameters.type = mir_window_type_menu;
69 creation_parameters.parent = parent;
70 creation_parameters.size = initial_child_size;
71 basic_window_manager.add_surface(session, creation_parameters, &create_surface);
72
73 creation_parameters.type = mir_window_type_normal;
74 creation_parameters.parent.reset();
75 creation_parameters.size = display_area.size;
76 basic_window_manager.add_surface(session, creation_parameters, &create_surface);
77
78 // Clear the expectations used to capture parent & child
79 Mock::VerifyAndClearExpectations(window_manager_policy);
80 }
81};
82}
83
84TEST_F(RaiseTree, when_parent_is_raised_child_is_raised)
85{
86 EXPECT_CALL(*window_manager_policy, advise_raise(ElementsAre(parent, child)));
87 basic_window_manager.raise_tree(parent);
88}
89
90TEST_F(RaiseTree, when_child_is_raised_parent_is_raised)
91{
92 EXPECT_CALL(*window_manager_policy, advise_raise(ElementsAre(parent, child)));
93 EXPECT_CALL(*window_manager_policy, advise_raise(ElementsAre(child)));
94 basic_window_manager.raise_tree(child);
95}
096
=== modified file 'test/select_active_window.cpp'
--- test/select_active_window.cpp 2016-10-10 14:53:39 +0000
+++ test/select_active_window.cpp 2017-01-26 16:46:42 +0000
@@ -82,13 +82,13 @@
82{82{
83 mir::scene::SurfaceCreationParameters creation_parameters;83 mir::scene::SurfaceCreationParameters creation_parameters;
84 creation_parameters.name = "parent";84 creation_parameters.name = "parent";
85 creation_parameters.type = mir_surface_type_normal;85 creation_parameters.type = mir_window_type_normal;
86 creation_parameters.size = Size{600, 400};86 creation_parameters.size = Size{600, 400};
8787
88 auto parent = create_window(creation_parameters);88 auto parent = create_window(creation_parameters);
8989
90 creation_parameters.name = "dialog";90 creation_parameters.name = "dialog";
91 creation_parameters.type = mir_surface_type_dialog;91 creation_parameters.type = mir_window_type_dialog;
92 creation_parameters.parent = parent;92 creation_parameters.parent = parent;
9393
94 auto dialog = create_window(creation_parameters);94 auto dialog = create_window(creation_parameters);
@@ -102,22 +102,22 @@
102{102{
103 mir::scene::SurfaceCreationParameters creation_parameters;103 mir::scene::SurfaceCreationParameters creation_parameters;
104 creation_parameters.name = "parent";104 creation_parameters.name = "parent";
105 creation_parameters.type = mir_surface_type_normal;105 creation_parameters.type = mir_window_type_normal;
106 creation_parameters.size = Size{600, 400};106 creation_parameters.size = Size{600, 400};
107107
108 auto parent = create_window(creation_parameters);108 auto parent = create_window(creation_parameters);
109109
110 creation_parameters.name = "dialog";110 creation_parameters.name = "dialog";
111 creation_parameters.type = mir_surface_type_dialog;111 creation_parameters.type = mir_window_type_dialog;
112 creation_parameters.parent = parent;112 creation_parameters.parent = parent;
113113
114 auto dialog = create_window(creation_parameters);114 auto dialog = create_window(creation_parameters);
115115
116 WindowSpecification mods;116 WindowSpecification mods;
117 mods.state() = mir_surface_state_hidden;117 mods.state() = mir_window_state_hidden;
118 basic_window_manager.modify_window(basic_window_manager.info_for(dialog), mods);118 basic_window_manager.modify_window(basic_window_manager.info_for(dialog), mods);
119119
120 auto actual = basic_window_manager.select_active_window(parent);120 auto actual = basic_window_manager.select_active_window(parent);
121 EXPECT_THAT(actual, Eq(parent))121 EXPECT_THAT(actual, Eq(parent))
122 << "actual=" << actual << ", expected=" << parent;122 << "actual=" << actual << ", expected=" << parent;
123}
124\ No newline at end of file123\ No newline at end of file
124}
125125
=== modified file 'test/test_window_manager_tools.h'
--- test/test_window_manager_tools.h 2016-10-10 14:53:39 +0000
+++ test/test_window_manager_tools.h 2017-01-26 16:46:42 +0000
@@ -74,11 +74,11 @@
7474
75struct StubSurface : mir::test::doubles::StubSurface75struct StubSurface : mir::test::doubles::StubSurface
76{76{
77 StubSurface(std::string name, MirSurfaceType type, mir::geometry::Point top_left, mir::geometry::Size size) :77 StubSurface(std::string name, MirWindowType type, mir::geometry::Point top_left, mir::geometry::Size size) :
78 name_{name}, type_{type}, top_left_{top_left}, size_{size} {}78 name_{name}, type_{type}, top_left_{top_left}, size_{size} {}
7979
80 std::string name() const override { return name_; };80 std::string name() const override { return name_; };
81 MirSurfaceType type() const { return type_; }81 MirWindowType type() const override { return type_; }
8282
83 mir::geometry::Point top_left() const override { return top_left_; }83 mir::geometry::Point top_left() const override { return top_left_; }
84 void move_to(mir::geometry::Point const& top_left) override { top_left_ = top_left; }84 void move_to(mir::geometry::Point const& top_left) override { top_left_ = top_left; }
@@ -86,25 +86,25 @@
86 mir::geometry::Size size() const override { return size_; }86 mir::geometry::Size size() const override { return size_; }
87 void resize(mir::geometry::Size const& size) override { size_ = size; }87 void resize(mir::geometry::Size const& size) override { size_ = size; }
8888
89 auto state() const -> MirSurfaceState override { return state_; }89 auto state() const -> MirWindowState override { return state_; }
90 auto configure(MirSurfaceAttrib attrib, int value) -> int override {90 auto configure(MirWindowAttrib attrib, int value) -> int override {
91 switch (attrib)91 switch (attrib)
92 {92 {
93 case mir_surface_attrib_state:93 case mir_window_attrib_state:
94 state_ = MirSurfaceState(value);94 state_ = MirWindowState(value);
95 return state_;95 return state_;
96 default:96 default:
97 return value;97 return value;
98 }98 }
99 }99 }
100100
101 bool visible() const override { return state() != mir_surface_state_hidden; }101 bool visible() const override { return state() != mir_window_state_hidden; }
102102
103 std::string name_;103 std::string name_;
104 MirSurfaceType type_;104 MirWindowType type_;
105 mir::geometry::Point top_left_;105 mir::geometry::Point top_left_;
106 mir::geometry::Size size_;106 mir::geometry::Size size_;
107 MirSurfaceState state_ = mir_surface_state_restored;107 MirWindowState state_ = mir_window_state_restored;
108};108};
109109
110struct StubStubSession : mir::test::doubles::StubSession110struct StubStubSession : mir::test::doubles::StubSession
@@ -133,13 +133,14 @@
133{133{
134 using miral::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy;134 using miral::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy;
135135
136 bool handle_touch_event(MirTouchEvent const* /*event*/) override { return false; }136 bool handle_touch_event(MirTouchEvent const* /*event*/) { return false; }
137 bool handle_pointer_event(MirPointerEvent const* /*event*/) override { return false; }137 bool handle_pointer_event(MirPointerEvent const* /*event*/) { return false; }
138 bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) override { return false; }138 bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) { return false; }
139139
140 MOCK_METHOD1(advise_new_window, void (miral::WindowInfo const& window_info));140 MOCK_METHOD1(advise_new_window, void (miral::WindowInfo const& window_info));
141 MOCK_METHOD2(advise_move_to, void(miral::WindowInfo const& window_info, mir::geometry::Point top_left));141 MOCK_METHOD2(advise_move_to, void(miral::WindowInfo const& window_info, mir::geometry::Point top_left));
142 MOCK_METHOD2(advise_resize, void(miral::WindowInfo const& window_info, mir::geometry::Size const& new_size));142 MOCK_METHOD2(advise_resize, void(miral::WindowInfo const& window_info, mir::geometry::Size const& new_size));
143 MOCK_METHOD1(advise_raise, void(std::vector<miral::Window> const&));
143};144};
144145
145struct TestWindowManagerTools : testing::Test146struct TestWindowManagerTools : testing::Test
@@ -158,7 +159,7 @@
158 mir::test::fake_shared(persistent_surface_store),159 mir::tes