Mir

Merge lp:~brandontschaefer/mir/update-pointer-confinement-v2 into lp:mir

Proposed by Brandon Schaefer
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3621
Proposed branch: lp:~brandontschaefer/mir/update-pointer-confinement-v2
Merge into: lp:mir
Diff against target: 1486 lines (+641/-86)
43 files modified
doc/component_reports.md (+1/-0)
include/server/mir/input/seat_report.h (+55/-0)
include/server/mir/scene/null_surface_observer.h (+0/-1)
include/server/mir/scene/surface_observer.h (+0/-1)
include/server/mir/server.h (+7/-0)
include/server/mir/shell/abstract_shell.h (+3/-1)
include/test/mir/test/doubles/mock_seat_report.h (+52/-0)
include/test/mir_test_framework/placement_applying_shell.h (+3/-0)
src/include/platform/mir/options/configuration.h (+1/-0)
src/include/server/mir/default_server_configuration.h (+3/-0)
src/include/server/mir/scene/surface_observers.h (+0/-1)
src/platform/options/default_configuration.cpp (+3/-0)
src/platform/symbols.map (+1/-0)
src/server/input/basic_seat.cpp (+10/-2)
src/server/input/basic_seat.h (+3/-1)
src/server/input/default_configuration.cpp (+2/-1)
src/server/input/seat_input_device_tracker.cpp (+37/-11)
src/server/input/seat_input_device_tracker.h (+9/-2)
src/server/report/default_server_configuration.cpp (+9/-0)
src/server/report/logging/CMakeLists.txt (+1/-0)
src/server/report/logging/logging_report_factory.cpp (+6/-0)
src/server/report/logging/seat_report.cpp (+146/-0)
src/server/report/logging/seat_report.h (+67/-0)
src/server/report/logging_report_factory.h (+1/-0)
src/server/report/lttng/lttng_report_factory.cpp (+5/-0)
src/server/report/lttng_report_factory.h (+1/-0)
src/server/report/null/CMakeLists.txt (+1/-0)
src/server/report/null/null_report_factory.cpp (+11/-0)
src/server/report/null/seat_report.cpp (+58/-0)
src/server/report/null/seat_report.h (+50/-0)
src/server/report/null_report_factory.h (+2/-0)
src/server/report/report_factory.h (+2/-0)
src/server/scene/basic_surface.cpp (+0/-21)
src/server/scene/legacy_surface_change_notification.cpp (+0/-4)
src/server/scene/legacy_surface_change_notification.h (+0/-1)
src/server/scene/null_surface_observer.cpp (+0/-1)
src/server/server.cpp (+1/-0)
src/server/shell/abstract_shell.cpp (+34/-12)
src/server/symbols.map (+1/-1)
tests/acceptance-tests/test_confined_pointer.cpp (+47/-23)
tests/integration-tests/input/test_single_seat_setup.cpp (+3/-1)
tests/mir_test_framework/placement_applying_shell.cpp (+1/-0)
tests/unit-tests/input/test_seat_input_device_tracker.cpp (+4/-1)
To merge this branch: bzr merge lp:~brandontschaefer/mir/update-pointer-confinement-v2
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Alan Griffiths Approve
Andreas Pokorny (community) Approve
Review via email: mp+301231@code.launchpad.net

Commit message

Use a different way to tell the abstract shell to update its seat.

Fixes a race in the test. We update the confinement on a resized_to or a move_to in the surface observer. The order is not guaranteed or rather most cases we are getting the callback in the test that we resized before the abstract shell. Leading to a race.

To fix this, we have implemented a seat report that will report when events are done. Now we can mock this and check we got this report. This will be good for normal logging. I will finish up the rest of the events for the seat report after this branch.

Description of the change

Use a different way to tell the abstract shell to update its seat.

Fixes a race in the test. We update the confinement on a resized_to or a move_to in the surface observer. The order is not guaranteed or rather most cases we are getting the callback in the test that we resized before the abstract shell. Leading to a race.

To fix this, we have implemented a seat report that will report when events are done. Now we can mock this and check we got this report. This will be good for normal logging. I will finish up the rest of the events for the seat report after this branch.

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

PASSED: Continuous integration, rev:3613
https://mir-jenkins.ubuntu.com/job/mir-ci/1351/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1609
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1662
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1653
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1653
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1653
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1624
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1624/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/1624
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1624/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/1624
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1624/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/1624
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1624/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/1624
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1624/artifact/output/*zip*/output.zip

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

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

+ // We get that a resized_to happened, but we've to wait a little bit for the seat to be updated from the
+ // observer it self. The order of the observers are not guaranteed
+ std::this_thread::sleep_for(1s);

We should use a Signal to avoid waiting longer than necessary. C.f. resized_signaled

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

> We should use a Signal to avoid waiting longer than necessary. C.f.
> resized_signaled

Oh. I misunderstood the problem. I still think there's a better way...

[goes to think]

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

OK, in the client API we are calling Client::handle_surface_event() so we can use that to signal that the resize has been seen by the client.

Moving the cursor only after this ought to give a strong enough ordering for the test to be stable.

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

Another thought: rather that repeatedly creating observers, just add a method to the shell and call that from the observer. The shell ought to know the current surface.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

+1 Not sure why i didnt think of that... quite a bit simpler...

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

PASSED: Continuous integration, rev:3614
https://mir-jenkins.ubuntu.com/job/mir-ci/1369/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1642
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1695
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1686
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1686
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1686
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1657/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/1657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1657/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/1657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1657/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/1657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1657/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/1657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1657/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:3615
https://mir-jenkins.ubuntu.com/job/mir-ci/1370/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1643
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1696
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1687
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1687
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1687
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1658/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/1658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1658/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/1658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1658/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/1658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1658/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/1658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1658/artifact/output/*zip*/output.zip

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

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

I do like the idea of a seat report as these events can be helpful in understanding system behaviour but:

1. I think it ought to report all the seat "events", not just confinement region.
2. I think the default should be a NullObject
3. Logging output ought to be a command-line option (as with other reports)
4. I don't know if the events are worth including in LTTNG

review: Needs Fixing
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

1) I agree, I was planning on adding them after this branch (its gotten larger)
2 & 3) I think thats what this does:
+ return report_factory(options::input_report_opt)->create_seat_report();
Which turns out to be a bug and i need to make my own :)
4) Sounds reasonable... Will look at removing that.

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

PASSED: Continuous integration, rev:3618
https://mir-jenkins.ubuntu.com/job/mir-ci/1375/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1654
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1707
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1698
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1698
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1698
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1669/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/1669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1669/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/1669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1669/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/1669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1669/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/1669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1669/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Yes I would also like to see the reports for the other events.
There is also a doc/component_reports.md that needs updating.

looks good otherwise.

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

FAILED: Continuous integration, rev:3619
https://mir-jenkins.ubuntu.com/job/mir-ci/1376/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1655/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1708
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1699
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1699
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1699
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1670
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1670/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/1670
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1670/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/1670
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1670/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/1670
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1670/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1670/console

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Not sure whether the request for a serialized device state is a relevant event to report..

but otherwise looks good to me.

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

+std::string rectangle_to_string(geom::Rectangle const& rect)
+{
+ std::stringstream ss;
+ ss << "{"
+ << rect.top_left.x.as_int() << ", "
+ << rect.top_left.y.as_int() << ", "
+ << rect.size.width.as_int() << ", "
+ << rect.size.height.as_int()
+ << "}";
+
+ return ss.str();
+}
...
+ << " out_rect=" << rectangle_to_string(out_rect);

We have std::ostream& operator<<(std::ostream& out, Rectangle const& value); in /usr/include/mircommon/mir/geometry/rectangle.h. So all the above could be:

  << " out_rect=" << out_rect;

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

> 1) I agree, I was planning on adding them after this branch (its gotten
> larger)

The way I deal with this kind of design issue is to split out the report as a prerequisite MP.

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

FAILED: Continuous integration, rev:3620
https://mir-jenkins.ubuntu.com/job/mir-ci/1384/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1665/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1718
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1709
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1709
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1709
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1680
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1680/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1680/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1680
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1680/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/1680
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1680/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/1680
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1680/artifact/output/*zip*/output.zip

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

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

OK

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

PASSED: Continuous integration, rev:3620
https://mir-jenkins.ubuntu.com/job/mir-ci/1388/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1670
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1723
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1714
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1714
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1714
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1686
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1686/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/1686
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1686/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/1686
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/1686/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/1686
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1686/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/1686
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1686/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/1686
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1686/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/component_reports.md'
--- doc/component_reports.md 2015-04-28 07:54:10 +0000
+++ doc/component_reports.md 2016-08-01 21:28:24 +0000
@@ -23,6 +23,7 @@
23display-report | log,lttng23display-report | log,lttng
24input-report | log,lttng24input-report | log,lttng
25legacy-input-report | log25legacy-input-report | log
26seat-report | log
26msg-processor-report | log,lttng27msg-processor-report | log,lttng
27session-mediator-report | log,lttng28session-mediator-report | log,lttng
28scene-report | log,lttng29scene-report | log,lttng
2930
=== added file 'include/server/mir/input/seat_report.h'
--- include/server/mir/input/seat_report.h 1970-01-01 00:00:00 +0000
+++ include/server/mir/input/seat_report.h 2016-08-01 21:28:24 +0000
@@ -0,0 +1,55 @@
1/*
2 * Copyright © 2016 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: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */
18
19
20#ifndef MIR_INPUT_SEAT_REPORT_H_
21#define MIR_INPUT_SEAT_REPORT_H_
22
23#include <string>
24#include <vector>
25
26class MirEvent;
27
28namespace mir
29{
30namespace geometry
31{
32class Rectangles;
33class Rectangle;
34}
35namespace input
36{
37class SeatReport
38{
39public:
40 virtual ~SeatReport() = default;
41
42 virtual void seat_add_device(uint64_t id) = 0;
43 virtual void seat_remove_device(uint64_t id) = 0;
44 virtual void seat_dispatch_event(MirEvent const& event) = 0;
45 virtual void seat_get_rectangle_for(uint64_t id, geometry::Rectangle const& out_rect) = 0;
46 virtual void seat_set_key_state(uint64_t id, std::vector<uint32_t> const& scan_codes) = 0;
47 virtual void seat_set_pointer_state(uint64_t id, unsigned buttons) = 0;
48 virtual void seat_set_cursor_position(float cursor_x, float cursor_y) = 0;
49 virtual void seat_set_confinement_region_called(geometry::Rectangles const& regions) = 0;
50 virtual void seat_reset_confinement_regions() = 0;
51};
52}
53}
54
55#endif /* MIR_INPUT_SEAT_REPORT_H_ */
056
=== modified file 'include/server/mir/scene/null_surface_observer.h'
--- include/server/mir/scene/null_surface_observer.h 2016-07-26 03:56:14 +0000
+++ include/server/mir/scene/null_surface_observer.h 2016-08-01 21:28:24 +0000
@@ -45,7 +45,6 @@
45 void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout, std::string const& variant, std::string const& options) override;45 void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout, std::string const& variant, std::string const& options) override;
46 void renamed(char const* name) override;46 void renamed(char const* name) override;
47 void cursor_image_removed() override;47 void cursor_image_removed() override;
48 void confinement_region_updated(geometry::Rectangle const& rect) override;
4948
50protected:49protected:
51 NullSurfaceObserver(NullSurfaceObserver const&) = delete;50 NullSurfaceObserver(NullSurfaceObserver const&) = delete;
5251
=== modified file 'include/server/mir/scene/surface_observer.h'
--- include/server/mir/scene/surface_observer.h 2016-07-26 03:56:14 +0000
+++ include/server/mir/scene/surface_observer.h 2016-08-01 21:28:24 +0000
@@ -60,7 +60,6 @@
60 std::string const& variant, std::string const& options) = 0;60 std::string const& variant, std::string const& options) = 0;
61 virtual void renamed(char const* name) = 0;61 virtual void renamed(char const* name) = 0;
62 virtual void cursor_image_removed() = 0;62 virtual void cursor_image_removed() = 0;
63 virtual void confinement_region_updated(geometry::Rectangle const& rect) = 0;
6463
65protected:64protected:
66 SurfaceObserver() = default;65 SurfaceObserver() = default;
6766
=== modified file 'include/server/mir/server.h'
--- include/server/mir/server.h 2016-07-20 04:54:07 +0000
+++ include/server/mir/server.h 2016-08-01 21:28:24 +0000
@@ -61,6 +61,10 @@
61class SurfaceFactory;61class SurfaceFactory;
62class CoordinateTranslator;62class CoordinateTranslator;
63}63}
64namespace input
65{
66class SeatReport;
67}
6468
65class Fd;69class Fd;
66class MainLoop;70class MainLoop;
@@ -283,6 +287,9 @@
283 /// Sets an override functor for creating the session mediator report.287 /// Sets an override functor for creating the session mediator report.
284 void override_the_session_mediator_report(Builder<frontend::SessionMediatorReport> const& session_mediator_builder);288 void override_the_session_mediator_report(Builder<frontend::SessionMediatorReport> const& session_mediator_builder);
285289
290 /// Sets an override functor for creating the seat report.
291 void override_the_seat_report(Builder<input::SeatReport> const& seat_report_builder);
292
286 /// Sets an override functor for creating the shell.293 /// Sets an override functor for creating the shell.
287 void override_the_shell(Builder<shell::Shell> const& wrapper);294 void override_the_shell(Builder<shell::Shell> const& wrapper);
288295
289296
=== modified file 'include/server/mir/shell/abstract_shell.h'
--- include/server/mir/shell/abstract_shell.h 2016-07-26 03:56:14 +0000
+++ include/server/mir/shell/abstract_shell.h 2016-08-01 21:28:24 +0000
@@ -122,6 +122,8 @@
122122
123 bool handle(MirEvent const& event) override;123 bool handle(MirEvent const& event) override;
124124
125 void update_focused_surface_confined_region();
126
125protected:127protected:
126 std::shared_ptr<InputTargeter> const input_targeter;128 std::shared_ptr<InputTargeter> const input_targeter;
127 std::shared_ptr<SurfaceStack> const surface_stack;129 std::shared_ptr<SurfaceStack> const surface_stack;
@@ -136,7 +138,7 @@
136 std::mutex mutable focus_mutex;138 std::mutex mutable focus_mutex;
137 std::weak_ptr<scene::Surface> focus_surface;139 std::weak_ptr<scene::Surface> focus_surface;
138 std::weak_ptr<scene::Session> focus_session;140 std::weak_ptr<scene::Session> focus_session;
139 std::shared_ptr<scene::SurfaceObserver> const focus_surface_observer;141 std::shared_ptr<scene::SurfaceObserver> focus_surface_observer;
140142
141 void set_focus_to_locked(143 void set_focus_to_locked(
142 std::unique_lock<std::mutex> const& lock,144 std::unique_lock<std::mutex> const& lock,
143145
=== added file 'include/test/mir/test/doubles/mock_seat_report.h'
--- include/test/mir/test/doubles/mock_seat_report.h 1970-01-01 00:00:00 +0000
+++ include/test/mir/test/doubles/mock_seat_report.h 2016-08-01 21:28:24 +0000
@@ -0,0 +1,52 @@
1/*
2 * Copyright © 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * 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: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */
18
19#ifndef MIR_TEST_DOUBLES_MOCK_SEAT_REPORT_H_
20#define MIR_TEST_DOUBLES_MOCK_SEAT_REPORT_H_
21
22#include "mir/input/seat_report.h"
23#include <gmock/gmock.h>
24
25class MirEvent;
26
27namespace mir
28{
29namespace test
30{
31namespace doubles
32{
33
34class MockSeatReport : public input::SeatReport
35{
36public:
37 MOCK_METHOD1(seat_add_device, void(uint64_t /*id*/));
38 MOCK_METHOD1(seat_remove_device, void(uint64_t /*id*/));
39 MOCK_METHOD1(seat_dispatch_event, void(MirEvent const& /*event*/));
40 MOCK_METHOD2(seat_get_rectangle_for, void(uint64_t /*id*/, geometry::Rectangle const& /*out_rect*/));
41 MOCK_METHOD2(seat_set_key_state, void(uint64_t /*id*/, std::vector<uint32_t> const& /*scan_codes*/));
42 MOCK_METHOD2(seat_set_pointer_state, void(uint64_t /*id*/, unsigned /*buttons*/));
43 MOCK_METHOD2(seat_set_cursor_position, void(float /*cursor_x*/, float /*cursor_y*/));
44 MOCK_METHOD1(seat_set_confinement_region_called, void(geometry::Rectangles const& /*regions*/));
45 MOCK_METHOD0(seat_reset_confinement_regions, void());
46};
47
48}
49}
50}
51
52#endif /* MIR_TEST_DOUBLES_MOCK_SEAT_REPORT_H_ */
053
=== modified file 'include/test/mir_test_framework/placement_applying_shell.h'
--- include/test/mir_test_framework/placement_applying_shell.h 2016-05-03 06:55:25 +0000
+++ include/test/mir_test_framework/placement_applying_shell.h 2016-08-01 21:28:24 +0000
@@ -56,6 +56,9 @@
56 mir::shell::SurfaceSpecification const& modifications) override;56 mir::shell::SurfaceSpecification const& modifications) override;
5757
58 bool wait_for_modify_surface(std::chrono::seconds timeout);58 bool wait_for_modify_surface(std::chrono::seconds timeout);
59
60 std::weak_ptr <mir::scene::Surface> latest_surface;
61
59private:62private:
60 ClientInputRegions const& client_input_regions;63 ClientInputRegions const& client_input_regions;
61 ClientPositions const& client_positions;64 ClientPositions const& client_positions;
6265
=== modified file 'src/include/platform/mir/options/configuration.h'
--- src/include/platform/mir/options/configuration.h 2016-07-07 11:14:26 +0000
+++ src/include/platform/mir/options/configuration.h 2016-08-01 21:28:24 +0000
@@ -42,6 +42,7 @@
42extern char const* const connector_report_opt;42extern char const* const connector_report_opt;
43extern char const* const scene_report_opt;43extern char const* const scene_report_opt;
44extern char const* const input_report_opt;44extern char const* const input_report_opt;
45extern char const* const seat_report_opt;
45extern char const* const host_socket_opt;46extern char const* const host_socket_opt;
46extern char const* const frontend_threads_opt;47extern char const* const frontend_threads_opt;
47extern char const* const touchspots_opt;48extern char const* const touchspots_opt;
4849
=== modified file 'src/include/server/mir/default_server_configuration.h'
--- src/include/server/mir/default_server_configuration.h 2016-07-20 04:54:07 +0000
+++ src/include/server/mir/default_server_configuration.h 2016-08-01 21:28:24 +0000
@@ -122,6 +122,7 @@
122namespace input122namespace input
123{123{
124class InputReport;124class InputReport;
125class SeatReport;
125class Scene;126class Scene;
126class InputManager;127class InputManager;
127class SurfaceInputDispatcher;128class SurfaceInputDispatcher;
@@ -302,6 +303,7 @@
302 /** @name input configuration303 /** @name input configuration
303 * @{ */304 * @{ */
304 virtual std::shared_ptr<input::InputReport> the_input_report();305 virtual std::shared_ptr<input::InputReport> the_input_report();
306 virtual std::shared_ptr<input::SeatReport> the_seat_report();
305 virtual std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter();307 virtual std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter();
306308
307 virtual std::shared_ptr<input::EventFilterChainDispatcher> the_event_filter_chain_dispatcher();309 virtual std::shared_ptr<input::EventFilterChainDispatcher> the_event_filter_chain_dispatcher();
@@ -366,6 +368,7 @@
366 CachedPtr<frontend::Connector> prompt_connector;368 CachedPtr<frontend::Connector> prompt_connector;
367369
368 CachedPtr<input::InputReport> input_report;370 CachedPtr<input::InputReport> input_report;
371 CachedPtr<input::SeatReport> seat_report;
369 CachedPtr<input::EventFilterChainDispatcher> event_filter_chain_dispatcher;372 CachedPtr<input::EventFilterChainDispatcher> event_filter_chain_dispatcher;
370 CachedPtr<input::CompositeEventFilter> composite_event_filter;373 CachedPtr<input::CompositeEventFilter> composite_event_filter;
371 CachedPtr<input::InputManager> input_manager;374 CachedPtr<input::InputManager> input_manager;
372375
=== modified file 'src/include/server/mir/scene/surface_observers.h'
--- src/include/server/mir/scene/surface_observers.h 2016-07-26 03:56:14 +0000
+++ src/include/server/mir/scene/surface_observers.h 2016-08-01 21:28:24 +0000
@@ -49,7 +49,6 @@
49 std::string const& variant, std::string const& options) override;49 std::string const& variant, std::string const& options) override;
50 void renamed(char const*) override;50 void renamed(char const*) override;
51 void cursor_image_removed() override;51 void cursor_image_removed() override;
52 void confinement_region_updated(geometry::Rectangle const& rect) override;
53};52};
5453
55}54}
5655
=== modified file 'src/platform/options/default_configuration.cpp'
--- src/platform/options/default_configuration.cpp 2016-07-07 11:14:26 +0000
+++ src/platform/options/default_configuration.cpp 2016-08-01 21:28:24 +0000
@@ -40,6 +40,7 @@
40char const* const mo::connector_report_opt = "connector-report";40char const* const mo::connector_report_opt = "connector-report";
41char const* const mo::scene_report_opt = "scene-report";41char const* const mo::scene_report_opt = "scene-report";
42char const* const mo::input_report_opt = "input-report";42char const* const mo::input_report_opt = "input-report";
43char const* const mo::seat_report_opt = "seat-report";
43char const* const mo::shared_library_prober_report_opt = "shared-library-prober-report";44char const* const mo::shared_library_prober_report_opt = "shared-library-prober-report";
44char const* const mo::shell_report_opt = "shell-report";45char const* const mo::shell_report_opt = "shell-report";
45char const* const mo::host_socket_opt = "host-socket";46char const* const mo::host_socket_opt = "host-socket";
@@ -161,6 +162,8 @@
161 "How to handle to Input report. [{log,lttng,off}]")162 "How to handle to Input report. [{log,lttng,off}]")
162 (legacy_input_report_opt, po::value<std::string>()->default_value(off_opt_value),163 (legacy_input_report_opt, po::value<std::string>()->default_value(off_opt_value),
163 "How to handle the Legacy Input report. [{log,off}]")164 "How to handle the Legacy Input report. [{log,off}]")
165 (seat_report_opt, po::value<std::string>()->default_value(off_opt_value),
166 "How to handle to Seat report. [{log,off}]")
164 (session_mediator_report_opt, po::value<std::string>()->default_value(off_opt_value),167 (session_mediator_report_opt, po::value<std::string>()->default_value(off_opt_value),
165 "How to handle the SessionMediator report. [{log,lttng,off}]")168 "How to handle the SessionMediator report. [{log,lttng,off}]")
166 (msg_processor_report_opt, po::value<std::string>()->default_value(off_opt_value),169 (msg_processor_report_opt, po::value<std::string>()->default_value(off_opt_value),
167170
=== modified file 'src/platform/symbols.map'
--- src/platform/symbols.map 2016-08-01 09:37:45 +0000
+++ src/platform/symbols.map 2016-08-01 21:28:24 +0000
@@ -124,6 +124,7 @@
124 mir::options::host_socket_opt*;124 mir::options::host_socket_opt*;
125 mir::options::input_report_opt*;125 mir::options::input_report_opt*;
126 mir::options::legacy_input_report_opt*;126 mir::options::legacy_input_report_opt*;
127 mir::options::seat_report_opt*;
127 mir::options::log_opt_value*;128 mir::options::log_opt_value*;
128 mir::options::lttng_opt_value*;129 mir::options::lttng_opt_value*;
129 mir::options::msg_processor_report_opt*;130 mir::options::msg_processor_report_opt*;
130131
=== modified file 'src/server/input/basic_seat.cpp'
--- src/server/input/basic_seat.cpp 2016-07-01 20:32:34 +0000
+++ src/server/input/basic_seat.cpp 2016-08-01 21:28:24 +0000
@@ -31,8 +31,16 @@
31 std::shared_ptr<mi::CursorListener> const& cursor_listener,31 std::shared_ptr<mi::CursorListener> const& cursor_listener,
32 std::shared_ptr<mi::InputRegion> const& input_region,32 std::shared_ptr<mi::InputRegion> const& input_region,
33 std::shared_ptr<mi::KeyMapper> const& key_mapper,33 std::shared_ptr<mi::KeyMapper> const& key_mapper,
34 std::shared_ptr<time::Clock> const& clock)34 std::shared_ptr<time::Clock> const& clock,
35 : input_state_tracker{dispatcher, touch_visualizer, cursor_listener, input_region, key_mapper, clock}, input_region{input_region}35 std::shared_ptr<mi::SeatReport> const& report) :
36 input_state_tracker{dispatcher,
37 touch_visualizer,
38 cursor_listener,
39 input_region,
40 key_mapper,
41 clock,
42 report},
43 input_region{input_region}
36{44{
37}45}
3846
3947
=== modified file 'src/server/input/basic_seat.h'
--- src/server/input/basic_seat.h 2016-07-01 20:32:34 +0000
+++ src/server/input/basic_seat.h 2016-08-01 21:28:24 +0000
@@ -39,6 +39,7 @@
39class InputRegion;39class InputRegion;
40class InputDispatcher;40class InputDispatcher;
41class KeyMapper;41class KeyMapper;
42class SeatReport;
4243
43class BasicSeat : public Seat44class BasicSeat : public Seat
44{45{
@@ -48,7 +49,8 @@
48 std::shared_ptr<CursorListener> const& cursor_listener,49 std::shared_ptr<CursorListener> const& cursor_listener,
49 std::shared_ptr<InputRegion> const& input_region,50 std::shared_ptr<InputRegion> const& input_region,
50 std::shared_ptr<KeyMapper> const& key_mapper,51 std::shared_ptr<KeyMapper> const& key_mapper,
51 std::shared_ptr<time::Clock> const& clock);52 std::shared_ptr<time::Clock> const& clock,
53 std::shared_ptr<SeatReport> const& report);
52 // Seat methods:54 // Seat methods:
53 void add_device(Device const& device) override;55 void add_device(Device const& device) override;
54 void remove_device(Device const& device) override;56 void remove_device(Device const& device) override;
5557
=== modified file 'src/server/input/default_configuration.cpp'
--- src/server/input/default_configuration.cpp 2016-06-03 08:39:59 +0000
+++ src/server/input/default_configuration.cpp 2016-08-01 21:28:24 +0000
@@ -333,7 +333,8 @@
333 the_cursor_listener(),333 the_cursor_listener(),
334 the_input_region(),334 the_input_region(),
335 the_key_mapper(),335 the_key_mapper(),
336 the_clock());336 the_clock(),
337 the_seat_report());
337 });338 });
338}339}
339340
340341
=== modified file 'src/server/input/seat_input_device_tracker.cpp'
--- src/server/input/seat_input_device_tracker.cpp 2016-07-01 20:32:34 +0000
+++ src/server/input/seat_input_device_tracker.cpp 2016-08-01 21:28:24 +0000
@@ -23,6 +23,7 @@
23#include "mir/input/input_region.h"23#include "mir/input/input_region.h"
24#include "mir/input/input_dispatcher.h"24#include "mir/input/input_dispatcher.h"
25#include "mir/input/key_mapper.h"25#include "mir/input/key_mapper.h"
26#include "mir/input/seat_report.h"
26#include "mir/geometry/displacement.h"27#include "mir/geometry/displacement.h"
27#include "mir/events/event_builders.h"28#include "mir/events/event_builders.h"
28#include "mir/events/event_private.h"29#include "mir/events/event_private.h"
@@ -46,16 +47,17 @@
46 std::shared_ptr<CursorListener> const& cursor_listener,47 std::shared_ptr<CursorListener> const& cursor_listener,
47 std::shared_ptr<InputRegion> const& input_region,48 std::shared_ptr<InputRegion> const& input_region,
48 std::shared_ptr<KeyMapper> const& key_mapper,49 std::shared_ptr<KeyMapper> const& key_mapper,
49 std::shared_ptr<time::Clock> const& clock)50 std::shared_ptr<time::Clock> const& clock,
51 std::shared_ptr<SeatReport> const& report)
50 : dispatcher{dispatcher}, touch_visualizer{touch_visualizer}, cursor_listener{cursor_listener},52 : dispatcher{dispatcher}, touch_visualizer{touch_visualizer}, cursor_listener{cursor_listener},
51 input_region{input_region}, key_mapper{key_mapper}, clock{clock}, buttons{0},53 input_region{input_region}, key_mapper{key_mapper}, clock{clock}, report{report}, buttons{0}
52 confine_function{[input_region](mir::geometry::Point& pos) { input_region->confine(pos); }}
53{54{
54}55}
5556
56void mi::SeatInputDeviceTracker::add_device(MirInputDeviceId id)57void mi::SeatInputDeviceTracker::add_device(MirInputDeviceId id)
57{58{
58 device_data[id];59 device_data[id];
60 report->seat_add_device(id);
59}61}
6062
61void mi::SeatInputDeviceTracker::remove_device(MirInputDeviceId id)63void mi::SeatInputDeviceTracker::remove_device(MirInputDeviceId id)
@@ -75,6 +77,8 @@
75 update_states();77 update_states();
76 if (spot_update_needed)78 if (spot_update_needed)
77 update_spots();79 update_spots();
80
81 report->seat_remove_device(id);
78}82}
7983
80void mi::SeatInputDeviceTracker::dispatch(MirEvent &event)84void mi::SeatInputDeviceTracker::dispatch(MirEvent &event)
@@ -99,6 +103,7 @@
99 }103 }
100104
101 dispatcher->dispatch(event);105 dispatcher->dispatch(event);
106 report->seat_dispatch_event(event);
102}107}
103108
104bool mi::SeatInputDeviceTracker::filter_input_event(MirInputEvent const* event)109bool mi::SeatInputDeviceTracker::filter_input_event(MirInputEvent const* event)
@@ -201,16 +206,23 @@
201206
202void mi::SeatInputDeviceTracker::set_confinement_regions(geometry::Rectangles const& regions)207void mi::SeatInputDeviceTracker::set_confinement_regions(geometry::Rectangles const& regions)
203{208{
204 confine_function = [regions, this](mir::geometry::Point& pos)209 std::lock_guard<std::mutex> lg(region_mutex);
205 {210 confined_region = regions;
206 input_region->confine(pos);211 report->seat_set_confinement_region_called(regions);
207 regions.confine(pos);
208 };
209}212}
210213
211void mi::SeatInputDeviceTracker::reset_confinement_regions()214void mi::SeatInputDeviceTracker::reset_confinement_regions()
212{215{
213 confine_function = [this](mir::geometry::Point& pos) { input_region->confine(pos); };216 std::lock_guard<std::mutex> lg(region_mutex);
217 confined_region.clear();
218 report->seat_reset_confinement_regions();
219}
220
221void mi::SeatInputDeviceTracker::confine_function(mir::geometry::Point& p) const
222{
223 std::lock_guard<std::mutex> lg(region_mutex);
224 input_region->confine(p);
225 confined_region.confine(p);
214}226}
215227
216void mi::SeatInputDeviceTracker::confine_pointer()228void mi::SeatInputDeviceTracker::confine_pointer()
@@ -238,8 +250,16 @@
238 devices.reserve(device_data.size());250 devices.reserve(device_data.size());
239 for (auto const& item : device_data)251 for (auto const& item : device_data)
240 devices.push_back({item.first, item.second.scan_codes, item.second.buttons});252 devices.push_back({item.first, item.second.scan_codes, item.second.buttons});
241 return mev::make_event(253
242 clock->now().time_since_epoch(), buttons, key_mapper->modifiers(), cursor_x, cursor_y, std::move(devices));254 auto out_ev = mev::make_event(
255 clock->now().time_since_epoch(),
256 buttons,
257 key_mapper->modifiers(),
258 cursor_x,
259 cursor_y,
260 std::move(devices));
261
262 return out_ev;
243}263}
244264
245void mi::SeatInputDeviceTracker::DeviceData::update_scan_codes(MirKeyboardEvent const* event)265void mi::SeatInputDeviceTracker::DeviceData::update_scan_codes(MirKeyboardEvent const* event)
@@ -260,6 +280,8 @@
260280
261 if (device != end(device_data))281 if (device != end(device_data))
262 device->second.scan_codes = scan_codes;282 device->second.scan_codes = scan_codes;
283
284 report->seat_set_key_state(id, scan_codes);
263}285}
264286
265void mi::SeatInputDeviceTracker::set_pointer_state(MirInputDeviceId id, MirPointerButtons buttons)287void mi::SeatInputDeviceTracker::set_pointer_state(MirInputDeviceId id, MirPointerButtons buttons)
@@ -268,12 +290,16 @@
268290
269 if (device != end(device_data))291 if (device != end(device_data))
270 device->second.update_button_state(buttons);292 device->second.update_button_state(buttons);
293
294 report->seat_set_pointer_state(id, buttons);
271}295}
272296
273void mi::SeatInputDeviceTracker::set_cursor_position(float x, float y)297void mi::SeatInputDeviceTracker::set_cursor_position(float x, float y)
274{298{
275 cursor_x = x;299 cursor_x = x;
276 cursor_y = y;300 cursor_y = y;
301
302 report->seat_set_cursor_position(x, y);
277}303}
278304
279bool mi::SeatInputDeviceTracker::DeviceData::allowed_scan_code_action(MirKeyboardEvent const* event) const305bool mi::SeatInputDeviceTracker::DeviceData::allowed_scan_code_action(MirKeyboardEvent const* event) const
280306
=== modified file 'src/server/input/seat_input_device_tracker.h'
--- src/server/input/seat_input_device_tracker.h 2016-07-01 20:32:34 +0000
+++ src/server/input/seat_input_device_tracker.h 2016-08-01 21:28:24 +0000
@@ -26,6 +26,7 @@
26#include "mir_toolkit/event.h"26#include "mir_toolkit/event.h"
27#include <unordered_map>27#include <unordered_map>
28#include <memory>28#include <memory>
29#include <mutex>
2930
30namespace mir31namespace mir
31{32{
@@ -40,6 +41,7 @@
40class InputRegion;41class InputRegion;
41class InputDispatcher;42class InputDispatcher;
42class KeyMapper;43class KeyMapper;
44class SeatReport;
4345
44/*46/*
45 * The SeatInputDeviceTracker bundles the input device properties of a group of devices defined by a seat:47 * The SeatInputDeviceTracker bundles the input device properties of a group of devices defined by a seat:
@@ -56,7 +58,8 @@
56 std::shared_ptr<CursorListener> const& cursor_listener,58 std::shared_ptr<CursorListener> const& cursor_listener,
57 std::shared_ptr<InputRegion> const& input_region,59 std::shared_ptr<InputRegion> const& input_region,
58 std::shared_ptr<KeyMapper> const& key_mapper,60 std::shared_ptr<KeyMapper> const& key_mapper,
59 std::shared_ptr<time::Clock> const& clock);61 std::shared_ptr<time::Clock> const& clock,
62 std::shared_ptr<SeatReport> const& report);
60 void add_device(MirInputDeviceId);63 void add_device(MirInputDeviceId);
61 void remove_device(MirInputDeviceId);64 void remove_device(MirInputDeviceId);
6265
@@ -77,6 +80,7 @@
77 void update_spots();80 void update_spots();
78 void update_states();81 void update_states();
79 bool filter_input_event(MirInputEvent const* event);82 bool filter_input_event(MirInputEvent const* event);
83 void confine_function(mir::geometry::Point& p) const;
80 void confine_pointer();84 void confine_pointer();
8185
82 std::shared_ptr<InputDispatcher> const dispatcher;86 std::shared_ptr<InputDispatcher> const dispatcher;
@@ -85,6 +89,7 @@
85 std::shared_ptr<InputRegion> const input_region;89 std::shared_ptr<InputRegion> const input_region;
86 std::shared_ptr<KeyMapper> const key_mapper;90 std::shared_ptr<KeyMapper> const key_mapper;
87 std::shared_ptr<time::Clock> const clock;91 std::shared_ptr<time::Clock> const clock;
92 std::shared_ptr<SeatReport> const report;
8893
89 struct DeviceData94 struct DeviceData
90 {95 {
@@ -106,7 +111,9 @@
106 MirPointerButtons buttons;111 MirPointerButtons buttons;
107 std::unordered_map<MirInputDeviceId, DeviceData> device_data;112 std::unordered_map<MirInputDeviceId, DeviceData> device_data;
108 std::vector<TouchVisualizer::Spot> spots;113 std::vector<TouchVisualizer::Spot> spots;
109 std::function<void(mir::geometry::Point&)> confine_function;114 mir::geometry::Rectangles confined_region;
115
116 std::mutex mutable region_mutex;
110};117};
111118
112}119}
113120
=== modified file 'src/server/report/default_server_configuration.cpp'
--- src/server/report/default_server_configuration.cpp 2016-01-29 08:18:22 +0000
+++ src/server/report/default_server_configuration.cpp 2016-08-01 21:28:24 +0000
@@ -118,6 +118,15 @@
118 });118 });
119}119}
120120
121auto mir::DefaultServerConfiguration::the_seat_report() -> std::shared_ptr<mi::SeatReport>
122{
123 return seat_report(
124 [this]()->std::shared_ptr<mi::SeatReport>
125 {
126 return report_factory(options::seat_report_opt)->create_seat_report();
127 });
128}
129
121auto mir::DefaultServerConfiguration::the_scene_report() -> std::shared_ptr<ms::SceneReport>130auto mir::DefaultServerConfiguration::the_scene_report() -> std::shared_ptr<ms::SceneReport>
122{131{
123 return scene_report(132 return scene_report(
124133
=== modified file 'src/server/report/logging/CMakeLists.txt'
--- src/server/report/logging/CMakeLists.txt 2016-01-29 08:18:22 +0000
+++ src/server/report/logging/CMakeLists.txt 2016-08-01 21:28:24 +0000
@@ -10,6 +10,7 @@
10 input_report.cpp10 input_report.cpp
11 compositor_report.cpp11 compositor_report.cpp
12 scene_report.cpp12 scene_report.cpp
13 seat_report.cpp
13 shell_report.cpp14 shell_report.cpp
14 shell_report.h15 shell_report.h
15 logging_report_factory.cpp16 logging_report_factory.cpp
1617
=== modified file 'src/server/report/logging/logging_report_factory.cpp'
--- src/server/report/logging/logging_report_factory.cpp 2016-01-29 08:18:22 +0000
+++ src/server/report/logging/logging_report_factory.cpp 2016-08-01 21:28:24 +0000
@@ -26,6 +26,7 @@
26#include "session_mediator_report.h"26#include "session_mediator_report.h"
27#include "shell_report.h"27#include "shell_report.h"
28#include "input_report.h"28#include "input_report.h"
29#include "seat_report.h"
29#include "mir/logging/shared_library_prober_report.h"30#include "mir/logging/shared_library_prober_report.h"
3031
31#include "mir/default_server_configuration.h"32#include "mir/default_server_configuration.h"
@@ -74,6 +75,11 @@
74 return std::make_shared<logging::InputReport>(logger);75 return std::make_shared<logging::InputReport>(logger);
75}76}
7677
78std::shared_ptr<mir::input::SeatReport> mr::LoggingReportFactory::create_seat_report()
79{
80 return std::make_shared<logging::SeatReport>(logger);
81}
82
77std::shared_ptr<mir::SharedLibraryProberReport> mr::LoggingReportFactory::create_shared_library_prober_report()83std::shared_ptr<mir::SharedLibraryProberReport> mr::LoggingReportFactory::create_shared_library_prober_report()
78{84{
79 return std::make_shared<mir::logging::SharedLibraryProberReport>(logger);85 return std::make_shared<mir::logging::SharedLibraryProberReport>(logger);
8086
=== added file 'src/server/report/logging/seat_report.cpp'
--- src/server/report/logging/seat_report.cpp 1970-01-01 00:00:00 +0000
+++ src/server/report/logging/seat_report.cpp 2016-08-01 21:28:24 +0000
@@ -0,0 +1,146 @@
1/*
2 * Copyright © 2016 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: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */
18
19#include <sstream>
20
21#include "seat_report.h"
22#include "mir/events/event.h"
23#include "mir/geometry/rectangles.h"
24#include "mir/logging/logger.h"
25#include "mir/input/device.h"
26
27namespace mi = mir::input;
28namespace ml = mir::logging;
29namespace mrl = mir::report::logging;
30namespace geom = mir::geometry;
31
32namespace
33{
34char const* const component = "input::Seat";
35
36std::string scan_codes_to_string(std::vector<uint32_t> const& scan_codes)
37{
38 std::stringstream ss;
39 ss << "{";
40
41 for (auto const& s : scan_codes)
42 {
43 ss << s << ", ";
44 }
45
46 auto str = ss.str();
47
48 // Remove the extra , and space
49 str.pop_back();
50 str.pop_back();
51
52 return str + "}";
53}
54
55}
56
57mrl::SeatReport::SeatReport(std::shared_ptr<ml::Logger> const& log) :
58 log(log)
59{
60}
61
62void mrl::SeatReport::seat_add_device(uint64_t id)
63{
64 std::stringstream ss;
65 ss << "Add device"
66 << " device_id=" << id;
67
68 log->log(ml::Severity::informational, ss.str(), component);
69}
70
71void mrl::SeatReport::seat_remove_device(uint64_t id)
72{
73 std::stringstream ss;
74 ss << "Remove device"
75 << " device_id=" << id;
76
77 log->log(ml::Severity::informational, ss.str(), component);
78}
79
80void mrl::SeatReport::seat_dispatch_event(MirEvent const& event)
81{
82 std::stringstream ss;
83 ss << "Dispatch event"
84 << " event_type=" << event.type();
85
86 log->log(ml::Severity::informational, ss.str(), component);
87}
88
89void mrl::SeatReport::seat_get_rectangle_for(uint64_t id, geometry::Rectangle const& out_rect)
90{
91 std::stringstream ss;
92 ss << "Get rectangle for"
93 << " device_id=" << id
94 << " out_rect=" << out_rect;
95
96 log->log(ml::Severity::informational, ss.str(), component);
97}
98
99void mrl::SeatReport::seat_set_key_state(uint64_t id, std::vector<uint32_t> const& scan_codes)
100{
101 std::stringstream ss;
102 ss << "Set key state"
103 << " device_id=" << id
104 << " scan_codes=" << scan_codes_to_string(scan_codes);
105
106 log->log(ml::Severity::informational, ss.str(), component);
107}
108
109void mrl::SeatReport::seat_set_pointer_state(uint64_t id, unsigned buttons)
110{
111 std::stringstream ss;
112 ss << "Set pointer state"
113 << " devie_id=" << id
114 << " buttons=" << buttons;
115
116 log->log(ml::Severity::informational, ss.str(), component);
117}
118
119void mrl::SeatReport::seat_set_cursor_position(float cursor_x, float cursor_y)
120{
121 std::stringstream ss;
122 ss << "Set cursor position"
123 << " cursor_x=" << cursor_x
124 << " cursor_y=" << cursor_y;
125
126 log->log(ml::Severity::informational, ss.str(), component);
127}
128
129void mrl::SeatReport::seat_set_confinement_region_called(geom::Rectangles const& regions)
130{
131 std::stringstream ss;
132
133 auto bound_rect = regions.bounding_rectangle();
134 ss << "Set confinement region"
135 << " regions=" << bound_rect;
136
137 log->log(ml::Severity::informational, ss.str(), component);
138}
139
140void mrl::SeatReport::seat_reset_confinement_regions()
141{
142 std::stringstream ss;
143 ss << "Reset confinement regions";
144
145 log->log(ml::Severity::informational, ss.str(), component);
146}
0147
=== added file 'src/server/report/logging/seat_report.h'
--- src/server/report/logging/seat_report.h 1970-01-01 00:00:00 +0000
+++ src/server/report/logging/seat_report.h 2016-08-01 21:28:24 +0000
@@ -0,0 +1,67 @@
1/*
2 * Copyright © 2016 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: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */
18
19#ifndef MIR_REPORT_LOGGING_SEAT_REPORT_H_
20#define MIR_REPORT_LOGGING_SEAT_REPORT_H_
21
22#include <mir/input/seat_report.h>
23
24#include <memory>
25
26class MirEvent;
27
28namespace mir
29{
30namespace logging
31{
32class Logger;
33}
34namespace geometry
35{
36class Rectangles;
37class Rectangle;
38}
39namespace report
40{
41namespace logging
42{
43
44class SeatReport : public input::SeatReport
45{
46public:
47 SeatReport(std::shared_ptr<mir::logging::Logger> const& log);
48
49 virtual void seat_add_device(uint64_t id) override;
50 virtual void seat_remove_device(uint64_t id) override;
51 virtual void seat_dispatch_event(MirEvent const& event) override;
52 virtual void seat_get_rectangle_for(uint64_t id, geometry::Rectangle const& out_rect) override;
53 virtual void seat_set_key_state(uint64_t id, std::vector<uint32_t> const& scan_codes) override;
54 virtual void seat_set_pointer_state(uint64_t id, unsigned buttons) override;
55 virtual void seat_set_cursor_position(float cursor_x, float cursor_y) override;
56 virtual void seat_set_confinement_region_called(geometry::Rectangles const& regions) override;
57 virtual void seat_reset_confinement_regions() override;
58
59private:
60 std::shared_ptr<mir::logging::Logger> const log;
61};
62
63}
64}
65}
66
67#endif /* MIR_REPORT_LOGGING_SEAT_REPORT_H_ */
068
=== modified file 'src/server/report/logging_report_factory.h'
--- src/server/report/logging_report_factory.h 2016-01-29 08:18:22 +0000
+++ src/server/report/logging_report_factory.h 2016-08-01 21:28:24 +0000
@@ -47,6 +47,7 @@
47 std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override;47 std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override;
48 std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override;48 std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override;
49 std::shared_ptr<input::InputReport> create_input_report() override;49 std::shared_ptr<input::InputReport> create_input_report() override;
50 std::shared_ptr<input::SeatReport> create_seat_report() override;
50 std::shared_ptr<mir::SharedLibraryProberReport> create_shared_library_prober_report() override;51 std::shared_ptr<mir::SharedLibraryProberReport> create_shared_library_prober_report() override;
51 std::shared_ptr<shell::ShellReport> create_shell_report() override;52 std::shared_ptr<shell::ShellReport> create_shell_report() override;
5253
5354
=== modified file 'src/server/report/lttng/lttng_report_factory.cpp'
--- src/server/report/lttng/lttng_report_factory.cpp 2016-01-29 08:18:22 +0000
+++ src/server/report/lttng/lttng_report_factory.cpp 2016-08-01 21:28:24 +0000
@@ -62,6 +62,11 @@
62 return std::make_shared<lttng::InputReport>();62 return std::make_shared<lttng::InputReport>();
63}63}
6464
65std::shared_ptr<mir::input::SeatReport> mir::report::LttngReportFactory::create_seat_report()
66{
67 BOOST_THROW_EXCEPTION(std::logic_error("Not implemented"));
68}
69
65std::shared_ptr<mir::SharedLibraryProberReport> mir::report::LttngReportFactory::create_shared_library_prober_report()70std::shared_ptr<mir::SharedLibraryProberReport> mir::report::LttngReportFactory::create_shared_library_prober_report()
66{71{
67 return std::make_shared<lttng::SharedLibraryProberReport>();72 return std::make_shared<lttng::SharedLibraryProberReport>();
6873
=== modified file 'src/server/report/lttng_report_factory.h'
--- src/server/report/lttng_report_factory.h 2016-01-29 08:18:22 +0000
+++ src/server/report/lttng_report_factory.h 2016-08-01 21:28:24 +0000
@@ -35,6 +35,7 @@
35 std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override;35 std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override;
36 std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override;36 std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override;
37 std::shared_ptr<input::InputReport> create_input_report() override;37 std::shared_ptr<input::InputReport> create_input_report() override;
38 std::shared_ptr<input::SeatReport> create_seat_report() override;
38 std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() override;39 std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() override;
39 std::shared_ptr<shell::ShellReport> create_shell_report() override;40 std::shared_ptr<shell::ShellReport> create_shell_report() override;
40};41};
4142
=== modified file 'src/server/report/null/CMakeLists.txt'
--- src/server/report/null/CMakeLists.txt 2016-01-29 08:18:22 +0000
+++ src/server/report/null/CMakeLists.txt 2016-08-01 21:28:24 +0000
@@ -8,6 +8,7 @@
8 message_processor_report.cpp8 message_processor_report.cpp
9 null_report_factory.cpp9 null_report_factory.cpp
10 scene_report.cpp10 scene_report.cpp
11 seat_report.cpp
11 session_mediator_report.cpp12 session_mediator_report.cpp
12 shell_report.cpp13 shell_report.cpp
13 shell_report.h14 shell_report.h
1415
=== modified file 'src/server/report/null/null_report_factory.cpp'
--- src/server/report/null/null_report_factory.cpp 2016-01-29 08:18:22 +0000
+++ src/server/report/null/null_report_factory.cpp 2016-08-01 21:28:24 +0000
@@ -24,6 +24,7 @@
24#include "session_mediator_report.h"24#include "session_mediator_report.h"
25#include "display_report.h"25#include "display_report.h"
26#include "input_report.h"26#include "input_report.h"
27#include "seat_report.h"
27#include "shell_report.h"28#include "shell_report.h"
28#include "scene_report.h"29#include "scene_report.h"
29#include "mir/logging/null_shared_library_prober_report.h"30#include "mir/logging/null_shared_library_prober_report.h"
@@ -63,6 +64,11 @@
63 return std::make_shared<null::InputReport>();64 return std::make_shared<null::InputReport>();
64}65}
6566
67std::shared_ptr<mir::input::SeatReport> mir::report::NullReportFactory::create_seat_report()
68{
69 return std::make_shared<null::SeatReport>();
70}
71
66std::shared_ptr<mir::SharedLibraryProberReport> mir::report::NullReportFactory::create_shared_library_prober_report()72std::shared_ptr<mir::SharedLibraryProberReport> mir::report::NullReportFactory::create_shared_library_prober_report()
67{73{
68 return std::make_shared<logging::NullSharedLibraryProberReport>();74 return std::make_shared<logging::NullSharedLibraryProberReport>();
@@ -107,3 +113,8 @@
107{113{
108 return NullReportFactory{}.create_input_report();114 return NullReportFactory{}.create_input_report();
109}115}
116
117std::shared_ptr<mir::input::SeatReport> mir::report::null_seat_report()
118{
119 return NullReportFactory{}.create_seat_report();
120}
110121
=== added file 'src/server/report/null/seat_report.cpp'
--- src/server/report/null/seat_report.cpp 1970-01-01 00:00:00 +0000
+++ src/server/report/null/seat_report.cpp 2016-08-01 21:28:24 +0000
@@ -0,0 +1,58 @@
1/*
2 * Copyright © 2016 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: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */
18
19#include "seat_report.h"
20
21namespace mrn = mir::report::null;
22namespace geom = mir::geometry;
23
24void mrn::SeatReport::seat_add_device(uint64_t /*id*/)
25{
26}
27
28void mrn::SeatReport::seat_remove_device(uint64_t /*id*/)
29{
30}
31
32void mrn::SeatReport::seat_dispatch_event(MirEvent const& /*event*/)
33{
34}
35
36void mrn::SeatReport::seat_get_rectangle_for(uint64_t /*id*/, geometry::Rectangle const& /*out_rect*/)
37{
38}
39
40void mrn::SeatReport::seat_set_key_state(uint64_t /*id*/, std::vector<uint32_t> const& /*scan_codes*/)
41{
42}
43
44void mrn::SeatReport::seat_set_pointer_state(uint64_t /*id*/, unsigned /*buttons*/)
45{
46}
47
48void mrn::SeatReport::seat_set_cursor_position(float /*cursor_x*/, float /*cursor_y*/)
49{
50}
51
52void mrn::SeatReport::seat_set_confinement_region_called(geom::Rectangles const& /*regions*/)
53{
54}
55
56void mrn::SeatReport::seat_reset_confinement_regions()
57{
58}
059
=== added file 'src/server/report/null/seat_report.h'
--- src/server/report/null/seat_report.h 1970-01-01 00:00:00 +0000
+++ src/server/report/null/seat_report.h 2016-08-01 21:28:24 +0000
@@ -0,0 +1,50 @@
1/*
2 * Copyright © 2016 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: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */
18
19
20#ifndef MIR_REPORT_NULL_SEAT_REPORT_H_
21#define MIR_REPORT_NULL_SEAT_REPORT_H_
22
23#include "mir/input/seat_report.h"
24
25namespace mir
26{
27namespace report
28{
29namespace null
30{
31
32class SeatReport : public input::SeatReport
33{
34public:
35 virtual void seat_add_device(uint64_t id) override;
36 virtual void seat_remove_device(uint64_t id) override;
37 virtual void seat_dispatch_event(MirEvent const& event) override;
38 virtual void seat_get_rectangle_for(uint64_t id, geometry::Rectangle const& out_rect) override;
39 virtual void seat_set_key_state(uint64_t id, std::vector<uint32_t> const& scan_codes) override;
40 virtual void seat_set_pointer_state(uint64_t id, unsigned buttons) override;
41 virtual void seat_set_cursor_position(float cursor_x, float cursor_y) override;
42 virtual void seat_set_confinement_region_called(geometry::Rectangles const& regions) override;
43 virtual void seat_reset_confinement_regions() override;
44};
45
46}
47}
48}
49
50#endif /* MIR_REPORT_NULL_SEAT_REPORT_H_ */
051
=== modified file 'src/server/report/null_report_factory.h'
--- src/server/report/null_report_factory.h 2016-01-29 08:18:22 +0000
+++ src/server/report/null_report_factory.h 2016-08-01 21:28:24 +0000
@@ -35,6 +35,7 @@
35 std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override;35 std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override;
36 std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override;36 std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override;
37 std::shared_ptr<input::InputReport> create_input_report() override;37 std::shared_ptr<input::InputReport> create_input_report() override;
38 std::shared_ptr<input::SeatReport> create_seat_report() override;
38 std::shared_ptr<mir::SharedLibraryProberReport> create_shared_library_prober_report() override;39 std::shared_ptr<mir::SharedLibraryProberReport> create_shared_library_prober_report() override;
39 std::shared_ptr<shell::ShellReport> create_shell_report() override;40 std::shared_ptr<shell::ShellReport> create_shell_report() override;
40};41};
@@ -46,6 +47,7 @@
46std::shared_ptr<frontend::SessionMediatorReport> null_session_mediator_report();47std::shared_ptr<frontend::SessionMediatorReport> null_session_mediator_report();
47std::shared_ptr<frontend::MessageProcessorReport> null_message_processor_report();48std::shared_ptr<frontend::MessageProcessorReport> null_message_processor_report();
48std::shared_ptr<input::InputReport> null_input_report();49std::shared_ptr<input::InputReport> null_input_report();
50std::shared_ptr<input::SeatReport> null_seat_report();
49std::shared_ptr<mir::SharedLibraryProberReport> null_shared_library_prober_report();51std::shared_ptr<mir::SharedLibraryProberReport> null_shared_library_prober_report();
5052
51}53}
5254
=== modified file 'src/server/report/report_factory.h'
--- src/server/report/report_factory.h 2016-01-29 08:18:22 +0000
+++ src/server/report/report_factory.h 2016-08-01 21:28:24 +0000
@@ -41,6 +41,7 @@
41namespace input41namespace input
42{42{
43class InputReport;43class InputReport;
44class SeatReport;
44}45}
45namespace scene46namespace scene
46{47{
@@ -61,6 +62,7 @@
61 virtual std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() = 0;62 virtual std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() = 0;
62 virtual std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() = 0;63 virtual std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() = 0;
63 virtual std::shared_ptr<input::InputReport> create_input_report() = 0;64 virtual std::shared_ptr<input::InputReport> create_input_report() = 0;
65 virtual std::shared_ptr<input::SeatReport> create_seat_report() = 0;
64 virtual std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() = 0;66 virtual std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() = 0;
65 virtual std::shared_ptr<shell::ShellReport> create_shell_report() = 0;67 virtual std::shared_ptr<shell::ShellReport> create_shell_report() = 0;
6668
6769
=== modified file 'src/server/scene/basic_surface.cpp'
--- src/server/scene/basic_surface.cpp 2016-07-26 03:56:14 +0000
+++ src/server/scene/basic_surface.cpp 2016-08-01 21:28:24 +0000
@@ -131,12 +131,6 @@
131 { observer->cursor_image_removed(); });131 { observer->cursor_image_removed(); });
132}132}
133133
134void ms::SurfaceObservers::confinement_region_updated(geom::Rectangle const& rect)
135{
136 for_each([rect](std::shared_ptr<SurfaceObserver> const& observer)
137 { observer->confinement_region_updated(rect); });
138}
139
140struct ms::CursorStreamImageAdapter134struct ms::CursorStreamImageAdapter
141{135{
142 CursorStreamImageAdapter(ms::BasicSurface &surface)136 CursorStreamImageAdapter(ms::BasicSurface &surface)
@@ -288,11 +282,6 @@
288 surface_rect.top_left = top_left;282 surface_rect.top_left = top_left;
289 }283 }
290 observers.moved_to(top_left);284 observers.moved_to(top_left);
291
292 if (confine_pointer_state_ == mir_pointer_confined_to_surface)
293 {
294 observers.confinement_region_updated(surface_rect);
295 }
296}285}
297286
298float ms::BasicSurface::alpha() const287float ms::BasicSurface::alpha() const
@@ -375,11 +364,6 @@
375 surface_rect.size = new_size;364 surface_rect.size = new_size;
376 }365 }
377 observers.resized_to(new_size);366 observers.resized_to(new_size);
378
379 if (confine_pointer_state_ == mir_pointer_confined_to_surface)
380 {
381 observers.confinement_region_updated(surface_rect);
382 }
383}367}
384368
385geom::Point ms::BasicSurface::top_left() const369geom::Point ms::BasicSurface::top_left() const
@@ -911,11 +895,6 @@
911 });895 });
912 }896 }
913 observers.moved_to(surface_rect.top_left);897 observers.moved_to(surface_rect.top_left);
914
915 if (confine_pointer_state_ == mir_pointer_confined_to_surface)
916 {
917 observers.confinement_region_updated(surface_rect);
918 }
919}898}
920899
921mg::RenderableList ms::BasicSurface::generate_renderables(mc::CompositorID id) const900mg::RenderableList ms::BasicSurface::generate_renderables(mc::CompositorID id) const
922901
=== modified file 'src/server/scene/legacy_surface_change_notification.cpp'
--- src/server/scene/legacy_surface_change_notification.cpp 2016-07-26 03:56:14 +0000
+++ src/server/scene/legacy_surface_change_notification.cpp 2016-08-01 21:28:24 +0000
@@ -100,7 +100,3 @@
100{100{
101 notify_scene_change();101 notify_scene_change();
102}102}
103
104void ms::LegacySurfaceChangeNotification::confinement_region_updated(geometry::Rectangle const&)
105{
106}
107103
=== modified file 'src/server/scene/legacy_surface_change_notification.h'
--- src/server/scene/legacy_surface_change_notification.h 2016-07-26 03:56:14 +0000
+++ src/server/scene/legacy_surface_change_notification.h 2016-08-01 21:28:24 +0000
@@ -49,7 +49,6 @@
49 std::string const& variant, std::string const& options) override;49 std::string const& variant, std::string const& options) override;
50 void renamed(char const*) override;50 void renamed(char const*) override;
51 void cursor_image_removed() override;51 void cursor_image_removed() override;
52 void confinement_region_updated(geometry::Rectangle const& rect) override;
5352
54private:53private:
55 std::function<void()> const notify_scene_change;54 std::function<void()> const notify_scene_change;
5655
=== modified file 'src/server/scene/null_surface_observer.cpp'
--- src/server/scene/null_surface_observer.cpp 2016-07-26 03:56:14 +0000
+++ src/server/scene/null_surface_observer.cpp 2016-08-01 21:28:24 +0000
@@ -39,4 +39,3 @@
39}39}
40void ms::NullSurfaceObserver::renamed(char const*) {}40void ms::NullSurfaceObserver::renamed(char const*) {}
41void ms::NullSurfaceObserver::cursor_image_removed() {}41void ms::NullSurfaceObserver::cursor_image_removed() {}
42void ms::NullSurfaceObserver::confinement_region_updated(geometry::Rectangle const& /*rect*/) {}
4342
=== modified file 'src/server/server.cpp'
--- src/server/server.cpp 2016-07-20 04:54:07 +0000
+++ src/server/server.cpp 2016-08-01 21:28:24 +0000
@@ -99,6 +99,7 @@
99 MACRO(session_authorizer)\99 MACRO(session_authorizer)\
100 MACRO(session_listener)\100 MACRO(session_listener)\
101 MACRO(session_mediator_report)\101 MACRO(session_mediator_report)\
102 MACRO(seat_report)\
102 MACRO(shell)\103 MACRO(shell)\
103 MACRO(application_not_responding_detector)\104 MACRO(application_not_responding_detector)\
104 MACRO(cookie_authority)\105 MACRO(cookie_authority)\
105106
=== modified file 'src/server/shell/abstract_shell.cpp'
--- src/server/shell/abstract_shell.cpp 2016-08-01 07:44:10 +0000
+++ src/server/shell/abstract_shell.cpp 2016-08-01 21:28:24 +0000
@@ -41,17 +41,28 @@
4141
42struct UpdateConfinementOnSurfaceChanges : ms::NullSurfaceObserver42struct UpdateConfinementOnSurfaceChanges : ms::NullSurfaceObserver
43{43{
44 UpdateConfinementOnSurfaceChanges(std::shared_ptr<mi::Seat> seat) :44 UpdateConfinementOnSurfaceChanges(msh::AbstractShell* shell) :
45 seat(seat)45 shell(shell)
46 {46 {
47 }47 }
4848
49 void confinement_region_updated(geom::Rectangle const& rect)49 void resized_to(geom::Size const& /*size*/) override
50 {50 {
51 seat->set_confinement_regions({rect});51 update_confinement_region();
52 }52 }
5353
54 std::shared_ptr<mi::Seat> seat;54 void moved_to(geom::Point const& /*top_left*/) override
55 {
56 update_confinement_region();
57 }
58
59private:
60 void update_confinement_region()
61 {
62 shell->update_focused_surface_confined_region();
63 }
64
65 msh::AbstractShell* shell;
55};66};
56}67}
5768
@@ -70,7 +81,7 @@
70 window_manager(wm_builder(this)),81 window_manager(wm_builder(this)),
71 seat(seat),82 seat(seat),
72 report(report),83 report(report),
73 focus_surface_observer(std::make_shared<UpdateConfinementOnSurfaceChanges>(seat))84 focus_surface_observer(std::make_shared<UpdateConfinementOnSurfaceChanges>(this))
74{85{
75}86}
7687
@@ -78,6 +89,16 @@
78{89{
79}90}
8091
92void msh::AbstractShell::update_focused_surface_confined_region()
93{
94 auto const current_focus = focus_surface.lock();
95
96 if (current_focus && current_focus->confine_pointer_state() == mir_pointer_confined_to_surface)
97 {
98 seat->set_confinement_regions({current_focus->input_bounds()});
99 }
100}
101
81std::shared_ptr<ms::Session> msh::AbstractShell::open_session(102std::shared_ptr<ms::Session> msh::AbstractShell::open_session(
82 pid_t client_pid,103 pid_t client_pid,
83 std::string const& name,104 std::string const& name,
@@ -357,3 +378,4 @@
357 surface_stack->raise(surfaces);378 surface_stack->raise(surfaces);
358 report->surfaces_raised(surfaces);379 report->surfaces_raised(surfaces);
359}380}
381
360382
=== modified file 'src/server/symbols.map'
--- src/server/symbols.map 2016-07-28 03:39:52 +0000
+++ src/server/symbols.map 2016-08-01 21:28:24 +0000
@@ -839,6 +839,6 @@
839MIR_SERVER_0.25 {839MIR_SERVER_0.25 {
840 global:840 global:
841 extern "C++" {841 extern "C++" {
842 mir::scene::NullSurfaceObserver::confinement_region_updated*;842 mir::Server::override_the_seat_report*;
843 };843 };
844} MIR_SERVER_0.24;844} MIR_SERVER_0.24;
845845
=== modified file 'tests/acceptance-tests/test_confined_pointer.cpp'
--- tests/acceptance-tests/test_confined_pointer.cpp 2016-07-26 03:56:14 +0000
+++ tests/acceptance-tests/test_confined_pointer.cpp 2016-08-01 21:28:24 +0000
@@ -16,15 +16,19 @@
16 * Authored by: Brandon Schaefer <brandon.schaefer@canonical.com>16 * Authored by: Brandon Schaefer <brandon.schaefer@canonical.com>
17 */17 */
1818
19#include "mir/scene/null_surface_observer.h"
20#include "mir/input/input_device_info.h"
21#include "mir/geometry/rectangles.h"
22
19#include "mir/test/event_matchers.h"23#include "mir/test/event_matchers.h"
20#include "mir/input/input_device_info.h"24#include "mir/test/fake_shared.h"
25#include "mir/test/signal.h"
26#include "mir/test/doubles/mock_seat_report.h"
21#include "mir_test_framework/fake_input_device.h"27#include "mir_test_framework/fake_input_device.h"
28#include "mir_test_framework/headless_in_process_server.h"
29#include "mir_test_framework/placement_applying_shell.h"
22#include "mir_test_framework/stub_server_platform_factory.h"30#include "mir_test_framework/stub_server_platform_factory.h"
2331
24#include "mir/test/signal.h"
25#include "mir_test_framework/placement_applying_shell.h"
26#include "mir_test_framework/headless_in_process_server.h"
27
28#include "mir_toolkit/mir_client_library.h"32#include "mir_toolkit/mir_client_library.h"
2933
30#include <gtest/gtest.h>34#include <gtest/gtest.h>
@@ -32,19 +36,26 @@
3236
33#include <boost/throw_exception.hpp>37#include <boost/throw_exception.hpp>
3438
3539namespace mtd = mir::test::doubles;
36namespace mt = mir::test;40namespace mt = mir::test;
37namespace mi = mir::input;41namespace mi = mir::input;
42namespace ms = mir::scene;
38namespace mis = mir::input::synthesis;43namespace mis = mir::input::synthesis;
39namespace mtf = mir_test_framework;44namespace mtf = mir_test_framework;
40namespace geom = mir::geometry;45namespace geom = mir::geometry;
4146
42using namespace std::chrono_literals;47using namespace std::chrono_literals;
48using namespace testing;
4349
44namespace50namespace
45{51{
46int const surface_width = 100;52int const surface_width = 100;
47int const surface_height = 100;53int const surface_height = 100;
54
55struct MockSurfaceObserver : public ms::NullSurfaceObserver
56{
57 MOCK_METHOD1(resized_to, void(geom::Size const&));
58};
48}59}
4960
50void null_event_handler(MirSurface*, MirEvent const*, void*)61void null_event_handler(MirSurface*, MirEvent const*, void*)
@@ -96,12 +107,6 @@
96107
97 mir_surface_apply_spec(surface, spec);108 mir_surface_apply_spec(surface, spec);
98 mir_surface_spec_release(spec);109 mir_surface_spec_release(spec);
99
100 received_resize.wait_for(1s);
101 if (!received_resize.raised())
102 {
103 BOOST_THROW_EXCEPTION(std::runtime_error("Timeout waiting for surface to become resized"));
104 }
105 }110 }
106111
107 void handle_surface_event(MirSurfaceEvent const* event)112 void handle_surface_event(MirSurfaceEvent const* event)
@@ -133,9 +138,6 @@
133 case mir_event_type_input:138 case mir_event_type_input:
134 client->handle_input(ev);139 client->handle_input(ev);
135 break;140 break;
136 case mir_event_type_resize:
137 client->received_resize.raise();
138 break;
139 default:141 default:
140 break;142 break;
141 }143 }
@@ -154,7 +156,6 @@
154 MirConnection* connection;156 MirConnection* connection;
155 mir::test::Signal ready_to_accept_events;157 mir::test::Signal ready_to_accept_events;
156 mir::test::Signal all_events_received;158 mir::test::Signal all_events_received;
157 mir::test::Signal received_resize;
158 bool exposed = false;159 bool exposed = false;
159 bool focused = false;160 bool focused = false;
160};161};
@@ -168,21 +169,40 @@
168 server.wrap_shell(169 server.wrap_shell(
169 [this](std::shared_ptr<mir::shell::Shell> const& wrapped)170 [this](std::shared_ptr<mir::shell::Shell> const& wrapped)
170 {171 {
171 //return wrapped;
172 shell = std::make_shared<mtf::PlacementApplyingShell>(wrapped, input_regions, positions);172 shell = std::make_shared<mtf::PlacementApplyingShell>(wrapped, input_regions, positions);
173 return shell;173 return shell;
174 });174 });
175175
176 server.override_the_seat_report([this]
177 {
178 mock_seat_report = std::make_shared<NiceMock<mtd::MockSeatReport>>();
179 return mock_seat_report;
180 });
181
176 HeadlessInProcessServer::SetUp();182 HeadlessInProcessServer::SetUp();
177183
178 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};184 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};
179 }185 }
180186
187 std::shared_ptr<ms::Surface> latest_shell_surface() const
188 {
189 auto const result = shell->latest_surface.lock();
190// ASSERT_THAT(result, NotNull()); //<= doesn't compile!?
191 EXPECT_THAT(result, NotNull());
192 return result;
193 }
194
195 void change_observed() { resized_signaled.raise(); }
196
181 std::string const mouse_name = "mouse";197 std::string const mouse_name = "mouse";
182 std::string const mouse_unique_id = "mouse-uid";198 std::string const mouse_unique_id = "mouse-uid";
183 std::unique_ptr<mtf::FakeInputDevice> fake_mouse{199 std::unique_ptr<mtf::FakeInputDevice> fake_mouse{
184 mtf::add_fake_input_device(mi::InputDeviceInfo{mouse_name, mouse_unique_id, mi::DeviceCapability::pointer})};200 mtf::add_fake_input_device(mi::InputDeviceInfo{mouse_name, mouse_unique_id, mi::DeviceCapability::pointer})};
185201
202 NiceMock<MockSurfaceObserver> surface_observer;
203 mir::test::Signal resized_signaled;
204
205 std::shared_ptr<mtd::MockSeatReport> mock_seat_report;
186 std::shared_ptr<mtf::PlacementApplyingShell> shell;206 std::shared_ptr<mtf::PlacementApplyingShell> shell;
187 geom::Rectangle screen_geometry{{0,0}, {800,600}};207 geom::Rectangle screen_geometry{{0,0}, {800,600}};
188 mtf::ClientInputRegions input_regions;208 mtf::ClientInputRegions input_regions;
@@ -193,8 +213,6 @@
193213
194TEST_F(PointerConfinement, test_we_hit_pointer_confined_boundary)214TEST_F(PointerConfinement, test_we_hit_pointer_confined_boundary)
195{215{
196 using namespace ::testing;
197
198 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};216 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};
199 Client client(new_connection(), first);217 Client client(new_connection(), first);
200218
@@ -216,8 +234,6 @@
216234
217TEST_F(PointerConfinement, test_we_generate_relative_after_boundary)235TEST_F(PointerConfinement, test_we_generate_relative_after_boundary)
218{236{
219 using namespace ::testing;
220
221 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};237 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};
222 Client client(new_connection(), first);238 Client client(new_connection(), first);
223239
@@ -235,12 +251,20 @@
235251
236TEST_F(PointerConfinement, test_we_update_our_confined_region_on_a_resize)252TEST_F(PointerConfinement, test_we_update_our_confined_region_on_a_resize)
237{253{
238 using namespace ::testing;
239
240 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};254 positions[first] = geom::Rectangle{{0,0}, {surface_width, surface_height}};
241 Client client(new_connection(), first);255 Client client(new_connection(), first);
242256
257 auto fake = mt::fake_shared(surface_observer);
258 latest_shell_surface()->add_observer(fake);
259
260 geom::Size new_size = {surface_width + 100, surface_height};
261 EXPECT_CALL(surface_observer, resized_to(new_size)).Times(1);
262
263 EXPECT_CALL(*mock_seat_report, seat_set_confinement_region_called(_)).
264 WillRepeatedly(InvokeWithoutArgs([&] { change_observed(); }));
265
243 client.resize(surface_width + 100, surface_height);266 client.resize(surface_width + 100, surface_height);
267 resized_signaled.wait_for(1s);
244268
245 InSequence seq;269 InSequence seq;
246 EXPECT_CALL(client, handle_input(mt::PointerEnterEvent()));270 EXPECT_CALL(client, handle_input(mt::PointerEnterEvent()));
247271
=== modified file 'tests/integration-tests/input/test_single_seat_setup.cpp'
--- tests/integration-tests/input/test_single_seat_setup.cpp 2016-07-07 09:59:19 +0000
+++ tests/integration-tests/input/test_single_seat_setup.cpp 2016-08-01 21:28:24 +0000
@@ -26,6 +26,7 @@
26#include "mir/test/doubles/mock_touch_visualizer.h"26#include "mir/test/doubles/mock_touch_visualizer.h"
27#include "mir/test/doubles/mock_cursor_listener.h"27#include "mir/test/doubles/mock_cursor_listener.h"
28#include "mir/test/doubles/mock_event_sink.h"28#include "mir/test/doubles/mock_event_sink.h"
29#include "mir/test/doubles/mock_seat_report.h"
29#include "mir/test/doubles/triggered_main_loop.h"30#include "mir/test/doubles/triggered_main_loop.h"
30#include "mir/test/event_matchers.h"31#include "mir/test/event_matchers.h"
31#include "mir/test/doubles/advanceable_clock.h"32#include "mir/test/doubles/advanceable_clock.h"
@@ -80,12 +81,13 @@
80 std::shared_ptr<mir::cookie::Authority> cookie_authority = mir::cookie::Authority::create();81 std::shared_ptr<mir::cookie::Authority> cookie_authority = mir::cookie::Authority::create();
81 NiceMock<mtd::MockCursorListener> mock_cursor_listener;82 NiceMock<mtd::MockCursorListener> mock_cursor_listener;
82 NiceMock<mtd::MockTouchVisualizer> mock_visualizer;83 NiceMock<mtd::MockTouchVisualizer> mock_visualizer;
84 NiceMock<mtd::MockSeatReport> mock_seat_report;
83 mi::receiver::XKBMapper key_mapper;85 mi::receiver::XKBMapper key_mapper;
84 mir::dispatch::MultiplexingDispatchable multiplexer;86 mir::dispatch::MultiplexingDispatchable multiplexer;
85 mtd::AdvanceableClock clock;87 mtd::AdvanceableClock clock;
86 mi::BasicSeat seat{88 mi::BasicSeat seat{
87 mt::fake_shared(mock_dispatcher),mt::fake_shared(mock_visualizer), mt::fake_shared(mock_cursor_listener),89 mt::fake_shared(mock_dispatcher),mt::fake_shared(mock_visualizer), mt::fake_shared(mock_cursor_listener),
88 mt::fake_shared(mock_region), mt::fake_shared(key_mapper), mt::fake_shared(clock)};90 mt::fake_shared(mock_region), mt::fake_shared(key_mapper), mt::fake_shared(clock), mt::fake_shared(mock_seat_report)};
89 mi::DefaultInputDeviceHub hub{91 mi::DefaultInputDeviceHub hub{
90 mt::fake_shared(mock_sink), mt::fake_shared(seat), mt::fake_shared(multiplexer), mt::fake_shared(observer_loop),92 mt::fake_shared(mock_sink), mt::fake_shared(seat), mt::fake_shared(multiplexer), mt::fake_shared(observer_loop),
91 cookie_authority, mt::fake_shared(key_mapper)};93 cookie_authority, mt::fake_shared(key_mapper)};
9294
=== modified file 'tests/mir_test_framework/placement_applying_shell.cpp'
--- tests/mir_test_framework/placement_applying_shell.cpp 2016-05-03 06:55:25 +0000
+++ tests/mir_test_framework/placement_applying_shell.cpp 2016-08-01 21:28:24 +0000
@@ -41,6 +41,7 @@
4141
42 auto const id = wrapped->create_surface(session, creation_parameters, sink);42 auto const id = wrapped->create_surface(session, creation_parameters, sink);
43 auto const surface = session->surface(id);43 auto const surface = session->surface(id);
44 latest_surface = surface;
4445
45 auto position= client_positions.find(params.name);46 auto position= client_positions.find(params.name);
46 if (position != client_positions.end())47 if (position != client_positions.end())
4748
=== modified file 'tests/unit-tests/input/test_seat_input_device_tracker.cpp'
--- tests/unit-tests/input/test_seat_input_device_tracker.cpp 2016-07-01 20:32:34 +0000
+++ tests/unit-tests/input/test_seat_input_device_tracker.cpp 2016-08-01 21:28:24 +0000
@@ -26,6 +26,7 @@
26#include "mir/test/doubles/mock_cursor_listener.h"26#include "mir/test/doubles/mock_cursor_listener.h"
27#include "mir/test/doubles/mock_touch_visualizer.h"27#include "mir/test/doubles/mock_touch_visualizer.h"
28#include "mir/test/doubles/mock_input_seat.h"28#include "mir/test/doubles/mock_input_seat.h"
29#include "mir/test/doubles/mock_seat_report.h"
29#include "mir/test/doubles/advanceable_clock.h"30#include "mir/test/doubles/advanceable_clock.h"
30#include "mir/test/event_matchers.h"31#include "mir/test/event_matchers.h"
31#include "mir/test/fake_shared.h"32#include "mir/test/fake_shared.h"
@@ -56,6 +57,7 @@
56 Nice<mtd::MockCursorListener> mock_cursor_listener;57 Nice<mtd::MockCursorListener> mock_cursor_listener;
57 Nice<mtd::MockTouchVisualizer> mock_visualizer;58 Nice<mtd::MockTouchVisualizer> mock_visualizer;
58 Nice<mtd::MockInputSeat> mock_seat;59 Nice<mtd::MockInputSeat> mock_seat;
60 Nice<mtd::MockSeatReport> mock_seat_report;
59 MirInputDeviceId some_device{8712};61 MirInputDeviceId some_device{8712};
60 MirInputDeviceId another_device{1246};62 MirInputDeviceId another_device{1246};
61 MirInputDeviceId third_device{86};63 MirInputDeviceId third_device{86};
@@ -68,7 +70,8 @@
68 mi::receiver::XKBMapper mapper;70 mi::receiver::XKBMapper mapper;
69 mi::SeatInputDeviceTracker tracker{71 mi::SeatInputDeviceTracker tracker{
70 mt::fake_shared(mock_dispatcher), mt::fake_shared(mock_visualizer), mt::fake_shared(mock_cursor_listener),72 mt::fake_shared(mock_dispatcher), mt::fake_shared(mock_visualizer), mt::fake_shared(mock_cursor_listener),
71 mt::fake_shared(mock_region), mt::fake_shared(mapper), mt::fake_shared(clock)};73 mt::fake_shared(mock_region), mt::fake_shared(mapper), mt::fake_shared(clock),
74 mt::fake_shared(mock_seat_report)};
7275
73 std::chrono::nanoseconds arbitrary_timestamp;76 std::chrono::nanoseconds arbitrary_timestamp;
74};77};

Subscribers

People subscribed via source and target branches