Mir

Merge lp:~alan-griffiths/mir/fix-1718632 into lp:mir

Proposed by Alan Griffiths on 2017-09-22
Status: Merged
Merge reported by: Chris Halse Rogers
Merged at revision: not available
Proposed branch: lp:~alan-griffiths/mir/fix-1718632
Merge into: lp:mir
Prerequisite: lp:~alan-griffiths/mir/fix-1717561
Diff against target: 62 lines (+38/-0)
1 file modified
src/server/frontend/wayland/wayland_connector.cpp (+38/-0)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1718632
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Needs Fixing on 2017-09-23
Gerry Boland 2017-09-22 Approve on 2017-09-22
Review via email: mp+331205@code.launchpad.net

Commit message

Handle focus events in the Wayland frontend (so that keyboard input works)

To post a comment you must log in.
Gerry Boland (gerboland) wrote :

Yep, that's the thing

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4260
https://mir-jenkins.ubuntu.com/job/mir-ci/3679/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/5043/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5279
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5267
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5267
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5267
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5086
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5086/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5086
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5086/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5086
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5086/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5086
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5086/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5086
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5086/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5086
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5086/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5086
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5086/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5086/console

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

review: Needs Fixing (continuous-integration)
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/1437/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5045
    FAILURE: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1571/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1572/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5281
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5269
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5269
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5269
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5088/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5088/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5088/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5088/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5088/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5088/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5088/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5088
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5088/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/frontend/wayland/wayland_connector.cpp'
2--- src/server/frontend/wayland/wayland_connector.cpp 2017-09-22 15:51:22 +0000
3+++ src/server/frontend/wayland/wayland_connector.cpp 2017-09-22 15:51:22 +0000
4@@ -786,6 +786,29 @@
5 });
6 }
7
8+ void handle_event(MirWindowEvent const* event, wl_resource* target)
9+ {
10+ if (mir_window_event_get_attribute(event) == mir_window_attrib_focus)
11+ {
12+ executor->spawn(
13+ [resource = resource, serial = wl_display_next_serial(wl_client_get_display(client)),
14+ target = target, focussed = mir_window_event_get_attribute_value(event)]()
15+ {
16+ if (focussed)
17+ {
18+ wl_array key_state;
19+ wl_array_init(&key_state);
20+ wl_keyboard_send_enter(resource, serial, target, &key_state);
21+ wl_array_release(&key_state);
22+ }
23+ else
24+ {
25+ wl_keyboard_send_leave(resource, serial, target);
26+ }
27+ });
28+ }
29+ }
30+
31 private:
32 std::shared_ptr<mir::Executor> const executor;
33
34@@ -998,6 +1021,14 @@
35 }
36 }
37
38+ void handle_event(MirWindowEvent const* event, wl_resource* target) const
39+ {
40+ for (auto& listener : listeners)
41+ {
42+ listener->handle_event(event, target);
43+ }
44+ }
45+
46 private:
47 std::vector<std::shared_ptr<InputInterface>> listeners;
48 };
49@@ -1214,6 +1245,13 @@
50 default:
51 break;
52 }
53+ break;
54+ }
55+ case mir_event_type_window:
56+ {
57+ auto const wev = mir_event_get_window_event(&event);
58+
59+ seat->acquire_keyboard_reference(client).handle_event(wev, target);
60 }
61 default:
62 break;

Subscribers

People subscribed via source and target branches