Mir

Merge lp:~vanvugt/mir/fix-1602966 into lp:mir

Proposed by Daniel van Vugt on 2016-07-14
Status: Merged
Approved by: Daniel van Vugt on 2016-07-15
Approved revision: 3595
Merged at revision: 3594
Proposed branch: lp:~vanvugt/mir/fix-1602966
Merge into: lp:mir
Diff against target: 67 lines (+30/-2)
2 files modified
src/client/input/xkb_mapper.cpp (+2/-2)
tests/unit-tests/client/input/test_xkb_mapper.cpp (+28/-0)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1602966
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2016-07-15
Cemil Azizoglu (community) 2016-07-14 Approve on 2016-07-14
Review via email: mp+300047@code.launchpad.net

Commit message

Fix Super key not working any more since r3565 (LP: #1602966), so that
the kernel's KEY_LEFTMETA once again maps to Mir's
mir_input_event_modifier_meta_left.

It was an understandable mistake as the Super key is actually:
   Kernel: KEY_LEFTMETA
   XKB: XKB_KEY_Super_L (not XKB_KEY_Meta_L)
   Mir: mir_input_event_modifier_meta_left

Description of the change

*** Do not top approve until bug 1603303 is fixed (because it will fail)

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

FAILED: Continuous integration, rev:3593
https://mir-jenkins.ubuntu.com/job/mir-ci/1279/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1497/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1550
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1541
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1541
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1541
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1512/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1512/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1512/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1512/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/1512
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1512/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/1512/console

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

review: Needs Fixing (continuous-integration)
Cemil Azizoglu (cemil-azizoglu) wrote :

LGTM

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

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

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

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/397/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1512/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/426/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1565
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1556
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1556
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1556
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1527
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1527/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/1527/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1527
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1527/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/1527
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1527/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/1527/console

review: Needs Fixing (continuous-integration)
Daniel van Vugt (vanvugt) wrote :

mock_egl.h:89:7: error: type 'struct MockEGL' violates one definition rule [-Werror=odr]

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

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

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

review: Approve (continuous-integration)
Daniel van Vugt (vanvugt) wrote :

I'm rushing through top approval on this one because it's seemingly the only proposal ready to act as a second test of the autolanding fix. Also, this is an important fix... even Unity8 uses the Super key now.

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

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/401/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1519/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/431/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1572
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1563
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1563
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1563
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1534
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1534/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/1534
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1534/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1534/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1534/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/1534
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1534/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/1534
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1534/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Daniel van Vugt (vanvugt) wrote :

Not so bad. Bug 1603303 remains fixed. Only krillin tests failed: bug 1394369

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/client/input/xkb_mapper.cpp'
2--- src/client/input/xkb_mapper.cpp 2016-06-24 07:41:32 +0000
3+++ src/client/input/xkb_mapper.cpp 2016-07-15 05:00:26 +0000
4@@ -42,8 +42,8 @@
5 case XKB_KEY_Alt_L: return mir_input_event_modifier_alt_left;
6 case XKB_KEY_Control_R: return mir_input_event_modifier_ctrl_right;
7 case XKB_KEY_Control_L: return mir_input_event_modifier_ctrl_left;
8- case XKB_KEY_Meta_L: return mir_input_event_modifier_meta_left;
9- case XKB_KEY_Meta_R: return mir_input_event_modifier_meta_right;
10+ case XKB_KEY_Super_L: return mir_input_event_modifier_meta_left;
11+ case XKB_KEY_Super_R: return mir_input_event_modifier_meta_right;
12 case XKB_KEY_Caps_Lock: return mir_input_event_modifier_caps_lock;
13 case XKB_KEY_Scroll_Lock: return mir_input_event_modifier_scroll_lock;
14 default: return MirInputEventModifiers{0};
15
16=== modified file 'tests/unit-tests/client/input/test_xkb_mapper.cpp'
17--- tests/unit-tests/client/input/test_xkb_mapper.cpp 2016-06-24 06:43:18 +0000
18+++ tests/unit-tests/client/input/test_xkb_mapper.cpp 2016-07-15 05:00:26 +0000
19@@ -104,6 +104,9 @@
20 EXPECT_EQ(XKB_KEY_dollar, map_key(mir_keyboard_action_up, KEY_4));
21 EXPECT_EQ(XKB_KEY_Shift_L, map_key(mir_keyboard_action_up, KEY_LEFTSHIFT));
22 EXPECT_EQ(XKB_KEY_4, map_key(mir_keyboard_action_down, KEY_4));
23+
24+ EXPECT_EQ(XKB_KEY_Super_L, map_key(mir_keyboard_action_down, KEY_LEFTMETA));
25+ EXPECT_EQ(XKB_KEY_Super_R, map_key(mir_keyboard_action_down, KEY_RIGHTMETA));
26 }
27
28 TEST_F(XKBMapper, when_surface_keymap_is_set_maps_generic_us_english_keys)
29@@ -116,6 +119,9 @@
30 EXPECT_EQ(XKB_KEY_dollar, map_key(mir_keyboard_action_up, KEY_4));
31 EXPECT_EQ(XKB_KEY_Shift_L, map_key(mir_keyboard_action_up, KEY_LEFTSHIFT));
32 EXPECT_EQ(XKB_KEY_4, map_key(mir_keyboard_action_down, KEY_4));
33+
34+ EXPECT_EQ(XKB_KEY_Super_L, map_key(mir_keyboard_action_down, KEY_LEFTMETA));
35+ EXPECT_EQ(XKB_KEY_Super_R, map_key(mir_keyboard_action_down, KEY_RIGHTMETA));
36 }
37
38 TEST_F(XKBMapper, key_repeats_do_not_recurse_modifier_state)
39@@ -174,6 +180,28 @@
40 map_event(keyboard_us, mir_keyboard_action_up, KEY_LEFTSHIFT);
41 }
42
43+TEST_F(XKBMapper, maps_kernel_meta_to_mir_meta) // AKA "Super"
44+{ // Regression test for LP: #1602966
45+ const MirInputEventModifiers meta_left =
46+ mir_input_event_modifier_meta_left | mir_input_event_modifier_meta;
47+ const MirInputEventModifiers meta_right =
48+ mir_input_event_modifier_meta_right | mir_input_event_modifier_meta;
49+
50+ InSequence seq;
51+ EXPECT_CALL(*this, mapped_event(mt::KeyWithModifiers(meta_left)));
52+ EXPECT_CALL(*this, mapped_event(mt::KeyWithModifiers(mir_input_event_modifier_none)));
53+
54+ EXPECT_CALL(*this, mapped_event(mt::KeyWithModifiers(meta_right)));
55+ EXPECT_CALL(*this, mapped_event(mt::KeyWithModifiers(mir_input_event_modifier_none)));
56+
57+ auto keyboard_us = MirInputDeviceId{0};
58+ mapper.set_keymap_for_device(keyboard_us, mi::Keymap{});
59+ map_event(keyboard_us, mir_keyboard_action_down, KEY_LEFTMETA);
60+ map_event(keyboard_us, mir_keyboard_action_up, KEY_LEFTMETA);
61+ map_event(keyboard_us, mir_keyboard_action_down, KEY_RIGHTMETA);
62+ map_event(keyboard_us, mir_keyboard_action_up, KEY_RIGHTMETA);
63+}
64+
65 TEST_F(XKBMapper, maps_modifier_keys_according_to_keymap)
66 {
67 auto keyboard_us = MirInputDeviceId{0};

Subscribers

People subscribed via source and target branches