Mir

Merge lp:~alan-griffiths/mir/server-support-for-client-initiates-move into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 4143
Proposed branch: lp:~alan-griffiths/mir/server-support-for-client-initiates-move
Merge into: lp:mir
Diff against target: 1792 lines (+444/-630)
34 files modified
examples/CMakeLists.txt (+0/-2)
examples/server_example_basic_window_manager.cpp (+8/-0)
examples/server_example_basic_window_manager.h (+8/-1)
examples/server_example_window_management_info.cpp (+0/-373)
examples/server_example_window_management_info.h (+0/-105)
include/server/mir/shell/abstract_shell.h (+5/-0)
include/server/mir/shell/basic_window_manager.h (+14/-2)
include/server/mir/shell/canonical_window_manager.h (+5/-1)
include/server/mir/shell/shell.h (+5/-0)
include/server/mir/shell/shell_wrapper.h (+5/-0)
include/server/mir/shell/system_compositor_window_manager.h (+5/-0)
include/server/mir/shell/window_management_info.h (+3/-3)
include/server/mir/shell/window_manager.h (+5/-0)
include/test/mir/test/doubles/mock_window_manager.h (+1/-0)
src/include/server/mir/frontend/shell.h (+9/-7)
src/server/CMakeLists.txt (+1/-0)
src/server/frontend/CMakeLists.txt (+1/-0)
src/server/frontend/session_mediator.cpp (+15/-2)
src/server/frontend/shell_wrapper.cpp (+4/-14)
src/server/frontend/shell_wrapper.h (+5/-9)
src/server/shell/CMakeLists.txt (+3/-3)
src/server/shell/abstract_shell.cpp (+8/-0)
src/server/shell/basic_window_manager.cpp (+32/-6)
src/server/shell/frontend_shell.cpp (+30/-18)
src/server/shell/frontend_shell.h (+5/-9)
src/server/shell/shell_wrapper.cpp (+8/-0)
src/server/shell/system_compositor_window_manager.cpp (+7/-0)
src/server/shell/window_management_info.cpp (+72/-0)
src/server/symbols.map (+144/-63)
tests/acceptance-tests/CMakeLists.txt (+0/-8)
tests/acceptance-tests/client_mediated_user_gestures.cpp (+28/-2)
tests/acceptance-tests/test_client_cursor_api.cpp (+3/-0)
tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp (+3/-0)
tests/include/mir/test/doubles/mock_shell.h (+2/-2)
To merge this branch: bzr merge lp:~alan-griffiths/mir/server-support-for-client-initiates-move
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Kevin DuBois (community) Approve
Review via email: mp+321470@code.launchpad.net

Commit message

Server support for mir_window_request_user_move()

Description of the change

Server support for mir_window_request_user_move()

To test this I had to make some classes public (msh::BasicWindowManager et alias) these are largely duplicated in examples and are simply replaced in libmiral.

So these classes are both published and deprecated. Cleanup to follow, hopefully soon.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4133
https://mir-jenkins.ubuntu.com/job/mir-ci/3284/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4433/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4525
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4515
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4515
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4515
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4465/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4465
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4465/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4465
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4465/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4465
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4465/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4465
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4465/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4465
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4465/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3284/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4135
https://mir-jenkins.ubuntu.com/job/mir-ci/3289/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4441/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4537
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4527
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4527
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4527
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4473/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4473
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4473/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4473
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4473/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4473
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4473/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4473
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4473/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4473
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4473/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3289/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4136
https://mir-jenkins.ubuntu.com/job/mir-ci/3290/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4442
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4539
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4529
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4529
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4529
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4474
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4474/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4474
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4474/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4474
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4474/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4474
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4474/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4474
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4474/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4474
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4474/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3290/rebuild

review: Approve (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4137
https://mir-jenkins.ubuntu.com/job/mir-ci/3292/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4448
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4562
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4552
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4552
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4552
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4552
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4480
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4480/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4480
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4480/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4480
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4480/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4480
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4480/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4480
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4480/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4480
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4480/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3292/rebuild

review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

'StreamPainter' isn't a useful interface anymore, can probably be removed.

should this be comment out?
963 +// policy->handle_request_move(session, surface);

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

> 'StreamPainter' isn't a useful interface anymore, can probably be removed.

Reworking the code to remove it is beyond the scope of *this* MP.

In fact, I think it pointless as this code is superseded by miral, we just haven't quite reached the point where we can integrate that work.

> should this be comment out?
> 963 +// policy->handle_request_move(session, surface);

Replaced with an English version.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4139
https://mir-jenkins.ubuntu.com/job/mir-ci/3294/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4456/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4570
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4560
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4560
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4560
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4560
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4488
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4488/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4488
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4488/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4488
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4488/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4488/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4488/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4488
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4488/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4488
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4488/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3294/rebuild

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

^ Seems like a CI glitch...

10:48:46 error: device offline
10:48:46 error: device offline
10:48:46 error: device offline

Revision history for this message
Kevin DuBois (kdub) wrote :

alright then, lgtm

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4139
https://mir-jenkins.ubuntu.com/job/mir-ci/3301/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4463
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4578
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4568
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4568
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4568
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4568
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4495
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4495/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4495
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4495/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4495
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4495/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4495
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4495/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4495
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4495/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4495
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4495/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3301/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/CMakeLists.txt'
--- examples/CMakeLists.txt 2017-02-15 07:38:33 +0000
+++ examples/CMakeLists.txt 2017-04-04 10:15:32 +0000
@@ -28,8 +28,6 @@
28 server_example_input_filter.cpp28 server_example_input_filter.cpp
29 server_example_host_lifecycle_event.cpp29 server_example_host_lifecycle_event.cpp
30 server_example_window_management.cpp30 server_example_window_management.cpp
31 server_example_window_management_info.cpp
32 server_example_window_management_info.h
33 server_example_custom_compositor.cpp31 server_example_custom_compositor.cpp
34 server_example_adorning_compositor.cpp32 server_example_adorning_compositor.cpp
35 server_example_cursor_images.cpp33 server_example_cursor_images.cpp
3634
=== modified file 'examples/server_example_basic_window_manager.cpp'
--- examples/server_example_basic_window_manager.cpp 2017-03-08 16:16:44 +0000
+++ examples/server_example_basic_window_manager.cpp 2017-04-04 10:15:32 +0000
@@ -144,6 +144,14 @@
144 // Not supported in example servers144 // Not supported in example servers
145}145}
146146
147void me::BasicWindowManager::handle_request_move(
148 std::shared_ptr<scene::Session> const& /*session*/,
149 std::shared_ptr<scene::Surface> const& /*surface*/,
150 uint64_t /*timestamp*/)
151{
152 // Not supported in example servers
153}
154
147int me::BasicWindowManager::set_surface_attribute(155int me::BasicWindowManager::set_surface_attribute(
148 std::shared_ptr<scene::Session> const& /*session*/,156 std::shared_ptr<scene::Session> const& /*session*/,
149 std::shared_ptr<scene::Surface> const& surface,157 std::shared_ptr<scene::Surface> const& surface,
150158
=== modified file 'examples/server_example_basic_window_manager.h'
--- examples/server_example_basic_window_manager.h 2017-03-08 12:59:36 +0000
+++ examples/server_example_basic_window_manager.h 2017-04-04 10:15:32 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_EXAMPLE_BASIC_WINDOW_MANAGER_H_19#ifndef MIR_EXAMPLE_BASIC_WINDOW_MANAGER_H_
20#define MIR_EXAMPLE_BASIC_WINDOW_MANAGER_H_20#define MIR_EXAMPLE_BASIC_WINDOW_MANAGER_H_
2121
22#include "server_example_window_management_info.h"22#include "mir/shell/window_management_info.h"
2323
24#include "mir/geometry/rectangles.h"24#include "mir/geometry/rectangles.h"
25#include "mir/shell/abstract_shell.h"25#include "mir/shell/abstract_shell.h"
@@ -36,6 +36,8 @@
36namespace examples36namespace examples
37{37{
38using shell::SurfaceSet;38using shell::SurfaceSet;
39using shell::SurfaceInfo;
40using shell::SessionInfo;
3941
40/// The interface through which the policy instructs the controller.42/// The interface through which the policy instructs the controller.
41/// These functions assume that the BasicWindowManager data structures can be accessed freely.43/// These functions assume that the BasicWindowManager data structures can be accessed freely.
@@ -179,6 +181,11 @@
179 std::shared_ptr<scene::Surface> const& surface,181 std::shared_ptr<scene::Surface> const& surface,
180 uint64_t timestamp) override;182 uint64_t timestamp) override;
181183
184 void handle_request_move(
185 std::shared_ptr<scene::Session> const& session,
186 std::shared_ptr<scene::Surface> const& surface,
187 uint64_t timestamp) override;
188
182 int set_surface_attribute(189 int set_surface_attribute(
183 std::shared_ptr<scene::Session> const& /*session*/,190 std::shared_ptr<scene::Session> const& /*session*/,
184 std::shared_ptr<scene::Surface> const& surface,191 std::shared_ptr<scene::Surface> const& surface,
185192
=== removed file 'examples/server_example_window_management_info.cpp'
--- examples/server_example_window_management_info.cpp 2017-01-30 08:13:20 +0000
+++ examples/server_example_window_management_info.cpp 1970-01-01 00:00:00 +0000
@@ -1,373 +0,0 @@
1/*
2 * Copyright © 2015 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 "server_example_window_management_info.h"
20
21#include "mir/scene/surface.h"
22#include "mir/scene/surface_creation_parameters.h"
23#include "mir/scene/session.h"
24
25#include "mir/graphics/buffer.h"
26#include "mir/renderer/sw/pixel_source.h"
27
28#include <atomic>
29
30namespace me = mir::examples;
31namespace ms = mir::scene;
32namespace mg = mir::graphics;
33namespace mrs = mir::renderer::software;
34using namespace mir::geometry;
35
36me::SurfaceInfo::SurfaceInfo(
37 std::shared_ptr<scene::Session> const& session,
38 std::shared_ptr<scene::Surface> const& surface,
39 scene::SurfaceCreationParameters const& params) :
40 type{surface->type()},
41 state{surface->state()},
42 restore_rect{surface->top_left(), surface->size()},
43 session{session},
44 parent{params.parent},
45 min_width{params.min_width.is_set() ? params.min_width.value() : Width{}},
46 min_height{params.min_height.is_set() ? params.min_height.value() : Height{}},
47 max_width{params.max_width.is_set() ? params.max_width.value() : Width{std::numeric_limits<int>::max()}},
48 max_height{params.max_height.is_set() ? params.max_height.value() : Height{std::numeric_limits<int>::max()}},
49 width_inc{params.width_inc},
50 height_inc{params.height_inc},
51 min_aspect{params.min_aspect},
52 max_aspect{params.max_aspect}
53{
54 if (params.output_id != mir::graphics::DisplayConfigurationOutputId{0})
55 output_id = params.output_id;
56}
57
58bool me::SurfaceInfo::can_be_active() const
59{
60 switch (type)
61 {
62 case mir_window_type_normal: /**< AKA "regular" */
63 case mir_window_type_utility: /**< AKA "floating" */
64 case mir_window_type_dialog:
65 case mir_window_type_satellite: /**< AKA "toolbox"/"toolbar" */
66 case mir_window_type_freestyle:
67 case mir_window_type_menu:
68 case mir_window_type_inputmethod: /**< AKA "OSK" or handwriting etc. */
69 return true;
70
71 case mir_window_type_gloss:
72 case mir_window_type_tip: /**< AKA "tooltip" */
73 default:
74 // Cannot have input focus
75 return false;
76 }
77}
78
79bool me::SurfaceInfo::must_have_parent() const
80{
81 switch (type)
82 {
83 case mir_window_type_gloss:;
84 case mir_window_type_inputmethod:
85 case mir_window_type_satellite:
86 case mir_window_type_tip:
87 return true;
88
89 default:
90 return false;
91 }
92}
93
94bool me::SurfaceInfo::can_morph_to(MirWindowType new_type) const
95{
96 switch (new_type)
97 {
98 case mir_window_type_normal:
99 case mir_window_type_utility:
100 case mir_window_type_satellite:
101 switch (type)
102 {
103 case mir_window_type_normal:
104 case mir_window_type_utility:
105 case mir_window_type_dialog:
106 case mir_window_type_satellite:
107 return true;
108
109 default:
110 break;
111 }
112 break;
113
114 case mir_window_type_dialog:
115 switch (type)
116 {
117 case mir_window_type_normal:
118 case mir_window_type_utility:
119 case mir_window_type_dialog:
120 case mir_window_type_menu:
121 case mir_window_type_satellite:
122 return true;
123
124 default:
125 break;
126 }
127 break;
128
129 default:
130 break;
131 }
132
133 return false;
134}
135
136bool me::SurfaceInfo::must_not_have_parent() const
137{
138 switch (type)
139 {
140 case mir_window_type_normal:
141 case mir_window_type_utility:
142 return true;
143
144 default:
145 return false;
146 }
147}
148
149bool me::SurfaceInfo::is_visible() const
150{
151 switch (state)
152 {
153 case mir_window_state_hidden:
154 case mir_window_state_minimized:
155 return false;
156 default:
157 break;
158 }
159 return true;
160}
161
162struct mir::examples::SurfaceInfo::StreamPainter
163{
164 virtual void paint(int) = 0;
165 virtual ~StreamPainter() = default;
166 StreamPainter() = default;
167 StreamPainter(StreamPainter const&) = delete;
168 StreamPainter& operator=(StreamPainter const&) = delete;
169};
170
171struct mir::examples::SurfaceInfo::AllocatingPainter
172 : mir::examples::SurfaceInfo::StreamPainter
173{
174 AllocatingPainter(
175 std::shared_ptr<frontend::BufferStream> const& buffer_stream,
176 std::shared_ptr<scene::Session> const& session,
177 Size size) :
178 buffer_stream(buffer_stream),
179 session(session),
180 properties({
181 size,
182 buffer_stream->pixel_format(),
183 mg::BufferUsage::software
184 }),
185 front_buffer(session->create_buffer(properties)),
186 back_buffer(session->create_buffer(properties))
187 {
188 }
189
190 void paint(int intensity) override
191 {
192 auto buffer = session->get_buffer(back_buffer);
193
194 auto const format = buffer->pixel_format();
195 auto const sz = buffer->size().height.as_int() *
196 buffer->size().width.as_int() * MIR_BYTES_PER_PIXEL(format);
197 std::vector<unsigned char> pixels(sz, intensity);
198 if (auto pixel_source = dynamic_cast<mrs::PixelSource*>(buffer->native_buffer_base()))
199 pixel_source->write(pixels.data(), sz);
200 buffer_stream->submit_buffer(buffer);
201
202 std::swap(front_buffer, back_buffer);
203 }
204
205 ~AllocatingPainter()
206 {
207 session->destroy_buffer(front_buffer);
208 session->destroy_buffer(back_buffer);
209 }
210
211 std::shared_ptr<frontend::BufferStream> const buffer_stream;
212 std::shared_ptr<scene::Session> const session;
213 mg::BufferProperties properties;
214 mg::BufferID front_buffer;
215 mg::BufferID back_buffer;
216};
217
218void mir::examples::SurfaceInfo::init_titlebar(
219 std::shared_ptr<scene::Session> const& session,
220 std::shared_ptr<scene::Surface> const& surface)
221{
222 auto stream = surface->primary_buffer_stream();
223 stream_painter = std::make_shared<AllocatingPainter>(stream, session, surface->size());
224}
225
226void mir::examples::SurfaceInfo::paint_titlebar(int intensity)
227{
228 stream_painter->paint(intensity);
229}
230
231void me::SurfaceInfo::constrain_resize(
232 std::shared_ptr<ms::Surface> const& surface,
233 Point& requested_pos,
234 Size& requested_size,
235 bool const left_resize,
236 bool const top_resize,
237 Rectangle const& /*bounds*/) const
238{
239 Point new_pos = requested_pos;
240 Size new_size = requested_size;
241
242 if (min_aspect.is_set())
243 {
244 auto const ar = min_aspect.value();
245
246 auto const error = new_size.height.as_int()*long(ar.width) - new_size.width.as_int()*long(ar.height);
247
248 if (error > 0)
249 {
250 // Add (denominator-1) to numerator to ensure rounding up
251 auto const width_correction = (error+(ar.height-1))/ar.height;
252 auto const height_correction = (error+(ar.width-1))/ar.width;
253
254 if (width_correction < height_correction)
255 {
256 new_size.width = new_size.width + DeltaX(width_correction);
257 }
258 else
259 {
260 new_size.height = new_size.height - DeltaY(height_correction);
261 }
262 }
263 }
264
265 if (max_aspect.is_set())
266 {
267 auto const ar = max_aspect.value();
268
269 auto const error = new_size.width.as_int()*long(ar.height) - new_size.height.as_int()*long(ar.width);
270
271 if (error > 0)
272 {
273 // Add (denominator-1) to numerator to ensure rounding up
274 auto const height_correction = (error+(ar.width-1))/ar.width;
275 auto const width_correction = (error+(ar.height-1))/ar.height;
276
277 if (width_correction < height_correction)
278 {
279 new_size.width = new_size.width - DeltaX(width_correction);
280 }
281 else
282 {
283 new_size.height = new_size.height + DeltaY(height_correction);
284 }
285 }
286 }
287
288 if (min_width > new_size.width)
289 new_size.width = min_width;
290
291 if (min_height > new_size.height)
292 new_size.height = min_height;
293
294 if (max_width < new_size.width)
295 new_size.width = max_width;
296
297 if (max_height < new_size.height)
298 new_size.height = max_height;
299
300 if (width_inc.is_set())
301 {
302 auto const width = new_size.width.as_int() - min_width.as_int();
303 auto inc = width_inc.value().as_int();
304 if (width % inc)
305 new_size.width = min_width + DeltaX{inc*(((2L*width + inc)/2)/inc)};
306 }
307
308 if (height_inc.is_set())
309 {
310 auto const height = new_size.height.as_int() - min_height.as_int();
311 auto inc = height_inc.value().as_int();
312 if (height % inc)
313 new_size.height = min_height + DeltaY{inc*(((2L*height + inc)/2)/inc)};
314 }
315
316 if (left_resize)
317 new_pos.x += new_size.width - requested_size.width;
318
319 if (top_resize)
320 new_pos.y += new_size.height - requested_size.height;
321
322 // placeholder - constrain onscreen
323
324 switch (state)
325 {
326 case mir_window_state_restored:
327 break;
328
329 // "A vertically maximised surface is anchored to the top and bottom of
330 // the available workspace and can have any width."
331 case mir_window_state_vertmaximized:
332 new_pos.y = surface->top_left().y;
333 new_size.height = surface->size().height;
334 break;
335
336 // "A horizontally maximised surface is anchored to the left and right of
337 // the available workspace and can have any height"
338 case mir_window_state_horizmaximized:
339 new_pos.x = surface->top_left().x;
340 new_size.width = surface->size().width;
341 break;
342
343 // "A maximised surface is anchored to the top, bottom, left and right of the
344 // available workspace. For example, if the launcher is always-visible then
345 // the left-edge of the surface is anchored to the right-edge of the launcher."
346 case mir_window_state_maximized:
347 default:
348 new_pos.x = surface->top_left().x;
349 new_pos.y = surface->top_left().y;
350 new_size.width = surface->size().width;
351 new_size.height = surface->size().height;
352 break;
353 }
354
355 requested_pos = new_pos;
356 requested_size = new_size;
357}
358
359bool me::SurfaceInfo::needs_titlebar(MirWindowType type)
360{
361 switch (type)
362 {
363 case mir_window_type_freestyle:
364 case mir_window_type_menu:
365 case mir_window_type_inputmethod:
366 case mir_window_type_gloss:
367 case mir_window_type_tip:
368 // No decorations for these surface types
369 return false;
370 default:
371 return true;
372 }
373}
3740
=== removed file 'examples/server_example_window_management_info.h'
--- examples/server_example_window_management_info.h 2017-01-18 02:29:37 +0000
+++ examples/server_example_window_management_info.h 1970-01-01 00:00:00 +0000
@@ -1,105 +0,0 @@
1/*
2 * Copyright © 2015 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 MIR_SERVER_EXAMPLE_WINDOW_MANAGEMENT_INFO_H
20#define MIR_SERVER_EXAMPLE_WINDOW_MANAGEMENT_INFO_H
21
22#include "mir/geometry/rectangles.h"
23#include "mir/optional_value.h"
24#include "mir/shell/surface_specification.h"
25
26#include <vector>
27
28namespace mir
29{
30namespace scene { class Session; class Surface; class SurfaceCreationParameters; }
31namespace examples
32{
33struct SurfaceInfo
34{
35 SurfaceInfo(
36 std::shared_ptr <scene::Session> const& session,
37 std::shared_ptr <scene::Surface> const& surface,
38 scene::SurfaceCreationParameters const& params);
39
40 bool can_be_active() const;
41
42 bool can_morph_to(MirWindowType new_type) const;
43
44 bool must_have_parent() const;
45
46 bool must_not_have_parent() const;
47
48 bool is_visible() const;
49
50 static bool needs_titlebar(MirWindowType type);
51
52 void constrain_resize(
53 std::shared_ptr <scene::Surface> const& surface,
54 geometry::Point& requested_pos,
55 geometry::Size& requested_size,
56 const bool left_resize,
57 const bool top_resize,
58 geometry::Rectangle const& bounds) const;
59
60 MirWindowType type;
61 MirWindowState state;
62 geometry::Rectangle restore_rect;
63 std::weak_ptr <scene::Session> session;
64 std::weak_ptr <scene::Surface> parent;
65 std::vector <std::weak_ptr<scene::Surface>> children;
66 std::shared_ptr <scene::Surface> titlebar;
67 frontend::SurfaceId titlebar_id;
68 frontend::BufferStreamId titlebar_stream_id;
69 bool is_titlebar = false;
70 geometry::Width min_width;
71 geometry::Height min_height;
72 geometry::Width max_width;
73 geometry::Height max_height;
74 mir::optional_value<geometry::DeltaX> width_inc;
75 mir::optional_value<geometry::DeltaY> height_inc;
76 mir::optional_value<shell::SurfaceAspectRatio> min_aspect;
77 mir::optional_value<shell::SurfaceAspectRatio> max_aspect;
78 mir::optional_value<graphics::DisplayConfigurationOutputId> output_id;
79
80 void init_titlebar(
81 std::shared_ptr<scene::Session> const& session,
82 std::shared_ptr<scene::Surface> const& surface);
83
84 void paint_titlebar(int intensity);
85
86private:
87
88 struct StreamPainter;
89 struct AllocatingPainter;
90
91 std::shared_ptr <StreamPainter> stream_painter;
92};
93
94struct SessionInfo
95{
96 std::vector<std::weak_ptr<scene::Surface>> surfaces;
97
98 // This is only used by the TilingWindowManagerPolicy,
99 // perhaps we need a more extensible mechanism. (std::experimental::any?)
100 geometry::Rectangle tile;
101};
102}
103}
104
105#endif //MIR_SERVER_EXAMPLE_WINDOW_MANAGEMENT_INFO_H
1060
=== modified file 'include/server/mir/shell/abstract_shell.h'
--- include/server/mir/shell/abstract_shell.h 2017-03-09 17:42:58 +0000
+++ include/server/mir/shell/abstract_shell.h 2017-04-04 10:15:32 +0000
@@ -87,6 +87,11 @@
87 std::shared_ptr<scene::Surface> const& surface,87 std::shared_ptr<scene::Surface> const& surface,
88 uint64_t timestamp) override;88 uint64_t timestamp) override;
8989
90 void request_move(
91 std::shared_ptr<scene::Session> const& session,
92 std::shared_ptr<scene::Surface> const& surface,
93 uint64_t timestamp) override;
94
90 std::shared_ptr<scene::PromptSession> start_prompt_session_for(95 std::shared_ptr<scene::PromptSession> start_prompt_session_for(
91 std::shared_ptr<scene::Session> const& session,96 std::shared_ptr<scene::Session> const& session,
92 scene::PromptSessionCreationParameters const& params) override;97 scene::PromptSessionCreationParameters const& params) override;
9398
=== renamed file 'src/include/server/mir/shell/basic_window_manager.h' => 'include/server/mir/shell/basic_window_manager.h'
--- src/include/server/mir/shell/basic_window_manager.h 2017-03-09 17:49:01 +0000
+++ include/server/mir/shell/basic_window_manager.h 2017-04-04 10:15:32 +0000
@@ -130,6 +130,8 @@
130 shell::FocusController* focus_controller,130 shell::FocusController* focus_controller,
131 std::unique_ptr<WindowManagementPolicy> policy);131 std::unique_ptr<WindowManagementPolicy> policy);
132132
133 ~BasicWindowManager();
134
133public:135public:
134 using typename WindowManagerTools::SurfaceInfoMap;136 using typename WindowManagerTools::SurfaceInfoMap;
135 using typename WindowManagerTools::SessionInfoMap;137 using typename WindowManagerTools::SessionInfoMap;
@@ -175,6 +177,11 @@
175 std::shared_ptr<scene::Surface> const& surface,177 std::shared_ptr<scene::Surface> const& surface,
176 uint64_t timestamp) override;178 uint64_t timestamp) override;
177179
180 void handle_request_move(
181 std::shared_ptr<scene::Session> const& session,
182 std::shared_ptr<scene::Surface> const& surface,
183 uint64_t timestamp) override;
184
178 int set_surface_attribute(185 int set_surface_attribute(
179 std::shared_ptr<scene::Session> const& /*session*/,186 std::shared_ptr<scene::Session> const& /*session*/,
180 std::shared_ptr<scene::Surface> const& surface,187 std::shared_ptr<scene::Surface> const& surface,
@@ -217,12 +224,16 @@
217 geometry::Rectangles displays;224 geometry::Rectangles displays;
218 geometry::Point cursor;225 geometry::Point cursor;
219 uint64_t last_input_event_timestamp{0};226 uint64_t last_input_event_timestamp{0};
227 MirEvent const* last_input_event{nullptr};
220228
221 void update_event_timestamp(MirKeyboardEvent const* kev);229 void update_event_timestamp(MirKeyboardEvent const* kev);
222 void update_event_timestamp(MirPointerEvent const* pev);230 void update_event_timestamp(MirPointerEvent const* pev);
223 void update_event_timestamp(MirTouchEvent const* tev);231 void update_event_timestamp(MirTouchEvent const* tev);
224};232 void update_event_timestamp(MirInputEvent const* iev);
233} __attribute__((deprecated("Use libmiral instead")));
225234
235#pragma GCC diagnostic push
236#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
226/// A policy based window manager. This exists to initialize BasicWindowManager and237/// A policy based window manager. This exists to initialize BasicWindowManager and
227/// the WMPolicy (in an awkward manner).238/// the WMPolicy (in an awkward manner).
228/// TODO revisit this initialization sequence.239/// TODO revisit this initialization sequence.
@@ -249,7 +260,8 @@
249 return std::unique_ptr<WMPolicy>(260 return std::unique_ptr<WMPolicy>(
250 new WMPolicy(this, std::forward<PolicyArgs>(policy_args)...));261 new WMPolicy(this, std::forward<PolicyArgs>(policy_args)...));
251 }262 }
252};263} __attribute__((deprecated("Use libmiral instead")));
264#pragma GCC diagnostic pop
253}265}
254}266}
255267
256268
=== renamed file 'src/include/server/mir/shell/canonical_window_manager.h' => 'include/server/mir/shell/canonical_window_manager.h'
--- src/include/server/mir/shell/canonical_window_manager.h 2017-03-08 16:16:44 +0000
+++ include/server/mir/shell/canonical_window_manager.h 2017-04-04 10:15:32 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_SHELL_CANONICAL_WINDOW_MANAGER_H_19#ifndef MIR_SHELL_CANONICAL_WINDOW_MANAGER_H_
20#define MIR_SHELL_CANONICAL_WINDOW_MANAGER_H_20#define MIR_SHELL_CANONICAL_WINDOW_MANAGER_H_
2121
22#include "basic_window_manager.h"22#include "mir/shell/basic_window_manager.h"
2323
24#include "mir/geometry/displacement.h"24#include "mir/geometry/displacement.h"
2525
@@ -122,7 +122,11 @@
122 std::weak_ptr<scene::Surface> active_surface_;122 std::weak_ptr<scene::Surface> active_surface_;
123};123};
124124
125
126#pragma GCC diagnostic push
127#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
125using CanonicalWindowManager = WindowManagerConstructor<CanonicalWindowManagerPolicy>;128using CanonicalWindowManager = WindowManagerConstructor<CanonicalWindowManagerPolicy>;
129#pragma GCC diagnostic pop
126}130}
127}131}
128132
129133
=== modified file 'include/server/mir/shell/shell.h'
--- include/server/mir/shell/shell.h 2017-03-08 12:34:11 +0000
+++ include/server/mir/shell/shell.h 2017-04-04 10:15:32 +0000
@@ -104,6 +104,11 @@
104 std::shared_ptr<scene::Session> const& session,104 std::shared_ptr<scene::Session> const& session,
105 std::shared_ptr<scene::Surface> const& surface,105 std::shared_ptr<scene::Surface> const& surface,
106 uint64_t timestamp) = 0;106 uint64_t timestamp) = 0;
107
108 virtual void request_move(
109 std::shared_ptr<scene::Session> const& session,
110 std::shared_ptr<scene::Surface> const& surface,
111 uint64_t timestamp) = 0;
107/** @} */112/** @} */
108};113};
109}114}
110115
=== modified file 'include/server/mir/shell/shell_wrapper.h'
--- include/server/mir/shell/shell_wrapper.h 2017-03-09 17:42:58 +0000
+++ include/server/mir/shell/shell_wrapper.h 2017-04-04 10:15:32 +0000
@@ -90,6 +90,11 @@
90 std::shared_ptr<scene::Surface> const& surface,90 std::shared_ptr<scene::Surface> const& surface,
91 uint64_t timestamp) override;91 uint64_t timestamp) override;
9292
93 void request_move(
94 std::shared_ptr<scene::Session> const& session,
95 std::shared_ptr<scene::Surface> const& surface,
96 uint64_t timestamp) override;
97
93 void add_display(geometry::Rectangle const& area) override;98 void add_display(geometry::Rectangle const& area) override;
94 void remove_display(geometry::Rectangle const& area) override;99 void remove_display(geometry::Rectangle const& area) override;
95100
96101
=== modified file 'include/server/mir/shell/system_compositor_window_manager.h'
--- include/server/mir/shell/system_compositor_window_manager.h 2017-03-08 12:59:36 +0000
+++ include/server/mir/shell/system_compositor_window_manager.h 2017-04-04 10:15:32 +0000
@@ -100,6 +100,11 @@
100 std::shared_ptr<scene::Surface> const& surface,100 std::shared_ptr<scene::Surface> const& surface,
101 uint64_t timestamp) override;101 uint64_t timestamp) override;
102102
103 void handle_request_move(
104 std::shared_ptr<scene::Session> const& session,
105 std::shared_ptr<scene::Surface> const& surface,
106 uint64_t timestamp) override;
107
103 int set_surface_attribute(108 int set_surface_attribute(
104 std::shared_ptr<scene::Session> const& session,109 std::shared_ptr<scene::Session> const& session,
105 std::shared_ptr<scene::Surface> const& surface,110 std::shared_ptr<scene::Surface> const& surface,
106111
=== renamed file 'src/include/server/mir/shell/window_management_info.h' => 'include/server/mir/shell/window_management_info.h'
--- src/include/server/mir/shell/window_management_info.h 2017-01-18 02:29:37 +0000
+++ include/server/mir/shell/window_management_info.h 2017-04-04 10:15:32 +0000
@@ -27,7 +27,7 @@
2727
28namespace mir28namespace mir
29{29{
30namespace scene { class Session; class Surface; class SurfaceCreationParameters; }30namespace scene { class Session; class Surface; struct SurfaceCreationParameters; }
31namespace shell31namespace shell
32{32{
33struct SurfaceInfo33struct SurfaceInfo
@@ -65,6 +65,7 @@
65 std::vector <std::weak_ptr<scene::Surface>> children;65 std::vector <std::weak_ptr<scene::Surface>> children;
66 std::shared_ptr <scene::Surface> titlebar;66 std::shared_ptr <scene::Surface> titlebar;
67 frontend::SurfaceId titlebar_id;67 frontend::SurfaceId titlebar_id;
68 frontend::BufferStreamId titlebar_stream_id;
68 bool is_titlebar = false;69 bool is_titlebar = false;
69 geometry::Width min_width;70 geometry::Width min_width;
70 geometry::Height min_height;71 geometry::Height min_height;
@@ -77,8 +78,7 @@
77 mir::optional_value<graphics::DisplayConfigurationOutputId> output_id;78 mir::optional_value<graphics::DisplayConfigurationOutputId> output_id;
78 mir::optional_value<MirPointerConfinementState> confine_pointer;79 mir::optional_value<MirPointerConfinementState> confine_pointer;
7980
80 void init_titlebar(std::shared_ptr <scene::Surface> const& surface);81 void init_titlebar(std::shared_ptr<scene::Session> const& session, std::shared_ptr<scene::Surface> const& surface);
81
82 void paint_titlebar(int intensity);82 void paint_titlebar(int intensity);
8383
84private:84private:
8585
=== modified file 'include/server/mir/shell/window_manager.h'
--- include/server/mir/shell/window_manager.h 2017-03-08 12:59:36 +0000
+++ include/server/mir/shell/window_manager.h 2017-04-04 10:15:32 +0000
@@ -81,6 +81,11 @@
81 std::shared_ptr<scene::Surface> const& surface,81 std::shared_ptr<scene::Surface> const& surface,
82 uint64_t timestamp) = 0;82 uint64_t timestamp) = 0;
8383
84 virtual void handle_request_move(
85 std::shared_ptr<scene::Session> const& session,
86 std::shared_ptr<scene::Surface> const& surface,
87 uint64_t timestamp) = 0;
88
84 virtual ~WindowManager() = default;89 virtual ~WindowManager() = default;
85 WindowManager() = default;90 WindowManager() = default;
86 WindowManager(WindowManager const&) = delete;91 WindowManager(WindowManager const&) = delete;
8792
=== modified file 'include/test/mir/test/doubles/mock_window_manager.h'
--- include/test/mir/test/doubles/mock_window_manager.h 2017-03-08 12:59:36 +0000
+++ include/test/mir/test/doubles/mock_window_manager.h 2017-04-04 10:15:32 +0000
@@ -59,6 +59,7 @@
5959
60 MOCK_METHOD3(handle_raise_surface, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t));60 MOCK_METHOD3(handle_raise_surface, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t));
61 MOCK_METHOD3(handle_request_drag_and_drop, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t));61 MOCK_METHOD3(handle_request_drag_and_drop, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t));
62 MOCK_METHOD3(handle_request_move, void(std::shared_ptr<scene::Session> const&, std::shared_ptr<scene::Surface> const&, uint64_t));
6263
63 MOCK_METHOD4(set_surface_attribute,64 MOCK_METHOD4(set_surface_attribute,
64 int(std::shared_ptr<scene::Session> const& session,65 int(std::shared_ptr<scene::Session> const& session,
6566
=== modified file 'src/include/server/mir/frontend/shell.h'
--- src/include/server/mir/frontend/shell.h 2017-03-08 12:34:11 +0000
+++ src/include/server/mir/frontend/shell.h 2017-04-04 10:15:32 +0000
@@ -82,15 +82,17 @@
82 SurfaceId surface_id,82 SurfaceId surface_id,
83 MirWindowAttrib attrib) = 0;83 MirWindowAttrib attrib) = 0;
8484
85 virtual void raise_surface(85 enum class UserRequest
86 std::shared_ptr<Session> const& session,86 {
87 SurfaceId surface_id,87 drag_and_drop,
88 uint64_t timestamp) = 0;88 move,
89 activate,
90 };
8991
90 virtual void request_drag_and_drop(92 virtual void request_operation(
91 std::shared_ptr<Session> const& session,93 std::shared_ptr<Session> const& session,
92 SurfaceId surface_id,94 SurfaceId surface_id, uint64_t timestamp,
93 uint64_t timestamp) = 0;95 UserRequest request) = 0;
9496
95protected:97protected:
96 Shell() = default;98 Shell() = default;
9799
=== modified file 'src/server/CMakeLists.txt'
--- src/server/CMakeLists.txt 2017-03-14 05:30:56 +0000
+++ src/server/CMakeLists.txt 2017-04-04 10:15:32 +0000
@@ -11,6 +11,7 @@
11 ${PROJECT_SOURCE_DIR}/include/server11 ${PROJECT_SOURCE_DIR}/include/server
12 ${PROJECT_SOURCE_DIR}/include/renderer12 ${PROJECT_SOURCE_DIR}/include/renderer
13 ${PROJECT_SOURCE_DIR}/include/renderers/gl13 ${PROJECT_SOURCE_DIR}/include/renderers/gl
14 ${PROJECT_SOURCE_DIR}/include/renderers/sw
14 ${PROJECT_SOURCE_DIR}/src/include/platform15 ${PROJECT_SOURCE_DIR}/src/include/platform
15 ${PROJECT_SOURCE_DIR}/src/include/client16 ${PROJECT_SOURCE_DIR}/src/include/client
16 ${PROJECT_SOURCE_DIR}/src/include/server17 ${PROJECT_SOURCE_DIR}/src/include/server
1718
=== modified file 'src/server/frontend/CMakeLists.txt'
--- src/server/frontend/CMakeLists.txt 2017-02-15 07:38:33 +0000
+++ src/server/frontend/CMakeLists.txt 2017-04-04 10:15:32 +0000
@@ -33,6 +33,7 @@
33 screencast_buffer_tracker.cpp33 screencast_buffer_tracker.cpp
34 session_mediator_observer_multiplexer.cpp34 session_mediator_observer_multiplexer.cpp
35 session_mediator_observer_multiplexer.h35 session_mediator_observer_multiplexer.h
36 ${PROJECT_SOURCE_DIR}/src/include/server/mir/frontend/shell.h
36)37)
3738
38add_library(39add_library(
3940
=== modified file 'src/server/frontend/session_mediator.cpp'
--- src/server/frontend/session_mediator.cpp 2017-04-04 07:04:57 +0000
+++ src/server/frontend/session_mediator.cpp 2017-04-04 10:15:32 +0000
@@ -1180,11 +1180,24 @@
1180 switch (request->operation())1180 switch (request->operation())
1181 {1181 {
1182 case mir::protobuf::RequestOperation::START_DRAG_AND_DROP:1182 case mir::protobuf::RequestOperation::START_DRAG_AND_DROP:
1183 shell->request_drag_and_drop(session, mf::SurfaceId{surface_id.value()}, cookie_ptr->timestamp());1183 shell->request_operation(
1184 session, mf::SurfaceId{surface_id.value()},
1185 cookie_ptr->timestamp(),
1186 Shell::UserRequest::drag_and_drop);
1184 break;1187 break;
11851188
1186 case mir::protobuf::RequestOperation::MAKE_ACTIVE:1189 case mir::protobuf::RequestOperation::MAKE_ACTIVE:
1187 shell->raise_surface(session, mf::SurfaceId{surface_id.value()}, cookie_ptr->timestamp());1190 shell->request_operation(
1191 session, mf::SurfaceId{surface_id.value()},
1192 cookie_ptr->timestamp(),
1193 Shell::UserRequest::activate);
1194 break;
1195
1196 case mir::protobuf::RequestOperation::USER_MOVE:
1197 shell->request_operation(
1198 session, mf::SurfaceId{surface_id.value()},
1199 cookie_ptr->timestamp(),
1200 Shell::UserRequest::move);
1188 break;1201 break;
11891202
1190 default:1203 default:
11911204
=== modified file 'src/server/frontend/shell_wrapper.cpp'
--- src/server/frontend/shell_wrapper.cpp 2017-03-08 12:34:11 +0000
+++ src/server/frontend/shell_wrapper.cpp 2017-04-04 10:15:32 +0000
@@ -99,18 +99,8 @@
99 return wrapped->get_surface_attribute(session, surface_id, attrib);99 return wrapped->get_surface_attribute(session, surface_id, attrib);
100}100}
101101
102void mf::ShellWrapper::raise_surface(102void mf::ShellWrapper::request_operation(
103 std::shared_ptr<Session> const& session,103 std::shared_ptr<Session> const& session, SurfaceId surface_id, uint64_t timestamp, UserRequest request)
104 SurfaceId surface_id,104{
105 uint64_t timestamp)105 wrapped->request_operation(session, surface_id, timestamp, request);
106{
107 wrapped->raise_surface(session, surface_id, timestamp);
108}
109
110void mf::ShellWrapper::request_drag_and_drop(
111 std::shared_ptr<Session> const& session,
112 SurfaceId surface_id,
113 uint64_t timestamp)
114{
115 wrapped->request_drag_and_drop(session, surface_id, timestamp);
116}106}
117107
=== modified file 'src/server/frontend/shell_wrapper.h'
--- src/server/frontend/shell_wrapper.h 2017-03-08 12:34:11 +0000
+++ src/server/frontend/shell_wrapper.h 2017-04-04 10:15:32 +0000
@@ -75,15 +75,11 @@
75 SurfaceId surface_id,75 SurfaceId surface_id,
76 MirWindowAttrib attrib) override;76 MirWindowAttrib attrib) override;
7777
78 void raise_surface(78 void request_operation(
79 std::shared_ptr<Session> const& session,79 std::shared_ptr<Session> const& session,
80 SurfaceId surface_id,80 SurfaceId surface_id,
81 uint64_t timestamp) override;81 uint64_t timestamp,
8282 UserRequest request) override;
83 void request_drag_and_drop(
84 std::shared_ptr<Session> const& session,
85 SurfaceId surface_id,
86 uint64_t timestamp) override;
8783
88protected:84protected:
89 std::shared_ptr<Shell> const wrapped;85 std::shared_ptr<Shell> const wrapped;
9086
=== modified file 'src/server/shell/CMakeLists.txt'
--- src/server/shell/CMakeLists.txt 2017-01-18 02:29:37 +0000
+++ src/server/shell/CMakeLists.txt 2017-04-04 10:15:32 +0000
@@ -2,8 +2,8 @@
2 SHELL_SOURCES2 SHELL_SOURCES
33
4 abstract_shell.cpp4 abstract_shell.cpp
5 basic_window_manager.cpp ${CMAKE_SOURCE_DIR}/src/include/server/mir/shell/basic_window_manager.h5 basic_window_manager.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/basic_window_manager.h
6 canonical_window_manager.cpp ${CMAKE_SOURCE_DIR}/src/include/server/mir/shell/canonical_window_manager.h6 canonical_window_manager.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/canonical_window_manager.h
7 frontend_shell.cpp7 frontend_shell.cpp
8 graphics_display_layout.cpp8 graphics_display_layout.cpp
9 graphics_display_layout.h9 graphics_display_layout.h
@@ -17,7 +17,7 @@
17 ${CMAKE_SOURCE_DIR}/include/server/mir/shell/display_configuration_controller.h17 ${CMAKE_SOURCE_DIR}/include/server/mir/shell/display_configuration_controller.h
18 surface_specification.cpp18 surface_specification.cpp
19 surface_stack_wrapper.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/surface_stack_wrapper.h19 surface_stack_wrapper.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/surface_stack_wrapper.h
20 window_management_info.cpp ${CMAKE_SOURCE_DIR}/src/include/server/mir/shell/window_management_info.h20 window_management_info.cpp ${CMAKE_SOURCE_DIR}/include/server/mir/shell/window_management_info.h
21)21)
2222
23add_library(23add_library(
2424
=== modified file 'src/server/shell/abstract_shell.cpp'
--- src/server/shell/abstract_shell.cpp 2017-03-28 18:02:49 +0000
+++ src/server/shell/abstract_shell.cpp 2017-04-04 10:15:32 +0000
@@ -266,6 +266,14 @@
266 window_manager->handle_request_drag_and_drop(session, surface, timestamp);266 window_manager->handle_request_drag_and_drop(session, surface, timestamp);
267}267}
268268
269void msh::AbstractShell::request_move(
270 std::shared_ptr<scene::Session> const& session,
271 std::shared_ptr<scene::Surface> const& surface,
272 uint64_t timestamp)
273{
274 window_manager->handle_request_move(session, surface, timestamp);
275}
276
269void msh::AbstractShell::focus_next_session()277void msh::AbstractShell::focus_next_session()
270{278{
271 std::unique_lock<std::mutex> lock(focus_mutex);279 std::unique_lock<std::mutex> lock(focus_mutex);
272280
=== modified file 'src/server/shell/basic_window_manager.cpp'
--- src/server/shell/basic_window_manager.cpp 2017-03-09 17:49:01 +0000
+++ src/server/shell/basic_window_manager.cpp 2017-04-04 10:15:32 +0000
@@ -32,6 +32,12 @@
32{32{
33}33}
3434
35msh::BasicWindowManager::~BasicWindowManager()
36{
37 if (last_input_event)
38 mir_event_unref(last_input_event);
39}
40
35void msh::BasicWindowManager::add_session(std::shared_ptr<scene::Session> const& session)41void msh::BasicWindowManager::add_session(std::shared_ptr<scene::Session> const& session)
36{42{
37 std::lock_guard<decltype(mutex)> lock(mutex);43 std::lock_guard<decltype(mutex)> lock(mutex);
@@ -145,6 +151,21 @@
145 policy->handle_request_drag_and_drop(session, surface);151 policy->handle_request_drag_and_drop(session, surface);
146}152}
147153
154void msh::BasicWindowManager::handle_request_move(
155 std::shared_ptr<scene::Session> const& session,
156 std::shared_ptr<scene::Surface> const& surface,
157 uint64_t timestamp)
158{
159 std::lock_guard<decltype(mutex)> lock(mutex);
160 if (timestamp >= last_input_event_timestamp)
161 {
162 // When we reintegrate with miral::BasicWindowManager this is where we
163 // will ask the policy to to handle the move.
164 (void)session;
165 (void)surface;
166 }
167}
168
148int msh::BasicWindowManager::set_surface_attribute(169int msh::BasicWindowManager::set_surface_attribute(
149 std::shared_ptr<scene::Session> const& /*session*/,170 std::shared_ptr<scene::Session> const& /*session*/,
150 std::shared_ptr<scene::Surface> const& surface,171 std::shared_ptr<scene::Surface> const& surface,
@@ -288,25 +309,22 @@
288309
289void msh::BasicWindowManager::update_event_timestamp(MirKeyboardEvent const* kev)310void msh::BasicWindowManager::update_event_timestamp(MirKeyboardEvent const* kev)
290{311{
291 auto iev = mir_keyboard_event_input_event(kev);312 update_event_timestamp(mir_keyboard_event_input_event(kev));
292 last_input_event_timestamp = mir_input_event_get_event_time(iev);
293}313}
294314
295void msh::BasicWindowManager::update_event_timestamp(MirPointerEvent const* pev)315void msh::BasicWindowManager::update_event_timestamp(MirPointerEvent const* pev)
296{316{
297 auto iev = mir_pointer_event_input_event(pev);
298 auto pointer_action = mir_pointer_event_action(pev);317 auto pointer_action = mir_pointer_event_action(pev);
299318
300 if (pointer_action == mir_pointer_action_button_up ||319 if (pointer_action == mir_pointer_action_button_up ||
301 pointer_action == mir_pointer_action_button_down)320 pointer_action == mir_pointer_action_button_down)
302 {321 {
303 last_input_event_timestamp = mir_input_event_get_event_time(iev);322 update_event_timestamp(mir_pointer_event_input_event(pev));
304 }323 }
305}324}
306325
307void msh::BasicWindowManager::update_event_timestamp(MirTouchEvent const* tev)326void msh::BasicWindowManager::update_event_timestamp(MirTouchEvent const* tev)
308{327{
309 auto iev = mir_touch_event_input_event(tev);
310 auto touch_count = mir_touch_event_point_count(tev);328 auto touch_count = mir_touch_event_point_count(tev);
311 for (unsigned i = 0; i < touch_count; i++)329 for (unsigned i = 0; i < touch_count; i++)
312 {330 {
@@ -314,12 +332,20 @@
314 if (touch_action == mir_touch_action_up ||332 if (touch_action == mir_touch_action_up ||
315 touch_action == mir_touch_action_down)333 touch_action == mir_touch_action_down)
316 {334 {
317 last_input_event_timestamp = mir_input_event_get_event_time(iev);335 update_event_timestamp(mir_touch_event_input_event(tev));
318 break;336 break;
319 }337 }
320 }338 }
321}339}
322340
341void msh::BasicWindowManager::update_event_timestamp(MirInputEvent const* iev)
342{
343 last_input_event_timestamp = mir_input_event_get_event_time(iev);
344 if (last_input_event)
345 mir_event_unref(last_input_event);
346 last_input_event = mir_event_ref(mir_input_event_get_event(iev));
347}
348
323void mir::shell::BasicWindowManager::set_drag_and_drop_handle(std::vector<uint8_t> const& handle)349void mir::shell::BasicWindowManager::set_drag_and_drop_handle(std::vector<uint8_t> const& handle)
324{350{
325 focus_controller->set_drag_and_drop_handle(handle);351 focus_controller->set_drag_and_drop_handle(handle);
326352
=== modified file 'src/server/shell/frontend_shell.cpp'
--- src/server/shell/frontend_shell.cpp 2017-03-08 12:34:11 +0000
+++ src/server/shell/frontend_shell.cpp 2017-04-04 10:15:32 +0000
@@ -148,22 +148,34 @@
148 return wrapped->get_surface_attribute(surface, attrib);148 return wrapped->get_surface_attribute(surface, attrib);
149}149}
150150
151void msh::FrontendShell::raise_surface(151void msh::FrontendShell::request_operation(
152 std::shared_ptr<mf::Session> const& session,152 std::shared_ptr<mf::Session> const& session,
153 mf::SurfaceId surface_id,153 mf::SurfaceId surface_id,
154 uint64_t timestamp)154 uint64_t timestamp,
155{155 UserRequest request)
156 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);156{
157 auto const surface = scene_session->surface(surface_id);157 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);
158 wrapped->raise_surface(scene_session, surface, timestamp);158 auto const surface = scene_session->surface(surface_id);
159}159
160160 switch (request)
161void msh::FrontendShell::request_drag_and_drop(161 {
162 std::shared_ptr<mf::Session> const& session,162 case UserRequest::activate:
163 mf::SurfaceId surface_id,163 {
164 uint64_t timestamp)164 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);
165{165 auto const surface = scene_session->surface(surface_id);
166 auto const scene_session = std::dynamic_pointer_cast<ms::Session>(session);166 wrapped->raise_surface(scene_session, surface, timestamp);
167 auto const surface = scene_session->surface(surface_id);167 break;
168 wrapped->request_drag_and_drop(scene_session, surface, timestamp);168 }
169
170 case UserRequest::drag_and_drop:
171 wrapped->request_drag_and_drop(scene_session, surface, timestamp);
172 break;
173
174 case UserRequest::move:
175 wrapped->request_move(scene_session, surface, timestamp);
176 break;
177
178 default:
179 break;
180 }
169}181}
170182
=== modified file 'src/server/shell/frontend_shell.h'
--- src/server/shell/frontend_shell.h 2017-03-08 12:34:11 +0000
+++ src/server/shell/frontend_shell.h 2017-04-04 10:15:32 +0000
@@ -87,15 +87,11 @@
87 mf::SurfaceId surface_id,87 mf::SurfaceId surface_id,
88 MirWindowAttrib attrib) override;88 MirWindowAttrib attrib) override;
8989
90 void raise_surface(90 void request_operation(
91 std::shared_ptr<mf::Session> const& session,91 std::shared_ptr<mf::Session> const& session,
92 mf::SurfaceId surface_id,92 mf::SurfaceId surface_id,
93 uint64_t timestamp) override;93 uint64_t timestamp,
9494 UserRequest request) override;
95 void request_drag_and_drop(
96 std::shared_ptr<mf::Session> const& session,
97 mf::SurfaceId surface_id,
98 uint64_t timestamp) override;
99};95};
100}96}
101}97}
10298
=== modified file 'src/server/shell/shell_wrapper.cpp'
--- src/server/shell/shell_wrapper.cpp 2017-03-10 14:27:50 +0000
+++ src/server/shell/shell_wrapper.cpp 2017-04-04 10:15:32 +0000
@@ -128,6 +128,14 @@
128 wrapped->request_drag_and_drop(session, surface, timestamp);128 wrapped->request_drag_and_drop(session, surface, timestamp);
129}129}
130130
131void msh::ShellWrapper::request_move(
132 std::shared_ptr<ms::Session> const& session,
133 std::shared_ptr<ms::Surface> const& surface,
134 uint64_t timestamp)
135{
136 wrapped->request_move(session, surface, timestamp);
137}
138
131void msh::ShellWrapper::add_display(geometry::Rectangle const& area)139void msh::ShellWrapper::add_display(geometry::Rectangle const& area)
132{140{
133 wrapped->add_display(area);141 wrapped->add_display(area);
134142
=== modified file 'src/server/shell/system_compositor_window_manager.cpp'
--- src/server/shell/system_compositor_window_manager.cpp 2017-03-08 12:59:36 +0000
+++ src/server/shell/system_compositor_window_manager.cpp 2017-04-04 10:15:32 +0000
@@ -208,3 +208,10 @@
208 uint64_t /*timestamp*/)208 uint64_t /*timestamp*/)
209{209{
210}210}
211
212void msh::SystemCompositorWindowManager::handle_request_move(
213 std::shared_ptr<ms::Session> const& /*session*/,
214 std::shared_ptr<ms::Surface> const& /*surface*/,
215 uint64_t /*timestamp*/)
216{
217}
211218
=== modified file 'src/server/shell/window_management_info.cpp'
--- src/server/shell/window_management_info.cpp 2017-01-18 02:29:37 +0000
+++ src/server/shell/window_management_info.cpp 2017-04-04 10:15:32 +0000
@@ -18,13 +18,16 @@
1818
19#include "mir/shell/window_management_info.h"19#include "mir/shell/window_management_info.h"
2020
21#include "mir/scene/session.h"
21#include "mir/scene/surface.h"22#include "mir/scene/surface.h"
22#include "mir/scene/surface_creation_parameters.h"23#include "mir/scene/surface_creation_parameters.h"
2324
24#include "mir/graphics/buffer.h"25#include "mir/graphics/buffer.h"
26#include "mir/renderer/sw/pixel_source.h"
2527
26#include <atomic>28#include <atomic>
2729
30namespace mrs = mir::renderer::software;
28namespace msh = mir::shell;31namespace msh = mir::shell;
29namespace ms = mir::scene;32namespace ms = mir::scene;
30namespace mg = mir::graphics;33namespace mg = mir::graphics;
@@ -156,6 +159,75 @@
156 return true;159 return true;
157}160}
158161
162struct msh::SurfaceInfo::StreamPainter
163{
164 virtual void paint(int) = 0;
165 virtual ~StreamPainter() = default;
166 StreamPainter() = default;
167 StreamPainter(StreamPainter const&) = delete;
168 StreamPainter& operator=(StreamPainter const&) = delete;
169};
170
171struct msh::SurfaceInfo::AllocatingPainter
172 : msh::SurfaceInfo::StreamPainter
173{
174 AllocatingPainter(
175 std::shared_ptr<frontend::BufferStream> const& buffer_stream,
176 std::shared_ptr<scene::Session> const& session,
177 Size size) :
178 buffer_stream(buffer_stream),
179 session(session),
180 properties({
181 size,
182 buffer_stream->pixel_format(),
183 mg::BufferUsage::software
184 }),
185 front_buffer(session->create_buffer(properties)),
186 back_buffer(session->create_buffer(properties))
187 {
188 }
189
190 void paint(int intensity) override
191 {
192 auto buffer = session->get_buffer(back_buffer);
193
194 auto const format = buffer->pixel_format();
195 auto const sz = buffer->size().height.as_int() *
196 buffer->size().width.as_int() * MIR_BYTES_PER_PIXEL(format);
197 std::vector<unsigned char> pixels(sz, intensity);
198 if (auto pixel_source = dynamic_cast<mrs::PixelSource*>(buffer->native_buffer_base()))
199 pixel_source->write(pixels.data(), sz);
200 buffer_stream->submit_buffer(buffer);
201
202 std::swap(front_buffer, back_buffer);
203 }
204
205 ~AllocatingPainter()
206 {
207 session->destroy_buffer(front_buffer);
208 session->destroy_buffer(back_buffer);
209 }
210
211 std::shared_ptr<frontend::BufferStream> const buffer_stream;
212 std::shared_ptr<scene::Session> const session;
213 mg::BufferProperties properties;
214 mg::BufferID front_buffer;
215 mg::BufferID back_buffer;
216};
217
218void msh::SurfaceInfo::init_titlebar(
219 std::shared_ptr<scene::Session> const& session,
220 std::shared_ptr<scene::Surface> const& surface)
221{
222 auto stream = surface->primary_buffer_stream();
223 stream_painter = std::make_shared<AllocatingPainter>(stream, session, surface->size());
224}
225
226void msh::SurfaceInfo::paint_titlebar(int intensity)
227{
228 stream_painter->paint(intensity);
229}
230
159void msh::SurfaceInfo::constrain_resize(231void msh::SurfaceInfo::constrain_resize(
160 std::shared_ptr<ms::Surface> const& surface,232 std::shared_ptr<ms::Surface> const& surface,
161 Point& requested_pos,233 Point& requested_pos,
162234
=== modified file 'src/server/symbols.map'
--- src/server/symbols.map 2017-03-21 07:57:17 +0000
+++ src/server/symbols.map 2017-04-04 10:15:32 +0000
@@ -37,6 +37,7 @@
37 mir::frontend::BufferStream::operator*;37 mir::frontend::BufferStream::operator*;
38 mir::frontend::ClientBuffers::?ClientBuffers*;38 mir::frontend::ClientBuffers::?ClientBuffers*;
39 mir::frontend::ClientBuffers::ClientBuffers*;39 mir::frontend::ClientBuffers::ClientBuffers*;
40 mir::frontend::ClientBuffers::operator*;
40 mir::frontend::PromptSession::operator*;41 mir::frontend::PromptSession::operator*;
41 mir::frontend::PromptSession::?PromptSession*;42 mir::frontend::PromptSession::?PromptSession*;
42 mir::frontend::PromptSession::PromptSession*;43 mir::frontend::PromptSession::PromptSession*;
@@ -251,6 +252,7 @@
251 mir::shell::AbstractShell::AbstractShell*;252 mir::shell::AbstractShell::AbstractShell*;
252 mir::shell::AbstractShell::add_display*;253 mir::shell::AbstractShell::add_display*;
253 mir::shell::AbstractShell::add_prompt_provider_for*;254 mir::shell::AbstractShell::add_prompt_provider_for*;
255 mir::shell::AbstractShell::clear_drag_and_drop_handle*;
254 mir::shell::AbstractShell::close_session*;256 mir::shell::AbstractShell::close_session*;
255 mir::shell::AbstractShell::create_surface*;257 mir::shell::AbstractShell::create_surface*;
256 mir::shell::AbstractShell::destroy_surface*;258 mir::shell::AbstractShell::destroy_surface*;
@@ -264,12 +266,56 @@
264 mir::shell::AbstractShell::raise*;266 mir::shell::AbstractShell::raise*;
265 mir::shell::AbstractShell::raise_surface*;267 mir::shell::AbstractShell::raise_surface*;
266 mir::shell::AbstractShell::remove_display*;268 mir::shell::AbstractShell::remove_display*;
269 mir::shell::AbstractShell::request_drag_and_drop*;
270 mir::shell::AbstractShell::request_move*;
271 mir::shell::AbstractShell::set_drag_and_drop_handle*;
267 mir::shell::AbstractShell::set_focus_to*;272 mir::shell::AbstractShell::set_focus_to*;
268 mir::shell::AbstractShell::set_surface_attribute*;273 mir::shell::AbstractShell::set_surface_attribute*;
269 mir::shell::AbstractShell::start_prompt_session_for*;274 mir::shell::AbstractShell::start_prompt_session_for*;
270 mir::shell::AbstractShell::stop_prompt_session*;275 mir::shell::AbstractShell::stop_prompt_session*;
271 mir::shell::AbstractShell::surface_at*;276 mir::shell::AbstractShell::surface_at*;
272 mir::shell::AbstractShell::update_focused_surface_confined_region*;277 mir::shell::AbstractShell::update_focused_surface_confined_region*;
278 mir::shell::BasicWindowManager::active_display*;
279 mir::shell::BasicWindowManager::add_display*;
280 mir::shell::BasicWindowManager::add_session*;
281 mir::shell::BasicWindowManager::add_surface*;
282 mir::shell::BasicWindowManager::?BasicWindowManager*;
283 mir::shell::BasicWindowManager::BasicWindowManager*;
284 mir::shell::BasicWindowManager::clear_drag_and_drop_handle*;
285 mir::shell::BasicWindowManager::find_session*;
286 mir::shell::BasicWindowManager::focused_session*;
287 mir::shell::BasicWindowManager::focused_surface*;
288 mir::shell::BasicWindowManager::focus_next_session*;
289 mir::shell::BasicWindowManager::forget*;
290 mir::shell::BasicWindowManager::handle_keyboard_event*;
291 mir::shell::BasicWindowManager::handle_pointer_event*;
292 mir::shell::BasicWindowManager::handle_raise_surface*;
293 mir::shell::BasicWindowManager::handle_request_drag_and_drop*;
294 mir::shell::BasicWindowManager::handle_request_move*;
295 mir::shell::BasicWindowManager::handle_touch_event*;
296 mir::shell::BasicWindowManager::info_for*;
297 mir::shell::BasicWindowManager::modify_surface*;
298 mir::shell::BasicWindowManager::raise_tree*;
299 mir::shell::BasicWindowManager::remove_display*;
300 mir::shell::BasicWindowManager::remove_session*;
301 mir::shell::BasicWindowManager::remove_surface*;
302 mir::shell::BasicWindowManager::set_drag_and_drop_handle*;
303 mir::shell::BasicWindowManager::set_focus_to*;
304 mir::shell::BasicWindowManager::set_surface_attribute*;
305 mir::shell::BasicWindowManager::surface_at*;
306 mir::shell::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy*;
307 mir::shell::CanonicalWindowManagerPolicy::handle_delete_surface*;
308 mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*;
309 mir::shell::CanonicalWindowManagerPolicy::handle_keyboard_event*;
310 mir::shell::CanonicalWindowManagerPolicy::handle_modify_surface*;
311 mir::shell::CanonicalWindowManagerPolicy::handle_new_surface*;
312 mir::shell::CanonicalWindowManagerPolicy::handle_place_new_surface*;
313 mir::shell::CanonicalWindowManagerPolicy::handle_pointer_event*;
314 mir::shell::CanonicalWindowManagerPolicy::handle_raise_surface*;
315 mir::shell::CanonicalWindowManagerPolicy::handle_request_drag_and_drop*;
316 mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*;
317 mir::shell::CanonicalWindowManagerPolicy::handle_set_state*;
318 mir::shell::CanonicalWindowManagerPolicy::handle_touch_event*;
273 mir::shell::DisplayConfigurationController::?DisplayConfigurationController*;319 mir::shell::DisplayConfigurationController::?DisplayConfigurationController*;
274 mir::shell::DisplayConfigurationController::DisplayConfigurationController*;320 mir::shell::DisplayConfigurationController::DisplayConfigurationController*;
275 mir::shell::DisplayConfigurationController::operator*;321 mir::shell::DisplayConfigurationController::operator*;
@@ -309,13 +355,24 @@
309 mir::shell::ShellWrapper::raise_surface*;355 mir::shell::ShellWrapper::raise_surface*;
310 mir::shell::ShellWrapper::remove_display*;356 mir::shell::ShellWrapper::remove_display*;
311 mir::shell::ShellWrapper::request_drag_and_drop*;357 mir::shell::ShellWrapper::request_drag_and_drop*;
358 mir::shell::ShellWrapper::request_move*;
359 mir::shell::ShellWrapper::set_drag_and_drop_handle*;
312 mir::shell::ShellWrapper::set_focus_to*;360 mir::shell::ShellWrapper::set_focus_to*;
313 mir::shell::ShellWrapper::set_surface_attribute*;361 mir::shell::ShellWrapper::set_surface_attribute*;
314 mir::shell::ShellWrapper::ShellWrapper*;362 mir::shell::ShellWrapper::ShellWrapper*;
315 mir::shell::ShellWrapper::set_drag_and_drop_handle*;
316 mir::shell::ShellWrapper::start_prompt_session_for*;363 mir::shell::ShellWrapper::start_prompt_session_for*;
317 mir::shell::ShellWrapper::stop_prompt_session*;364 mir::shell::ShellWrapper::stop_prompt_session*;
318 mir::shell::ShellWrapper::surface_at*;365 mir::shell::ShellWrapper::surface_at*;
366 mir::shell::SurfaceInfo::can_be_active*;
367 mir::shell::SurfaceInfo::can_morph_to*;
368 mir::shell::SurfaceInfo::constrain_resize*;
369 mir::shell::SurfaceInfo::init_titlebar*;
370 mir::shell::SurfaceInfo::is_visible*;
371 mir::shell::SurfaceInfo::must_have_parent*;
372 mir::shell::SurfaceInfo::must_not_have_parent*;
373 mir::shell::SurfaceInfo::needs_titlebar*;
374 mir::shell::SurfaceInfo::paint_titlebar*;
375 mir::shell::SurfaceInfo::SurfaceInfo*;
319 mir::shell::SurfaceReadyObserver::frame_posted*;376 mir::shell::SurfaceReadyObserver::frame_posted*;
320 mir::shell::SurfaceReadyObserver::?SurfaceReadyObserver*;377 mir::shell::SurfaceReadyObserver::?SurfaceReadyObserver*;
321 mir::shell::SurfaceReadyObserver::SurfaceReadyObserver*;378 mir::shell::SurfaceReadyObserver::SurfaceReadyObserver*;
@@ -334,6 +391,8 @@
334 mir::shell::SystemCompositorWindowManager::handle_keyboard_event*;391 mir::shell::SystemCompositorWindowManager::handle_keyboard_event*;
335 mir::shell::SystemCompositorWindowManager::handle_pointer_event*;392 mir::shell::SystemCompositorWindowManager::handle_pointer_event*;
336 mir::shell::SystemCompositorWindowManager::handle_raise_surface*;393 mir::shell::SystemCompositorWindowManager::handle_raise_surface*;
394 mir::shell::SystemCompositorWindowManager::handle_request_drag_and_drop*;
395 mir::shell::SystemCompositorWindowManager::handle_request_move*;
337 mir::shell::SystemCompositorWindowManager::handle_touch_event*;396 mir::shell::SystemCompositorWindowManager::handle_touch_event*;
338 mir::shell::SystemCompositorWindowManager::modify_surface*;397 mir::shell::SystemCompositorWindowManager::modify_surface*;
339 mir::shell::SystemCompositorWindowManager::on_session_added*;398 mir::shell::SystemCompositorWindowManager::on_session_added*;
@@ -342,10 +401,15 @@
342 mir::shell::SystemCompositorWindowManager::remove_display*;401 mir::shell::SystemCompositorWindowManager::remove_display*;
343 mir::shell::SystemCompositorWindowManager::remove_session*;402 mir::shell::SystemCompositorWindowManager::remove_session*;
344 mir::shell::SystemCompositorWindowManager::remove_surface*;403 mir::shell::SystemCompositorWindowManager::remove_surface*;
345 mir::shell::SystemCompositorWindowManager::handle_request_drag_and_drop*;
346 mir::shell::SystemCompositorWindowManager::set_surface_attribute*;404 mir::shell::SystemCompositorWindowManager::set_surface_attribute*;
347 mir::shell::SystemCompositorWindowManager::SystemCompositorWindowManager*;405 mir::shell::SystemCompositorWindowManager::SystemCompositorWindowManager*;
406 mir::shell::WindowManagementPolicy::operator*;
407 mir::shell::WindowManagementPolicy::?WindowManagementPolicy*;
408 mir::shell::WindowManagementPolicy::WindowManagementPolicy*;
348 mir::shell::WindowManager::operator*;409 mir::shell::WindowManager::operator*;
410 mir::shell::WindowManagerTools::operator*;
411 mir::shell::WindowManagerTools::?WindowManagerTools*;
412 mir::shell::WindowManagerTools::WindowManagerTools*;
349 mir::shell::WindowManager::?WindowManager*;413 mir::shell::WindowManager::?WindowManager*;
350 mir::shell::WindowManager::WindowManager*;414 mir::shell::WindowManager::WindowManager*;
351 mir::terminate_with_current_exception*;415 mir::terminate_with_current_exception*;
@@ -410,6 +474,7 @@
410 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::reception_mode_set_to*;474 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::reception_mode_set_to*;
411 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::renamed*;475 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::renamed*;
412 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::resized_to*;476 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::resized_to*;
477 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::start_drag_and_drop*;
413 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::transformation_set_to*;478 non-virtual?thunk?to?mir::scene::NullSurfaceObserver::transformation_set_to*;
414 non-virtual?thunk?to?mir::scene::Observer::?Observer*;479 non-virtual?thunk?to?mir::scene::Observer::?Observer*;
415 non-virtual?thunk?to?mir::scene::PromptSessionListener::?PromptSessionListener*;480 non-virtual?thunk?to?mir::scene::PromptSessionListener::?PromptSessionListener*;
@@ -422,6 +487,7 @@
422 non-virtual?thunk?to?mir::ServerStatusListener::?ServerStatusListener*;487 non-virtual?thunk?to?mir::ServerStatusListener::?ServerStatusListener*;
423 non-virtual?thunk?to?mir::shell::AbstractShell::add_display*;488 non-virtual?thunk?to?mir::shell::AbstractShell::add_display*;
424 non-virtual?thunk?to?mir::shell::AbstractShell::add_prompt_provider_for*;489 non-virtual?thunk?to?mir::shell::AbstractShell::add_prompt_provider_for*;
490 non-virtual?thunk?to?mir::shell::AbstractShell::clear_drag_and_drop_handle*;
425 non-virtual?thunk?to?mir::shell::AbstractShell::close_session*;491 non-virtual?thunk?to?mir::shell::AbstractShell::close_session*;
426 non-virtual?thunk?to?mir::shell::AbstractShell::create_surface*;492 non-virtual?thunk?to?mir::shell::AbstractShell::create_surface*;
427 non-virtual?thunk?to?mir::shell::AbstractShell::destroy_surface*;493 non-virtual?thunk?to?mir::shell::AbstractShell::destroy_surface*;
@@ -435,11 +501,52 @@
435 non-virtual?thunk?to?mir::shell::AbstractShell::raise*;501 non-virtual?thunk?to?mir::shell::AbstractShell::raise*;
436 non-virtual?thunk?to?mir::shell::AbstractShell::raise_surface*;502 non-virtual?thunk?to?mir::shell::AbstractShell::raise_surface*;
437 non-virtual?thunk?to?mir::shell::AbstractShell::remove_display*;503 non-virtual?thunk?to?mir::shell::AbstractShell::remove_display*;
504 non-virtual?thunk?to?mir::shell::AbstractShell::request_drag_and_drop*;
505 non-virtual?thunk?to?mir::shell::AbstractShell::request_move*;
506 non-virtual?thunk?to?mir::shell::AbstractShell::set_drag_and_drop_handle*;
438 non-virtual?thunk?to?mir::shell::AbstractShell::set_focus_to*;507 non-virtual?thunk?to?mir::shell::AbstractShell::set_focus_to*;
439 non-virtual?thunk?to?mir::shell::AbstractShell::set_surface_attribute*;508 non-virtual?thunk?to?mir::shell::AbstractShell::set_surface_attribute*;
440 non-virtual?thunk?to?mir::shell::AbstractShell::start_prompt_session_for*;509 non-virtual?thunk?to?mir::shell::AbstractShell::start_prompt_session_for*;
441 non-virtual?thunk?to?mir::shell::AbstractShell::stop_prompt_session*;510 non-virtual?thunk?to?mir::shell::AbstractShell::stop_prompt_session*;
442 non-virtual?thunk?to?mir::shell::AbstractShell::surface_at*;511 non-virtual?thunk?to?mir::shell::AbstractShell::surface_at*;
512 non-virtual?thunk?to?mir::shell::BasicWindowManager::active_display*;
513 non-virtual?thunk?to?mir::shell::BasicWindowManager::add_display*;
514 non-virtual?thunk?to?mir::shell::BasicWindowManager::add_session*;
515 non-virtual?thunk?to?mir::shell::BasicWindowManager::add_surface*;
516 non-virtual?thunk?to?mir::shell::BasicWindowManager::clear_drag_and_drop_handle*;
517 non-virtual?thunk?to?mir::shell::BasicWindowManager::find_session*;
518 non-virtual?thunk?to?mir::shell::BasicWindowManager::focused_session*;
519 non-virtual?thunk?to?mir::shell::BasicWindowManager::focused_surface*;
520 non-virtual?thunk?to?mir::shell::BasicWindowManager::focus_next_session*;
521 non-virtual?thunk?to?mir::shell::BasicWindowManager::forget*;
522 non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_keyboard_event*;
523 non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_pointer_event*;
524 non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_raise_surface*;
525 non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_drag_and_drop*;
526 non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_move*;
527 non-virtual?thunk?to?mir::shell::BasicWindowManager::handle_touch_event*;
528 non-virtual?thunk?to?mir::shell::BasicWindowManager::info_for*;
529 non-virtual?thunk?to?mir::shell::BasicWindowManager::modify_surface*;
530 non-virtual?thunk?to?mir::shell::BasicWindowManager::raise_tree*;
531 non-virtual?thunk?to?mir::shell::BasicWindowManager::remove_display*;
532 non-virtual?thunk?to?mir::shell::BasicWindowManager::remove_session*;
533 non-virtual?thunk?to?mir::shell::BasicWindowManager::remove_surface*;
534 non-virtual?thunk?to?mir::shell::BasicWindowManager::set_drag_and_drop_handle*;
535 non-virtual?thunk?to?mir::shell::BasicWindowManager::set_focus_to*;
536 non-virtual?thunk?to?mir::shell::BasicWindowManager::set_surface_attribute*;
537 non-virtual?thunk?to?mir::shell::BasicWindowManager::surface_at*;
538 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_delete_surface*;
539 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*;
540 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_keyboard_event*;
541 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_modify_surface*;
542 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_new_surface*;
543 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_place_new_surface*;
544 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_pointer_event*;
545 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_raise_surface*;
546 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_request_drag_and_drop*;
547 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*;
548 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_set_state*;
549 non-virtual?thunk?to?mir::shell::CanonicalWindowManagerPolicy::handle_touch_event*;
443 non-virtual?thunk?to?mir::shell::DisplayConfigurationController::?DisplayConfigurationController*;550 non-virtual?thunk?to?mir::shell::DisplayConfigurationController::?DisplayConfigurationController*;
444 non-virtual?thunk?to?mir::shell::DisplayLayout::?DisplayLayout*;551 non-virtual?thunk?to?mir::shell::DisplayLayout::?DisplayLayout*;
445 non-virtual?thunk?to?mir::shell::FocusController::?FocusController*;552 non-virtual?thunk?to?mir::shell::FocusController::?FocusController*;
@@ -449,6 +556,7 @@
449 non-virtual?thunk?to?mir::shell::ShellReport::?ShellReport*;556 non-virtual?thunk?to?mir::shell::ShellReport::?ShellReport*;
450 non-virtual?thunk?to?mir::shell::ShellWrapper::add_display*;557 non-virtual?thunk?to?mir::shell::ShellWrapper::add_display*;
451 non-virtual?thunk?to?mir::shell::ShellWrapper::add_prompt_provider_for*;558 non-virtual?thunk?to?mir::shell::ShellWrapper::add_prompt_provider_for*;
559 non-virtual?thunk?to?mir::shell::ShellWrapper::clear_drag_and_drop_handle*;
452 non-virtual?thunk?to?mir::shell::ShellWrapper::close_session*;560 non-virtual?thunk?to?mir::shell::ShellWrapper::close_session*;
453 non-virtual?thunk?to?mir::shell::ShellWrapper::create_surface*;561 non-virtual?thunk?to?mir::shell::ShellWrapper::create_surface*;
454 non-virtual?thunk?to?mir::shell::ShellWrapper::destroy_surface*;562 non-virtual?thunk?to?mir::shell::ShellWrapper::destroy_surface*;
@@ -462,6 +570,9 @@
462 non-virtual?thunk?to?mir::shell::ShellWrapper::raise*;570 non-virtual?thunk?to?mir::shell::ShellWrapper::raise*;
463 non-virtual?thunk?to?mir::shell::ShellWrapper::raise_surface*;571 non-virtual?thunk?to?mir::shell::ShellWrapper::raise_surface*;
464 non-virtual?thunk?to?mir::shell::ShellWrapper::remove_display*;572 non-virtual?thunk?to?mir::shell::ShellWrapper::remove_display*;
573 non-virtual?thunk?to?mir::shell::ShellWrapper::request_drag_and_drop*;
574 non-virtual?thunk?to?mir::shell::ShellWrapper::request_move*;
575 non-virtual?thunk?to?mir::shell::ShellWrapper::set_drag_and_drop_handle*;
465 non-virtual?thunk?to?mir::shell::ShellWrapper::set_focus_to*;576 non-virtual?thunk?to?mir::shell::ShellWrapper::set_focus_to*;
466 non-virtual?thunk?to?mir::shell::ShellWrapper::set_surface_attribute*;577 non-virtual?thunk?to?mir::shell::ShellWrapper::set_surface_attribute*;
467 non-virtual?thunk?to?mir::shell::ShellWrapper::start_prompt_session_for*;578 non-virtual?thunk?to?mir::shell::ShellWrapper::start_prompt_session_for*;
@@ -479,6 +590,8 @@
479 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_keyboard_event*;590 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_keyboard_event*;
480 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_pointer_event*;591 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_pointer_event*;
481 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_raise_surface*;592 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_raise_surface*;
593 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_request_drag_and_drop*;
594 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_request_move*;
482 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_touch_event*;595 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::handle_touch_event*;
483 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::modify_surface*;596 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::modify_surface*;
484 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::on_session_added*;597 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::on_session_added*;
@@ -488,6 +601,8 @@
488 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::remove_session*;601 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::remove_session*;
489 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::remove_surface*;602 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::remove_surface*;
490 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::set_surface_attribute*;603 non-virtual?thunk?to?mir::shell::SystemCompositorWindowManager::set_surface_attribute*;
604 non-virtual?thunk?to?mir::shell::WindowManagementPolicy::?WindowManagementPolicy*;
605 non-virtual?thunk?to?mir::shell::WindowManagerTools::?WindowManagerTools*;
491 non-virtual?thunk?to?mir::shell::WindowManager::?WindowManager*;606 non-virtual?thunk?to?mir::shell::WindowManager::?WindowManager*;
492 non-virtual?thunk?to?mir::time::Alarm::?Alarm*;607 non-virtual?thunk?to?mir::time::Alarm::?Alarm*;
493 non-virtual?thunk?to?mir::time::AlarmFactory::?AlarmFactory*;608 non-virtual?thunk?to?mir::time::AlarmFactory::?AlarmFactory*;
@@ -552,6 +667,8 @@
552 typeinfo?for?mir::ServerActionQueue;667 typeinfo?for?mir::ServerActionQueue;
553 typeinfo?for?mir::ServerStatusListener;668 typeinfo?for?mir::ServerStatusListener;
554 typeinfo?for?mir::shell::AbstractShell;669 typeinfo?for?mir::shell::AbstractShell;
670 typeinfo?for?mir::shell::BasicWindowManager;
671 typeinfo?for?mir::shell::CanonicalWindowManagerPolicy;
555 typeinfo?for?mir::shell::DisplayConfigurationController;672 typeinfo?for?mir::shell::DisplayConfigurationController;
556 typeinfo?for?mir::shell::DisplayLayout;673 typeinfo?for?mir::shell::DisplayLayout;
557 typeinfo?for?mir::shell::FocusController;674 typeinfo?for?mir::shell::FocusController;
@@ -559,18 +676,22 @@
559 typeinfo?for?mir::shell::InputTargeter;676 typeinfo?for?mir::shell::InputTargeter;
560 typeinfo?for?mir::shell::PersistentSurfaceStore;677 typeinfo?for?mir::shell::PersistentSurfaceStore;
561 typeinfo?for?mir::shell::PersistentSurfaceStore::Id;678 typeinfo?for?mir::shell::PersistentSurfaceStore::Id;
679 typeinfo?for?mir::shell::SessionInfo;
562 typeinfo?for?mir::shell::Shell;680 typeinfo?for?mir::shell::Shell;
563 typeinfo?for?mir::shell::ShellReport;681 typeinfo?for?mir::shell::ShellReport;
564 typeinfo?for?mir::shell::ShellWrapper;682 typeinfo?for?mir::shell::ShellWrapper;
565 typeinfo?for?mir::shell::StreamCursor;683 typeinfo?for?mir::shell::StreamCursor;
566 typeinfo?for?mir::shell::StreamSpecification;684 typeinfo?for?mir::shell::StreamSpecification;
567 typeinfo?for?mir::shell::SurfaceAspectRatio;685 typeinfo?for?mir::shell::SurfaceAspectRatio;
686 typeinfo?for?mir::shell::SurfaceInfo;
568 typeinfo?for?mir::shell::SurfaceReadyObserver;687 typeinfo?for?mir::shell::SurfaceReadyObserver;
569 typeinfo?for?mir::shell::SurfaceSpecification;688 typeinfo?for?mir::shell::SurfaceSpecification;
570 typeinfo?for?mir::shell::SurfaceStack;689 typeinfo?for?mir::shell::SurfaceStack;
571 typeinfo?for?mir::shell::SurfaceStackWrapper;690 typeinfo?for?mir::shell::SurfaceStackWrapper;
572 typeinfo?for?mir::shell::SystemCompositorWindowManager;691 typeinfo?for?mir::shell::SystemCompositorWindowManager;
692 typeinfo?for?mir::shell::WindowManagementPolicy;
573 typeinfo?for?mir::shell::WindowManager;693 typeinfo?for?mir::shell::WindowManager;
694 typeinfo?for?mir::shell::WindowManagerTools;
574 typeinfo?for?mir::time::Alarm;695 typeinfo?for?mir::time::Alarm;
575 typeinfo?for?mir::time::AlarmFactory;696 typeinfo?for?mir::time::AlarmFactory;
576 vtable?for?mir::compositor::Compositor;697 vtable?for?mir::compositor::Compositor;
@@ -634,6 +755,8 @@
634 vtable?for?mir::ServerActionQueue;755 vtable?for?mir::ServerActionQueue;
635 vtable?for?mir::ServerStatusListener;756 vtable?for?mir::ServerStatusListener;
636 vtable?for?mir::shell::AbstractShell;757 vtable?for?mir::shell::AbstractShell;
758 vtable?for?mir::shell::BasicWindowManager;
759 vtable?for?mir::shell::CanonicalWindowManagerPolicy;
637 vtable?for?mir::shell::DisplayConfigurationController;760 vtable?for?mir::shell::DisplayConfigurationController;
638 vtable?for?mir::shell::DisplayLayout;761 vtable?for?mir::shell::DisplayLayout;
639 vtable?for?mir::shell::FocusController;762 vtable?for?mir::shell::FocusController;
@@ -641,18 +764,22 @@
641 vtable?for?mir::shell::InputTargeter;764 vtable?for?mir::shell::InputTargeter;
642 vtable?for?mir::shell::PersistentSurfaceStore;765 vtable?for?mir::shell::PersistentSurfaceStore;
643 vtable?for?mir::shell::PersistentSurfaceStore::Id;766 vtable?for?mir::shell::PersistentSurfaceStore::Id;
767 vtable?for?mir::shell::SessionInfo;
644 vtable?for?mir::shell::Shell;768 vtable?for?mir::shell::Shell;
645 vtable?for?mir::shell::ShellReport;769 vtable?for?mir::shell::ShellReport;
646 vtable?for?mir::shell::ShellWrapper;770 vtable?for?mir::shell::ShellWrapper;
647 vtable?for?mir::shell::StreamCursor;771 vtable?for?mir::shell::StreamCursor;
648 vtable?for?mir::shell::StreamSpecification;772 vtable?for?mir::shell::StreamSpecification;
649 vtable?for?mir::shell::SurfaceAspectRatio;773 vtable?for?mir::shell::SurfaceAspectRatio;
774 vtable?for?mir::shell::SurfaceInfo;
650 vtable?for?mir::shell::SurfaceReadyObserver;775 vtable?for?mir::shell::SurfaceReadyObserver;
651 vtable?for?mir::shell::SurfaceSpecification;776 vtable?for?mir::shell::SurfaceSpecification;
652 vtable?for?mir::shell::SurfaceStack;777 vtable?for?mir::shell::SurfaceStack;
653 vtable?for?mir::shell::SurfaceStackWrapper;778 vtable?for?mir::shell::SurfaceStackWrapper;
654 vtable?for?mir::shell::SystemCompositorWindowManager;779 vtable?for?mir::shell::SystemCompositorWindowManager;
780 vtable?for?mir::shell::WindowManagementPolicy;
655 vtable?for?mir::shell::WindowManager;781 vtable?for?mir::shell::WindowManager;
782 vtable?for?mir::shell::WindowManagerTools;
656 vtable?for?mir::time::Alarm;783 vtable?for?mir::time::Alarm;
657 vtable?for?mir::time::AlarmFactory;784 vtable?for?mir::time::AlarmFactory;
658785
@@ -675,6 +802,21 @@
675 virtual?thunk?to?mir::shell::AbstractShell::setting_focus_to*;802 virtual?thunk?to?mir::shell::AbstractShell::setting_focus_to*;
676 virtual?thunk?to?mir::shell::AbstractShell::start_prompt_session_for*;803 virtual?thunk?to?mir::shell::AbstractShell::start_prompt_session_for*;
677 virtual?thunk?to?mir::shell::AbstractShell::stop_prompt_session*;804 virtual?thunk?to?mir::shell::AbstractShell::stop_prompt_session*;
805 virtual?thunk?to?mir::shell::BasicWindowManager::?BasicWindowManager*;
806 virtual?thunk?to?mir::shell::BasicWindowManager::add_display*;
807 virtual?thunk?to?mir::shell::BasicWindowManager::add_session*;
808 virtual?thunk?to?mir::shell::BasicWindowManager::add_surface*;
809 virtual?thunk?to?mir::shell::BasicWindowManager::handle_keyboard_event*;
810 virtual?thunk?to?mir::shell::BasicWindowManager::handle_pointer_event*;
811 virtual?thunk?to?mir::shell::BasicWindowManager::handle_raise_surface*;
812 virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_drag_and_drop*;
813 virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_move*;
814 virtual?thunk?to?mir::shell::BasicWindowManager::handle_touch_event*;
815 virtual?thunk?to?mir::shell::BasicWindowManager::modify_surface*;
816 virtual?thunk?to?mir::shell::BasicWindowManager::remove_display*;
817 virtual?thunk?to?mir::shell::BasicWindowManager::remove_session*;
818 virtual?thunk?to?mir::shell::BasicWindowManager::remove_surface*;
819 virtual?thunk?to?mir::shell::BasicWindowManager::set_surface_attribute*;
678 virtual?thunk?to?mir::shell::ShellWrapper::add_display*;820 virtual?thunk?to?mir::shell::ShellWrapper::add_display*;
679 virtual?thunk?to?mir::shell::ShellWrapper::handle*;821 virtual?thunk?to?mir::shell::ShellWrapper::handle*;
680 virtual?thunk?to?mir::shell::ShellWrapper::remove_display*;822 virtual?thunk?to?mir::shell::ShellWrapper::remove_display*;
@@ -686,25 +828,6 @@
686MIR_SERVER_DETAIL_FOR_TESTING_0.27 {828MIR_SERVER_DETAIL_FOR_TESTING_0.27 {
687 global:829 global:
688 extern "C++" {830 extern "C++" {
689 mir::shell::CanonicalWindowManagerPolicy::handle_set_state*;
690 mir::shell::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy*;
691 mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*;
692 mir::shell::CanonicalWindowManagerPolicy::handle_session_info_updated*;
693 mir::shell::CanonicalWindowManagerPolicy::handle_place_new_surface*;
694 mir::shell::CanonicalWindowManagerPolicy::handle_modify_surface*;
695 mir::shell::CanonicalWindowManagerPolicy::handle_new_surface*;
696 mir::shell::CanonicalWindowManagerPolicy::handle_delete_surface*;
697 mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*;
698 mir::shell::CanonicalWindowManagerPolicy::handle_displays_updated*;
699 mir::shell::CanonicalWindowManagerPolicy::handle_keyboard_event*;
700 mir::shell::CanonicalWindowManagerPolicy::handle_touch_event*;
701 mir::shell::CanonicalWindowManagerPolicy::handle_pointer_event*;
702 mir::shell::CanonicalWindowManagerPolicy::handle_raise_surface*;
703 mir::shell::CanonicalWindowManagerPolicy::handle_request_drag_and_drop*;
704 typeinfo?for?mir::shell::CanonicalWindowManagerPolicy;
705 vtable?for?mir::shell::CanonicalWindowManagerPolicy;
706 VTT?for?mir::shell::CanonicalWindowManagerPolicy;
707
708 mir::DefaultServerConfiguration::clock*;831 mir::DefaultServerConfiguration::clock*;
709 mir::DefaultServerConfiguration::DefaultServerConfiguration*;832 mir::DefaultServerConfiguration::DefaultServerConfiguration*;
710 mir::DefaultServerConfiguration::new_ipc_factory*;833 mir::DefaultServerConfiguration::new_ipc_factory*;
@@ -831,47 +954,5 @@
831 mir::renderer::gl::Renderer::vshader;954 mir::renderer::gl::Renderer::vshader;
832 typeinfo?for?mir::renderer::gl::Renderer;955 typeinfo?for?mir::renderer::gl::Renderer;
833 vtable?for?mir::renderer::gl::Renderer;956 vtable?for?mir::renderer::gl::Renderer;
834
835 mir::shell::BasicWindowManager::active_display*;
836 mir::shell::BasicWindowManager::add_display*;
837 mir::shell::BasicWindowManager::add_session*;
838 mir::shell::BasicWindowManager::add_surface*;
839 mir::shell::BasicWindowManager::BasicWindowManager*;
840 mir::shell::BasicWindowManager::clear_drag_and_drop_handle*;
841 mir::shell::BasicWindowManager::find_session*;
842 mir::shell::BasicWindowManager::focused_session*;
843 mir::shell::BasicWindowManager::focused_surface*;
844 mir::shell::BasicWindowManager::focus_next_session*;
845 mir::shell::BasicWindowManager::forget*;
846 mir::shell::BasicWindowManager::handle_keyboard_event*;
847 mir::shell::BasicWindowManager::handle_pointer_event*;
848 mir::shell::BasicWindowManager::handle_raise_surface*;
849 mir::shell::BasicWindowManager::handle_request_drag_and_drop*;
850 mir::shell::BasicWindowManager::handle_touch_event*;
851 mir::shell::BasicWindowManager::info_for*;
852 mir::shell::BasicWindowManager::modify_surface*;
853 mir::shell::BasicWindowManager::raise_tree*;
854 mir::shell::BasicWindowManager::remove_display*;
855 mir::shell::BasicWindowManager::remove_session*;
856 mir::shell::BasicWindowManager::remove_surface*;
857 mir::shell::BasicWindowManager::set_drag_and_drop_handle*;
858 mir::shell::BasicWindowManager::set_focus_to*;
859 mir::shell::BasicWindowManager::set_surface_attribute*;
860 mir::shell::BasicWindowManager::surface_at*;
861 typeinfo?for?mir::shell::BasicWindowManager;
862 virtual?thunk?to?mir::shell::BasicWindowManager::add_display*;
863 virtual?thunk?to?mir::shell::BasicWindowManager::add_session*;
864 virtual?thunk?to?mir::shell::BasicWindowManager::add_surface*;
865 virtual?thunk?to?mir::shell::BasicWindowManager::handle_keyboard_event*;
866 virtual?thunk?to?mir::shell::BasicWindowManager::handle_pointer_event*;
867 virtual?thunk?to?mir::shell::BasicWindowManager::handle_raise_surface*;
868 virtual?thunk?to?mir::shell::BasicWindowManager::handle_request_drag_and_drop*;
869 virtual?thunk?to?mir::shell::BasicWindowManager::handle_touch_event*;
870 virtual?thunk?to?mir::shell::BasicWindowManager::modify_surface*;
871 virtual?thunk?to?mir::shell::BasicWindowManager::remove_display*;
872 virtual?thunk?to?mir::shell::BasicWindowManager::remove_session*;
873 virtual?thunk?to?mir::shell::BasicWindowManager::remove_surface*;
874 virtual?thunk?to?mir::shell::BasicWindowManager::set_surface_attribute*;
875 VTT?for?mir::shell::BasicWindowManager;
876 };957 };
877} MIR_SERVER_DETAIL_FOR_TESTING_0.27;958} MIR_SERVER_DETAIL_FOR_TESTING_0.27;
878959
=== modified file 'tests/acceptance-tests/CMakeLists.txt'
--- tests/acceptance-tests/CMakeLists.txt 2017-03-24 10:16:59 +0000
+++ tests/acceptance-tests/CMakeLists.txt 2017-04-04 10:15:32 +0000
@@ -77,18 +77,10 @@
77# The following tests use still files we have chosen not to support in the public API77# The following tests use still files we have chosen not to support in the public API
78# TODO update these "throwback" tests to rely only on the public APIs78# TODO update these "throwback" tests to rely only on the public APIs
7979
80 # uses BasicWindowManager<>
81 set_source_files_properties(test_client_cursor_api.cpp PROPERTIES COMPILE_FLAGS
82 "${CMAKE_CXXFLAGS} -I ${PROJECT_SOURCE_DIR}/src/include/server")
83
84 # uses UsingClientPlatform80 # uses UsingClientPlatform
85 set_source_files_properties(test_client_library_errors.cpp PROPERTIES COMPILE_FLAGS81 set_source_files_properties(test_client_library_errors.cpp PROPERTIES COMPILE_FLAGS
86 "${CMAKE_CXXFLAGS} -I ${CMAKE_SOURCE_DIR}")82 "${CMAKE_CXXFLAGS} -I ${CMAKE_SOURCE_DIR}")
8783
88 # uses CanonicalWindowManager
89 set_source_files_properties(test_shell_control_of_surface_configuration.cpp PROPERTIES COMPILE_FLAGS
90 "${CMAKE_CXXFLAGS} -I ${PROJECT_SOURCE_DIR}/src/include/server")
91
92 # uses src/include/common/mir/protobuf/protocol_version.h84 # uses src/include/common/mir/protobuf/protocol_version.h
93 set_source_files_properties(test_client_library.cpp PROPERTIES COMPILE_FLAGS85 set_source_files_properties(test_client_library.cpp PROPERTIES COMPILE_FLAGS
94 "${CMAKE_CXXFLAGS} -I ${CMAKE_SOURCE_DIR}")86 "${CMAKE_CXXFLAGS} -I ${CMAKE_SOURCE_DIR}")
9587
=== modified file 'tests/acceptance-tests/client_mediated_user_gestures.cpp'
--- tests/acceptance-tests/client_mediated_user_gestures.cpp 2017-03-27 16:13:56 +0000
+++ tests/acceptance-tests/client_mediated_user_gestures.cpp 2017-04-04 10:15:32 +0000
@@ -22,12 +22,14 @@
22#include <mir/geometry/displacement.h>22#include <mir/geometry/displacement.h>
23#include <mir/input/input_device_info.h>23#include <mir/input/input_device_info.h>
24#include <mir/input/device_capability.h>24#include <mir/input/device_capability.h>
25#include <mir/shell/canonical_window_manager.h>
25#include <mir/shell/shell.h>26#include <mir/shell/shell.h>
2627
27#include <mir_test_framework/connected_client_with_a_window.h>28#include <mir_test_framework/connected_client_with_a_window.h>
28#include <mir_test_framework/fake_input_device.h>29#include <mir_test_framework/fake_input_device.h>
29#include <mir_test_framework/stub_server_platform_factory.h>30#include <mir_test_framework/stub_server_platform_factory.h>
30#include <mir/test/event_factory.h>31#include <mir/test/event_factory.h>
32#include <mir/test/fake_shared.h>
31#include <mir/test/signal.h>33#include <mir/test/signal.h>
3234
33#include <gmock/gmock.h>35#include <gmock/gmock.h>
@@ -40,6 +42,7 @@
40using namespace std::chrono_literals;42using namespace std::chrono_literals;
41using namespace mir::geometry;43using namespace mir::geometry;
42using namespace testing;44using namespace testing;
45using mir::test::fake_shared;
43using mir::test::Signal;46using mir::test::Signal;
4447
45namespace48namespace
@@ -67,6 +70,17 @@
6770
68void mir_cookie_release(Cookie const&) = delete;71void mir_cookie_release(Cookie const&) = delete;
6972
73#pragma GCC diagnostic push
74#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
75struct MockWindowManager : mir::shell::CanonicalWindowManager
76{
77 using mir::shell::CanonicalWindowManager::CanonicalWindowManager;
78
79 MOCK_METHOD3(handle_request_move,
80 void(std::shared_ptr<mir::scene::Session> const&, std::shared_ptr<mir::scene::Surface> const&, uint64_t));
81};
82#pragma GCC diagnostic pop
83
70struct MouseMoverAndFaker84struct MouseMoverAndFaker
71{85{
72 void start_dragging_mouse()86 void start_dragging_mouse()
@@ -103,6 +117,12 @@
103 void SetUp() override117 void SetUp() override
104 {118 {
105 initial_display_layout({screen_geometry});119 initial_display_layout({screen_geometry});
120 server.override_the_window_manager_builder([this](mir::shell::FocusController* focus_controller)
121 {
122 return window_manager =
123 std::make_shared<MockWindowManager>(focus_controller, server.the_shell_display_layout());
124 });
125
106 mir_test_framework::ConnectedClientWithAWindow::SetUp();126 mir_test_framework::ConnectedClientWithAWindow::SetUp();
107 mir_window_set_event_handler(window, &window_event_handler, this);127 mir_window_set_event_handler(window, &window_event_handler, this);
108128
@@ -114,11 +134,14 @@
114 void TearDown() override134 void TearDown() override
115 {135 {
116 reset_window_event_handler();136 reset_window_event_handler();
137 window_manager.reset();
117 mir_test_framework::ConnectedClientWithAWindow::TearDown();138 mir_test_framework::ConnectedClientWithAWindow::TearDown();
118 }139 }
119140
120 auto user_initiates_gesture() -> Cookie;141 auto user_initiates_gesture() -> Cookie;
121142
143 std::shared_ptr<MockWindowManager> window_manager;
144
122private:145private:
123 void center_mouse();146 void center_mouse();
124 void paint_window();147 void paint_window();
@@ -250,10 +273,13 @@
250 EXPECT_THAT(cookie.get(), NotNull());273 EXPECT_THAT(cookie.get(), NotNull());
251}274}
252275
253// TODO extend this test when server side implemented276TEST_F(ClientMediatedUserGestures, when_client_initiates_move_window_manager_handles_request)
254TEST_F(ClientMediatedUserGestures, when_client_initiates_move_nothing_bad_happens)
255{277{
256 auto const cookie = user_initiates_gesture();278 auto const cookie = user_initiates_gesture();
279 Signal have_request;
280 EXPECT_CALL(*window_manager, handle_request_move(_, _, _)).WillOnce(InvokeWithoutArgs([&]{ have_request.raise(); }));
257281
258 mir_window_request_user_move(window, cookie);282 mir_window_request_user_move(window, cookie);
283
284 EXPECT_THAT(have_request.wait_for(receive_event_timeout), Eq(true));
259}285}
260286
=== modified file 'tests/acceptance-tests/test_client_cursor_api.cpp'
--- tests/acceptance-tests/test_client_cursor_api.cpp 2017-03-15 09:30:18 +0000
+++ tests/acceptance-tests/test_client_cursor_api.cpp 2017-04-04 10:15:32 +0000
@@ -275,7 +275,10 @@
275275
276 server.override_the_window_manager_builder([this](msh::FocusController* focus_controller)276 server.override_the_window_manager_builder([this](msh::FocusController* focus_controller)
277 {277 {
278#pragma GCC diagnostic push
279#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
278 using PlacementWindowManager = msh::WindowManagerConstructor<mtf::DeclarativePlacementWindowManagerPolicy>;280 using PlacementWindowManager = msh::WindowManagerConstructor<mtf::DeclarativePlacementWindowManagerPolicy>;
281#pragma GCC diagnostic pop
279 return std::make_shared<PlacementWindowManager>(282 return std::make_shared<PlacementWindowManager>(
280 focus_controller,283 focus_controller,
281 client_geometries,284 client_geometries,
282285
=== modified file 'tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp'
--- tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp 2017-03-14 02:26:28 +0000
+++ tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp 2017-04-04 10:15:32 +0000
@@ -39,6 +39,8 @@
3939
40namespace40namespace
41{41{
42#pragma GCC diagnostic push
43#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
42struct MockWindowManager : msh::CanonicalWindowManager44struct MockWindowManager : msh::CanonicalWindowManager
43{45{
44 using msh::CanonicalWindowManager::CanonicalWindowManager;46 using msh::CanonicalWindowManager::CanonicalWindowManager;
@@ -57,6 +59,7 @@
57 return msh::CanonicalWindowManager::set_surface_attribute(session, surface, attrib, value);59 return msh::CanonicalWindowManager::set_surface_attribute(session, surface, attrib, value);
58 }60 }
59};61};
62#pragma GCC diagnostic pop
6063
61void signal_state_change(MirWindow*, MirEvent const* event, void* context)64void signal_state_change(MirWindow*, MirEvent const* event, void* context)
62{65{
6366
=== modified file 'tests/include/mir/test/doubles/mock_shell.h'
--- tests/include/mir/test/doubles/mock_shell.h 2017-03-08 12:34:11 +0000
+++ tests/include/mir/test/doubles/mock_shell.h 2017-04-04 10:15:32 +0000
@@ -73,8 +73,8 @@
73 MOCK_METHOD3(raise_surface, void(std::shared_ptr<frontend::Session> const& session,73 MOCK_METHOD3(raise_surface, void(std::shared_ptr<frontend::Session> const& session,
74 frontend::SurfaceId surface_id, uint64_t timestamp));74 frontend::SurfaceId surface_id, uint64_t timestamp));
7575
76 MOCK_METHOD3(request_drag_and_drop, void(std::shared_ptr<frontend::Session> const& session,76 MOCK_METHOD4(request_operation, void(std::shared_ptr<frontend::Session> const &session,
77 frontend::SurfaceId surface_id, uint64_t timestamp));77 frontend::SurfaceId surface_id, uint64_t timestamp, UserRequest request));
78};78};
7979
80}80}

Subscribers

People subscribed via source and target branches