Merge lp:~alan-griffiths/miral/1.3 into lp:miral/release
- 1.3
- Merge into release
Status: | Merged |
---|---|
Approved by: | Alan Griffiths |
Approved revision: | no longer in the source branch. |
Merged at revision: | 359 |
Proposed branch: | lp:~alan-griffiths/miral/1.3 |
Merge into: | lp:miral/release |
Diff against target: |
453 lines (+124/-28) 17 files modified
CMakeLists.txt (+1/-1) debian/changelog (+19/-0) include/miral/set_window_management_policy.h (+3/-3) miral-kiosk/kiosk_main.cpp (+1/-1) miral-shell/decoration_provider.cpp (+12/-1) miral-shell/miral-app.sh (+2/-4) miral-shell/miral-desktop.sh (+1/-1) miral-shell/miral-run.sh (+1/-1) miral-shell/miral-xrun.sh (+21/-1) miral-shell/titlebar_window_manager.cpp (+4/-0) miral/CMakeLists.txt (+1/-1) miral/basic_window_manager.cpp (+10/-0) miral/basic_window_manager.h (+9/-1) miral/set_window_management_policy.cpp (+5/-5) test/test_server.cpp (+1/-1) test/test_window_manager_tools.h (+7/-0) test/workspaces.cpp (+26/-7) |
To merge this branch: | bzr merge lp:~alan-griffiths/miral/1.3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Review via email: mp+320973@code.launchpad.net |
Commit message
1.3.1 release
Description of the change
Alan Griffiths (alan-griffiths) : | # |
- 359. By CI Train Bot Account
-
* New upstream release 1.3.2 (https:/
/launchpad. net/miral/ +milestone/ 1.3.2)
- ABI summary:
. miral ABI unchanged at 2
- Enhancements:
. [miral-shell] Add a keyboard shortcut for forcing fullscreen
- Bugs fixed:
. [miral-examples] With latest zesty's libstdc++-6-dev miral-shell will
crash when trying to draw its background text. (LP: #1677550)
. [miral-examples] Update miral-xrun to match GDK changes (LP: #1675115)
. [miral-examples] change the server and client launch scripts to avoid
using the default Mir socket (LP: #1675794)
. [libmiral] Fix FTBFS against Mir < 0.26 (Xenial, Yakkety)
. [libmiral] correct spelling of miral/set_window_ management_ policy. h
. Update to fix FTBFS against lp:mir (and clang)
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2017-03-15 17:44:36 +0000 | |||
3 | +++ CMakeLists.txt 2017-03-30 14:15:54 +0000 | |||
4 | @@ -42,7 +42,7 @@ | |||
5 | 42 | 42 | ||
6 | 43 | set(MIRAL_VERSION_MAJOR 1) | 43 | set(MIRAL_VERSION_MAJOR 1) |
7 | 44 | set(MIRAL_VERSION_MINOR 3) | 44 | set(MIRAL_VERSION_MINOR 3) |
9 | 45 | set(MIRAL_VERSION_PATCH 1) | 45 | set(MIRAL_VERSION_PATCH 2) |
10 | 46 | 46 | ||
11 | 47 | set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH}) | 47 | set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH}) |
12 | 48 | 48 | ||
13 | 49 | 49 | ||
14 | === modified file 'debian/changelog' | |||
15 | --- debian/changelog 2017-03-16 18:17:41 +0000 | |||
16 | +++ debian/changelog 2017-03-30 14:15:54 +0000 | |||
17 | @@ -1,3 +1,22 @@ | |||
18 | 1 | miral (1.3.2) UNRELEASED; urgency=medium | ||
19 | 2 | |||
20 | 3 | * New upstream release 1.3.2 (https://launchpad.net/miral/+milestone/1.3.2) | ||
21 | 4 | - ABI summary: | ||
22 | 5 | . miral ABI unchanged at 2 | ||
23 | 6 | - Enhancements: | ||
24 | 7 | . [miral-shell] Add a keyboard shortcut for forcing fullscreen | ||
25 | 8 | - Bugs fixed: | ||
26 | 9 | . [miral-examples] With latest zesty's libstdc++-6-dev miral-shell will | ||
27 | 10 | crash when trying to draw its background text. (LP: #1677550) | ||
28 | 11 | . [miral-examples] Update miral-xrun to match GDK changes (LP: #1675115) | ||
29 | 12 | . [miral-examples] change the server and client launch scripts to avoid | ||
30 | 13 | using the default Mir socket (LP: #1675794) | ||
31 | 14 | . [libmiral] Fix FTBFS against Mir < 0.26 (Xenial, Yakkety) | ||
32 | 15 | . [libmiral] correct spelling of miral/set_window_management_policy.h | ||
33 | 16 | . Update to fix FTBFS against lp:mir (and clang) | ||
34 | 17 | |||
35 | 18 | -- Alan Griffiths <alan.griffiths@canonical.com> Mon, 24 Mar 2017 10:00:20 +0000 | ||
36 | 19 | |||
37 | 1 | miral (1.3.1+17.04.20170316.1-0ubuntu1) zesty; urgency=medium | 20 | miral (1.3.1+17.04.20170316.1-0ubuntu1) zesty; urgency=medium |
38 | 2 | 21 | ||
39 | 3 | * New upstream release 1.3.1 (https://launchpad.net/miral/+milestone/1.3.1) | 22 | * New upstream release 1.3.1 (https://launchpad.net/miral/+milestone/1.3.1) |
40 | 4 | 23 | ||
41 | === renamed file 'include/miral/set_window_managment_policy.h' => 'include/miral/set_window_management_policy.h' | |||
42 | --- include/miral/set_window_managment_policy.h 2017-03-06 10:50:19 +0000 | |||
43 | +++ include/miral/set_window_management_policy.h 2017-03-30 14:15:54 +0000 | |||
44 | @@ -16,8 +16,8 @@ | |||
45 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> |
46 | 17 | */ | 17 | */ |
47 | 18 | 18 | ||
50 | 19 | #ifndef MIRAL_SET_WINDOW_MANAGER_H | 19 | #ifndef MIRAL_SET_WINDOW_MANAGEMENT_POLICY_H |
51 | 20 | #define MIRAL_SET_WINDOW_MANAGER_H | 20 | #define MIRAL_SET_WINDOW_MANAGEMENT_POLICY_H |
52 | 21 | 21 | ||
53 | 22 | #include <memory> | 22 | #include <memory> |
54 | 23 | 23 | ||
55 | @@ -51,4 +51,4 @@ | |||
56 | 51 | } | 51 | } |
57 | 52 | } | 52 | } |
58 | 53 | 53 | ||
60 | 54 | #endif //MIRAL_SET_WINDOW_MANAGER_H | 54 | #endif //MIRAL_SET_WINDOW_MANAGEMENT_POLICY_H |
61 | 55 | 55 | ||
62 | === modified file 'miral-kiosk/kiosk_main.cpp' | |||
63 | --- miral-kiosk/kiosk_main.cpp 2017-03-06 10:50:19 +0000 | |||
64 | +++ miral-kiosk/kiosk_main.cpp 2017-03-30 14:15:54 +0000 | |||
65 | @@ -22,7 +22,7 @@ | |||
66 | 22 | #include <miral/application_authorizer.h> | 22 | #include <miral/application_authorizer.h> |
67 | 23 | #include <miral/command_line_option.h> | 23 | #include <miral/command_line_option.h> |
68 | 24 | #include <miral/keymap.h> | 24 | #include <miral/keymap.h> |
70 | 25 | #include <miral/set_window_managment_policy.h> | 25 | #include <miral/set_window_management_policy.h> |
71 | 26 | #include <miral/internal_client.h> | 26 | #include <miral/internal_client.h> |
72 | 27 | 27 | ||
73 | 28 | #include <unistd.h> | 28 | #include <unistd.h> |
74 | 29 | 29 | ||
75 | === modified file 'miral-shell/decoration_provider.cpp' | |||
76 | --- miral-shell/decoration_provider.cpp 2017-03-15 12:36:17 +0000 | |||
77 | +++ miral-shell/decoration_provider.cpp 2017-03-30 14:15:54 +0000 | |||
78 | @@ -42,6 +42,12 @@ | |||
79 | 42 | 42 | ||
80 | 43 | void null_window_callback(MirWindow*, void*) {} | 43 | void null_window_callback(MirWindow*, void*) {} |
81 | 44 | 44 | ||
82 | 45 | struct preferred_codecvt : std::codecvt_byname<wchar_t, char, std::mbstate_t> | ||
83 | 46 | { | ||
84 | 47 | preferred_codecvt() : std::codecvt_byname<wchar_t, char, std::mbstate_t>("") {} | ||
85 | 48 | ~preferred_codecvt() = default; | ||
86 | 49 | }; | ||
87 | 50 | |||
88 | 45 | struct Printer | 51 | struct Printer |
89 | 46 | { | 52 | { |
90 | 47 | Printer(); | 53 | Printer(); |
91 | @@ -53,7 +59,7 @@ | |||
92 | 53 | void printhelp(MirGraphicsRegion const& region); | 59 | void printhelp(MirGraphicsRegion const& region); |
93 | 54 | 60 | ||
94 | 55 | private: | 61 | private: |
96 | 56 | std::wstring_convert<std::codecvt_utf16<wchar_t>> converter; | 62 | std::wstring_convert<preferred_codecvt> converter; |
97 | 57 | 63 | ||
98 | 58 | bool working = false; | 64 | bool working = false; |
99 | 59 | FT_Library lib; | 65 | FT_Library lib; |
100 | @@ -112,6 +118,7 @@ | |||
101 | 112 | } | 118 | } |
102 | 113 | 119 | ||
103 | 114 | void Printer::print(MirGraphicsRegion const& region, std::string const& title_, int const intensity) | 120 | void Printer::print(MirGraphicsRegion const& region, std::string const& title_, int const intensity) |
104 | 121 | try | ||
105 | 115 | { | 122 | { |
106 | 116 | if (!working) | 123 | if (!working) |
107 | 117 | return; | 124 | return; |
108 | @@ -151,6 +158,10 @@ | |||
109 | 151 | base_y += glyph->advance.y >> 6; | 158 | base_y += glyph->advance.y >> 6; |
110 | 152 | } | 159 | } |
111 | 153 | } | 160 | } |
112 | 161 | catch (...) | ||
113 | 162 | { | ||
114 | 163 | std::cerr << "WARNING: failed render title: \"" << title_ << "\"\n"; | ||
115 | 164 | } | ||
116 | 154 | 165 | ||
117 | 155 | void Printer::printhelp(MirGraphicsRegion const& region) | 166 | void Printer::printhelp(MirGraphicsRegion const& region) |
118 | 156 | { | 167 | { |
119 | 157 | 168 | ||
120 | === modified file 'miral-shell/miral-app.sh' | |||
121 | --- miral-shell/miral-app.sh 2017-02-01 11:11:20 +0000 | |||
122 | +++ miral-shell/miral-app.sh 2017-03-30 14:15:54 +0000 | |||
123 | @@ -11,13 +11,11 @@ | |||
124 | 11 | then | 11 | then |
125 | 12 | echo "Error: Host endpoint '${MIR_SOCKET}' does not exists"; exit 1 | 12 | echo "Error: Host endpoint '${MIR_SOCKET}' does not exists"; exit 1 |
126 | 13 | fi | 13 | fi |
127 | 14 | i=0; while [ -e "${XDG_RUNTIME_DIR}/mir_socket${i}" ]; do let i+=1 ;done | ||
128 | 15 | socket=${XDG_RUNTIME_DIR}/mir_socket${i} | ||
129 | 16 | hostsocket='--host-socket ${MIR_SOCKET}' | 14 | hostsocket='--host-socket ${MIR_SOCKET}' |
130 | 17 | else | ||
131 | 18 | socket=${XDG_RUNTIME_DIR}/mir_socket | ||
132 | 19 | fi | 15 | fi |
133 | 20 | 16 | ||
134 | 17 | socket=${XDG_RUNTIME_DIR}/miral_socket | ||
135 | 18 | |||
136 | 21 | while [ $# -gt 0 ] | 19 | while [ $# -gt 0 ] |
137 | 22 | do | 20 | do |
138 | 23 | if [ "$1" == "--help" -o "$1" == "-h" ] | 21 | if [ "$1" == "--help" -o "$1" == "-h" ] |
139 | 24 | 22 | ||
140 | === modified file 'miral-shell/miral-desktop.sh' | |||
141 | --- miral-shell/miral-desktop.sh 2017-02-01 11:11:20 +0000 | |||
142 | +++ miral-shell/miral-desktop.sh 2017-03-30 14:15:54 +0000 | |||
143 | @@ -1,6 +1,6 @@ | |||
144 | 1 | #! /bin/bash | 1 | #! /bin/bash |
145 | 2 | 2 | ||
147 | 3 | socket=${XDG_RUNTIME_DIR}/mir_socket | 3 | socket=${XDG_RUNTIME_DIR}/miral_socket |
148 | 4 | miral_server=miral-shell | 4 | miral_server=miral-shell |
149 | 5 | launcher='gnome-terminal --app-id com.canonical.miral.Terminal' | 5 | launcher='gnome-terminal --app-id com.canonical.miral.Terminal' |
150 | 6 | bindir=$(dirname $0) | 6 | bindir=$(dirname $0) |
151 | 7 | 7 | ||
152 | === modified file 'miral-shell/miral-run.sh' | |||
153 | --- miral-shell/miral-run.sh 2016-10-06 15:36:15 +0000 | |||
154 | +++ miral-shell/miral-run.sh 2017-03-30 14:15:54 +0000 | |||
155 | @@ -3,4 +3,4 @@ | |||
156 | 3 | then extras='--app-id com.canonical.miral.Terminal' | 3 | then extras='--app-id com.canonical.miral.Terminal' |
157 | 4 | fi | 4 | fi |
158 | 5 | unset QT_QPA_PLATFORMTHEME | 5 | unset QT_QPA_PLATFORMTHEME |
160 | 6 | GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir "$@" ${extras}& | 6 | MIR_SOCKET=${XDG_RUNTIME_DIR}/miral_socket GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir "$@" ${extras}& |
161 | 7 | 7 | ||
162 | === modified file 'miral-shell/miral-xrun.sh' | |||
163 | --- miral-shell/miral-xrun.sh 2016-10-06 15:36:15 +0000 | |||
164 | +++ miral-shell/miral-xrun.sh 2017-03-30 14:15:54 +0000 | |||
165 | @@ -9,6 +9,26 @@ | |||
166 | 9 | unset GDK_BACKEND | 9 | unset GDK_BACKEND |
167 | 10 | unset QT_QPA_PLATFORM | 10 | unset QT_QPA_PLATFORM |
168 | 11 | unset SDL_VIDEODRIVER | 11 | unset SDL_VIDEODRIVER |
170 | 12 | Xmir -rootless :${port} & pid=$! | 12 | |
171 | 13 | while [ $# -gt 0 ] | ||
172 | 14 | do | ||
173 | 15 | if [ "$1" == "--help" -o "$1" == "-h" ] | ||
174 | 16 | then | ||
175 | 17 | echo "$(basename $0) - Handy launch script for providing an Xmir X11 server" | ||
176 | 18 | echo "Usage: $(basename $0) [options] command" | ||
177 | 19 | echo "Options are:" | ||
178 | 20 | echo " -force set toolkit environment variables to force X11 use" | ||
179 | 21 | exit 0 | ||
180 | 22 | elif [ "$1" == "-force" ]; | ||
181 | 23 | then | ||
182 | 24 | export GDK_BACKEND=x11 | ||
183 | 25 | export QT_QPA_PLATFORM=xcb | ||
184 | 26 | export SDL_VIDEODRIVER=x11 | ||
185 | 27 | else break | ||
186 | 28 | fi | ||
187 | 29 | shift | ||
188 | 30 | done | ||
189 | 31 | |||
190 | 32 | MIR_SOCKET=${XDG_RUNTIME_DIR}/miral_socket Xmir -rootless :${port} & pid=$! | ||
191 | 13 | DISPLAY=:${port} "$@" | 33 | DISPLAY=:${port} "$@" |
192 | 14 | kill ${pid} | 34 | kill ${pid} |
193 | 15 | 35 | ||
194 | === modified file 'miral-shell/titlebar_window_manager.cpp' | |||
195 | --- miral-shell/titlebar_window_manager.cpp 2017-03-02 17:40:20 +0000 | |||
196 | +++ miral-shell/titlebar_window_manager.cpp 2017-03-30 14:15:54 +0000 | |||
197 | @@ -413,6 +413,10 @@ | |||
198 | 413 | toggle(mir_window_state_horizmaximized); | 413 | toggle(mir_window_state_horizmaximized); |
199 | 414 | return true; | 414 | return true; |
200 | 415 | 415 | ||
201 | 416 | case mir_input_event_modifier_meta: | ||
202 | 417 | toggle(mir_window_state_fullscreen); | ||
203 | 418 | return true; | ||
204 | 419 | |||
205 | 416 | default: | 420 | default: |
206 | 417 | break; | 421 | break; |
207 | 418 | } | 422 | } |
208 | 419 | 423 | ||
209 | === modified file 'miral/CMakeLists.txt' | |||
210 | --- miral/CMakeLists.txt 2017-03-07 16:35:29 +0000 | |||
211 | +++ miral/CMakeLists.txt 2017-03-30 14:15:54 +0000 | |||
212 | @@ -49,7 +49,7 @@ | |||
213 | 49 | internal_client.cpp ${CMAKE_SOURCE_DIR}/include/miral/internal_client.h | 49 | internal_client.cpp ${CMAKE_SOURCE_DIR}/include/miral/internal_client.h |
214 | 50 | set_command_line_handler.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_command_line_handler.h | 50 | set_command_line_handler.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_command_line_handler.h |
215 | 51 | set_terminator.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_terminator.h | 51 | set_terminator.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_terminator.h |
217 | 52 | set_window_managment_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_managment_policy.h | 52 | set_window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_management_policy.h |
218 | 53 | workspace_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/workspace_policy.h | 53 | workspace_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/workspace_policy.h |
219 | 54 | window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h | 54 | window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h |
220 | 55 | window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h | 55 | window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h |
221 | 56 | 56 | ||
222 | === modified file 'miral/basic_window_manager.cpp' | |||
223 | --- miral/basic_window_manager.cpp 2017-03-16 17:00:18 +0000 | |||
224 | +++ miral/basic_window_manager.cpp 2017-03-30 14:15:54 +0000 | |||
225 | @@ -359,6 +359,16 @@ | |||
226 | 359 | policy->handle_raise_window(info_for(surface)); | 359 | policy->handle_raise_window(info_for(surface)); |
227 | 360 | } | 360 | } |
228 | 361 | 361 | ||
229 | 362 | #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 27, 0) | ||
230 | 363 | void miral::BasicWindowManager::handle_request_drag_and_drop( | ||
231 | 364 | std::shared_ptr<mir::scene::Session> const& /*session*/, | ||
232 | 365 | std::shared_ptr<mir::scene::Surface> const& /*surface*/, | ||
233 | 366 | uint64_t /*timestamp*/) | ||
234 | 367 | { | ||
235 | 368 | // TODO | ||
236 | 369 | } | ||
237 | 370 | #endif | ||
238 | 371 | |||
239 | 362 | int miral::BasicWindowManager::set_surface_attribute( | 372 | int miral::BasicWindowManager::set_surface_attribute( |
240 | 363 | std::shared_ptr<scene::Session> const& /*application*/, | 373 | std::shared_ptr<scene::Session> const& /*application*/, |
241 | 364 | std::shared_ptr<scene::Surface> const& surface, | 374 | std::shared_ptr<scene::Surface> const& surface, |
242 | 365 | 375 | ||
243 | === modified file 'miral/basic_window_manager.h' | |||
244 | --- miral/basic_window_manager.h 2017-03-02 14:29:04 +0000 | |||
245 | +++ miral/basic_window_manager.h 2017-03-30 14:15:54 +0000 | |||
246 | @@ -30,6 +30,7 @@ | |||
247 | 30 | #include <mir/geometry/rectangles.h> | 30 | #include <mir/geometry/rectangles.h> |
248 | 31 | #include <mir/shell/abstract_shell.h> | 31 | #include <mir/shell/abstract_shell.h> |
249 | 32 | #include <mir/shell/window_manager.h> | 32 | #include <mir/shell/window_manager.h> |
250 | 33 | #include <mir/version.h> | ||
251 | 33 | 34 | ||
252 | 34 | #include <boost/bimap.hpp> | 35 | #include <boost/bimap.hpp> |
253 | 35 | #include <boost/bimap/multiset_of.hpp> | 36 | #include <boost/bimap/multiset_of.hpp> |
254 | @@ -95,6 +96,13 @@ | |||
255 | 95 | std::shared_ptr<mir::scene::Surface> const& surface, | 96 | std::shared_ptr<mir::scene::Surface> const& surface, |
256 | 96 | uint64_t timestamp) override; | 97 | uint64_t timestamp) override; |
257 | 97 | 98 | ||
258 | 99 | #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 27, 0) | ||
259 | 100 | void handle_request_drag_and_drop( | ||
260 | 101 | std::shared_ptr<mir::scene::Session> const& session, | ||
261 | 102 | std::shared_ptr<mir::scene::Surface> const& surface, | ||
262 | 103 | uint64_t timestamp) override; | ||
263 | 104 | #endif | ||
264 | 105 | |||
265 | 98 | int set_surface_attribute( | 106 | int set_surface_attribute( |
266 | 99 | std::shared_ptr<mir::scene::Session> const& /*application*/, | 107 | std::shared_ptr<mir::scene::Session> const& /*application*/, |
267 | 100 | std::shared_ptr<mir::scene::Surface> const& surface, | 108 | std::shared_ptr<mir::scene::Surface> const& surface, |
268 | @@ -109,7 +117,7 @@ | |||
269 | 109 | 117 | ||
270 | 110 | void move_workspace_content_to_workspace( | 118 | void move_workspace_content_to_workspace( |
271 | 111 | std::shared_ptr<Workspace> const& to_workspace, | 119 | std::shared_ptr<Workspace> const& to_workspace, |
273 | 112 | std::shared_ptr<Workspace> const& from_workspace); | 120 | std::shared_ptr<Workspace> const& from_workspace) override; |
274 | 113 | 121 | ||
275 | 114 | void for_each_workspace_containing( | 122 | void for_each_workspace_containing( |
276 | 115 | Window const& window, | 123 | Window const& window, |
277 | 116 | 124 | ||
278 | === renamed file 'miral/set_window_managment_policy.cpp' => 'miral/set_window_management_policy.cpp' | |||
279 | --- miral/set_window_managment_policy.cpp 2017-03-06 10:48:02 +0000 | |||
280 | +++ miral/set_window_management_policy.cpp 2017-03-30 14:15:54 +0000 | |||
281 | @@ -16,7 +16,7 @@ | |||
282 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> |
283 | 17 | */ | 17 | */ |
284 | 18 | 18 | ||
286 | 19 | #include "miral/set_window_managment_policy.h" | 19 | #include "miral/set_window_management_policy.h" |
287 | 20 | #include "basic_window_manager.h" | 20 | #include "basic_window_manager.h" |
288 | 21 | #include "window_management_trace.h" | 21 | #include "window_management_trace.h" |
289 | 22 | #include "both_versions.h" | 22 | #include "both_versions.h" |
290 | @@ -32,19 +32,19 @@ | |||
291 | 32 | char const* const trace_option = "window-management-trace"; | 32 | char const* const trace_option = "window-management-trace"; |
292 | 33 | } | 33 | } |
293 | 34 | 34 | ||
295 | 35 | MIRAL_BOTH_VERSIONS( | 35 | MIRAL_FAKE_OLD_SYMBOL( |
296 | 36 | _ZN5miral24SetWindowManagmentPolicyC1ERKSt8functionIFSt10unique_ptrINS_22WindowManagementPolicyESt14default_deleteIS3_EERKNS_18WindowManagerToolsEEE, | 36 | _ZN5miral24SetWindowManagmentPolicyC1ERKSt8functionIFSt10unique_ptrINS_22WindowManagementPolicyESt14default_deleteIS3_EERKNS_18WindowManagerToolsEEE, |
297 | 37 | _ZN5miral25SetWindowManagementPolicyC1ERKSt8functionIFSt10unique_ptrINS_22WindowManagementPolicyESt14default_deleteIS3_EERKNS_18WindowManagerToolsEEE) | 37 | _ZN5miral25SetWindowManagementPolicyC1ERKSt8functionIFSt10unique_ptrINS_22WindowManagementPolicyESt14default_deleteIS3_EERKNS_18WindowManagerToolsEEE) |
298 | 38 | 38 | ||
300 | 39 | MIRAL_BOTH_VERSIONS( | 39 | MIRAL_FAKE_OLD_SYMBOL( |
301 | 40 | _ZNK5miral24SetWindowManagmentPolicyclERN3mir6ServerE, | 40 | _ZNK5miral24SetWindowManagmentPolicyclERN3mir6ServerE, |
302 | 41 | _ZNK5miral25SetWindowManagementPolicyclERN3mir6ServerE) | 41 | _ZNK5miral25SetWindowManagementPolicyclERN3mir6ServerE) |
303 | 42 | 42 | ||
305 | 43 | MIRAL_BOTH_VERSIONS( | 43 | MIRAL_FAKE_OLD_SYMBOL( |
306 | 44 | _ZN5miral24SetWindowManagmentPolicyD1Ev, | 44 | _ZN5miral24SetWindowManagmentPolicyD1Ev, |
307 | 45 | _ZN5miral25SetWindowManagementPolicyD1Ev) | 45 | _ZN5miral25SetWindowManagementPolicyD1Ev) |
308 | 46 | 46 | ||
310 | 47 | MIRAL_BOTH_VERSIONS( | 47 | MIRAL_FAKE_OLD_SYMBOL( |
311 | 48 | _ZN5miral24SetWindowManagmentPolicyD2Ev, | 48 | _ZN5miral24SetWindowManagmentPolicyD2Ev, |
312 | 49 | _ZN5miral25SetWindowManagementPolicyD2Ev) | 49 | _ZN5miral25SetWindowManagementPolicyD2Ev) |
313 | 50 | 50 | ||
314 | 51 | 51 | ||
315 | === modified file 'test/test_server.cpp' | |||
316 | --- test/test_server.cpp 2017-02-14 17:11:07 +0000 | |||
317 | +++ test/test_server.cpp 2017-03-30 14:15:54 +0000 | |||
318 | @@ -19,7 +19,7 @@ | |||
319 | 19 | #include "test_server.h" | 19 | #include "test_server.h" |
320 | 20 | #include "../miral/basic_window_manager.h" | 20 | #include "../miral/basic_window_manager.h" |
321 | 21 | 21 | ||
323 | 22 | #include <miral/set_window_managment_policy.h> | 22 | #include <miral/set_window_management_policy.h> |
324 | 23 | 23 | ||
325 | 24 | #include <mir_test_framework/executable_path.h> | 24 | #include <mir_test_framework/executable_path.h> |
326 | 25 | #include <mir_test_framework/stub_server_platform_factory.h> | 25 | #include <mir_test_framework/stub_server_platform_factory.h> |
327 | 26 | 26 | ||
328 | === modified file 'test/test_window_manager_tools.h' | |||
329 | --- test/test_window_manager_tools.h 2017-02-02 11:31:52 +0000 | |||
330 | +++ test/test_window_manager_tools.h 2017-03-30 14:15:54 +0000 | |||
331 | @@ -27,6 +27,7 @@ | |||
332 | 27 | #include <mir/shell/display_layout.h> | 27 | #include <mir/shell/display_layout.h> |
333 | 28 | #include <mir/shell/focus_controller.h> | 28 | #include <mir/shell/focus_controller.h> |
334 | 29 | #include <mir/shell/persistent_surface_store.h> | 29 | #include <mir/shell/persistent_surface_store.h> |
335 | 30 | #include <mir/version.h> | ||
336 | 30 | 31 | ||
337 | 31 | #include <mir/test/doubles/stub_session.h> | 32 | #include <mir/test/doubles/stub_session.h> |
338 | 32 | #include <mir/test/doubles/stub_surface.h> | 33 | #include <mir/test/doubles/stub_surface.h> |
339 | @@ -53,6 +54,12 @@ | |||
340 | 53 | 54 | ||
341 | 54 | virtual auto surface_at(mir::geometry::Point /*cursor*/) const -> std::shared_ptr<mir::scene::Surface> override | 55 | virtual auto surface_at(mir::geometry::Point /*cursor*/) const -> std::shared_ptr<mir::scene::Surface> override |
342 | 55 | { return {}; } | 56 | { return {}; } |
343 | 57 | |||
344 | 58 | #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 27, 0) | ||
345 | 59 | void set_drag_and_drop_handle(std::vector<uint8_t> const& /*handle*/) override {} | ||
346 | 60 | |||
347 | 61 | void clear_drag_and_drop_handle() override {} | ||
348 | 62 | #endif | ||
349 | 56 | }; | 63 | }; |
350 | 57 | 64 | ||
351 | 58 | struct StubDisplayLayout : mir::shell::DisplayLayout | 65 | struct StubDisplayLayout : mir::shell::DisplayLayout |
352 | 59 | 66 | ||
353 | === modified file 'test/workspaces.cpp' | |||
354 | --- test/workspaces.cpp 2017-03-03 12:31:47 +0000 | |||
355 | +++ test/workspaces.cpp 2017-03-30 14:15:54 +0000 | |||
356 | @@ -49,7 +49,8 @@ | |||
357 | 49 | WorkspacesWindowManagerPolicy(WindowManagerTools const& tools, Workspaces& test_fixture); | 49 | WorkspacesWindowManagerPolicy(WindowManagerTools const& tools, Workspaces& test_fixture); |
358 | 50 | ~WorkspacesWindowManagerPolicy(); | 50 | ~WorkspacesWindowManagerPolicy(); |
359 | 51 | 51 | ||
361 | 52 | void advise_new_window(miral::WindowInfo const& window_info) override; | 52 | void advise_new_window(miral::WindowInfo const& window_info); |
362 | 53 | void handle_window_ready(miral::WindowInfo& window_info); | ||
363 | 53 | 54 | ||
364 | 54 | MOCK_METHOD2(advise_adding_to_workspace, | 55 | MOCK_METHOD2(advise_adding_to_workspace, |
365 | 55 | void(std::shared_ptr<miral::Workspace> const&, std::vector<miral::Window> const&)); | 56 | void(std::shared_ptr<miral::Workspace> const&, std::vector<miral::Window> const&)); |
366 | @@ -59,6 +60,8 @@ | |||
367 | 59 | 60 | ||
368 | 60 | MOCK_METHOD1(advise_focus_gained, void(miral::WindowInfo const&)); | 61 | MOCK_METHOD1(advise_focus_gained, void(miral::WindowInfo const&)); |
369 | 61 | 62 | ||
370 | 63 | MOCK_METHOD1(advise_window_ready, void(miral::WindowInfo const&)); | ||
371 | 64 | |||
372 | 62 | Workspaces& test_fixture; | 65 | Workspaces& test_fixture; |
373 | 63 | }; | 66 | }; |
374 | 64 | 67 | ||
375 | @@ -72,9 +75,19 @@ | |||
376 | 72 | .create_window(); | 75 | .create_window(); |
377 | 73 | 76 | ||
378 | 74 | client_windows[name] = window; | 77 | client_windows[name] = window; |
379 | 78 | init_window(window); | ||
380 | 79 | |||
381 | 80 | return window; | ||
382 | 81 | } | ||
383 | 82 | |||
384 | 83 | void init_window(Window const& window) | ||
385 | 84 | { | ||
386 | 85 | mir::test::Signal window_ready; | ||
387 | 86 | EXPECT_CALL(policy(), advise_window_ready(_)).WillOnce(InvokeWithoutArgs([&]{ window_ready.raise(); })); | ||
388 | 87 | |||
389 | 75 | mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window)); | 88 | mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window)); |
390 | 76 | 89 | ||
392 | 77 | return window; | 90 | EXPECT_TRUE(window_ready.wait_for(1s)); |
393 | 78 | } | 91 | } |
394 | 79 | 92 | ||
395 | 80 | auto create_tip(std::string const& name, Window const& parent) -> Window | 93 | auto create_tip(std::string const& name, Window const& parent) -> Window |
396 | @@ -87,7 +100,7 @@ | |||
397 | 87 | .create_window(); | 100 | .create_window(); |
398 | 88 | 101 | ||
399 | 89 | client_windows[name] = window; | 102 | client_windows[name] = window; |
401 | 90 | mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window)); | 103 | init_window(window); |
402 | 91 | 104 | ||
403 | 92 | return window; | 105 | return window; |
404 | 93 | } | 106 | } |
405 | @@ -100,7 +113,7 @@ | |||
406 | 100 | .create_window(); | 113 | .create_window(); |
407 | 101 | 114 | ||
408 | 102 | client_windows[name] = window; | 115 | client_windows[name] = window; |
410 | 103 | mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window)); | 116 | init_window(window); |
411 | 104 | 117 | ||
412 | 105 | return window; | 118 | return window; |
413 | 106 | } | 119 | } |
414 | @@ -221,6 +234,12 @@ | |||
415 | 221 | std::lock_guard<decltype(test_fixture.mutex)> lock{test_fixture.mutex}; | 234 | std::lock_guard<decltype(test_fixture.mutex)> lock{test_fixture.mutex}; |
416 | 222 | test_fixture.server_windows[window_info.name()] = window_info.window(); | 235 | test_fixture.server_windows[window_info.name()] = window_info.window(); |
417 | 223 | } | 236 | } |
418 | 237 | |||
419 | 238 | void WorkspacesWindowManagerPolicy::handle_window_ready(miral::WindowInfo& window_info) | ||
420 | 239 | { | ||
421 | 240 | miral::CanonicalWindowManagerPolicy::handle_window_ready(window_info); | ||
422 | 241 | advise_window_ready(window_info); | ||
423 | 242 | } | ||
424 | 224 | } | 243 | } |
425 | 225 | 244 | ||
426 | 226 | TEST_F(Workspaces, before_a_tree_is_added_to_workspace_it_is_empty) | 245 | TEST_F(Workspaces, before_a_tree_is_added_to_workspace_it_is_empty) |
427 | @@ -452,7 +471,7 @@ | |||
428 | 452 | .set_name(a_window.c_str()) | 471 | .set_name(a_window.c_str()) |
429 | 453 | .create_window(); | 472 | .create_window(); |
430 | 454 | 473 | ||
432 | 455 | mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window)); | 474 | init_window(window); |
433 | 456 | 475 | ||
434 | 457 | invoke_tools([&, this](WindowManagerTools& tools) | 476 | invoke_tools([&, this](WindowManagerTools& tools) |
435 | 458 | { | 477 | { |
436 | @@ -513,7 +532,7 @@ | |||
437 | 513 | .set_name(a_window.c_str()) | 532 | .set_name(a_window.c_str()) |
438 | 514 | .create_window(); | 533 | .create_window(); |
439 | 515 | 534 | ||
441 | 516 | mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window)); | 535 | init_window(window); |
442 | 517 | 536 | ||
443 | 518 | invoke_tools([&, this](WindowManagerTools& tools) | 537 | invoke_tools([&, this](WindowManagerTools& tools) |
444 | 519 | { | 538 | { |
445 | @@ -576,7 +595,7 @@ | |||
446 | 576 | .set_name(a_window.c_str()) | 595 | .set_name(a_window.c_str()) |
447 | 577 | .create_window(); | 596 | .create_window(); |
448 | 578 | 597 | ||
450 | 579 | mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window)); | 598 | init_window(window); |
451 | 580 | 599 | ||
452 | 581 | invoke_tools([&, this](WindowManagerTools& tools) | 600 | invoke_tools([&, this](WindowManagerTools& tools) |
453 | 582 | { | 601 | { |
Seen this twice in bileto:
[ RUN ] Workspaces. with_two_ applications_ when_a_ window_ in_a_workspace_ hides_focus_ remains_ in_workspace >/miral- 1.3.2+16. 04.20170330/ test/workspaces .cpp:534: Failure window( ) window( ): a window window( dialog) : dialog
[2017-03-30 07:31:06.592649] mirserver: Starting
[2017-03-30 07:31:06.592873] mirserver: Selected driver: mir:stub-graphics (version 0.26.2)
[2017-03-30 07:31:06.593742] mirserver: Using software cursor
[2017-03-30 07:31:06.624258] mirserver: Selected input driver: mir:stub-input (version: 0.26.2)
[2017-03-30 07:31:06.634376] mirserver: Mir version 0.26.2
[2017-03-30 07:31:06.638238] mirserver: Initial display configuration:
[2017-03-30 07:31:06.651197] mirserver: Output 1: VGA connected, used
[2017-03-30 07:31:06.651288] mirserver: Physical size 0.0" 0x0mm
[2017-03-30 07:31:06.651306] mirserver: Power is on
[2017-03-30 07:31:06.651328] mirserver: Current mode 1600x1600 60.00Hz
[2017-03-30 07:31:06.651346] mirserver: Preferred mode 1600x1600 60.00Hz
[2017-03-30 07:31:06.651362] mirserver: Orientation normal
[2017-03-30 07:31:06.651379] mirserver: Logical size 1600x1600
[2017-03-30 07:31:06.651394] mirserver: Logical position +0+0
/<<BUILDDIR>
Value of: tools.active_
Expected: is equal to 1
Actual: 1 (of type miral::Window)
tools.active_
server_
GMOCK WARNING: focus_gained( @0x7f80003200 8-byte object <80-4A 00-80 7F-00 00-00>)
Uninteresting mock function call - returning directly.
Function call: advise_
Stack trace:
GMOCK WARNING: removing_ from_workspace( @0x7f8000ac30 16-byte object <50-6A 9F-0D 00-00 00-00 40-6A 9F-0D 00-00 00-00>, @0x7f977fd800 { 1 })
Uninteresting mock function call - returning directly.
Function call: advise_
Stack trace:
GMOCK WARNING: focus_gained( @0x7f80007940 8-byte object <50-8A 00-80 7F-00 00-00>) with_two_ applications_ when_a_ window_ in_a_workspace_ hides_focus_ remains_ in_workspace (344 ms)
Uninteresting mock function call - returning directly.
Function call: advise_
Stack trace:
[2017-03-30 07:31:06.925379] mirserver: Stopping
[ FAILED ] Workspaces.