Merge lp:~lukas-kde/unity8/defaultKeymap into lp:unity8

Proposed by Lukáš Tinkl on 2016-09-26
Status: Merged
Approved by: Gerry Boland on 2017-01-05
Approved revision: 2622
Merged at revision: 2771
Proposed branch: lp:~lukas-kde/unity8/defaultKeymap
Merge into: lp:unity8
Diff against target: 121 lines (+34/-9)
5 files modified
CMakeLists.txt (+1/-1)
debian/control (+1/-1)
qml/Components/KeymapSwitcher.qml (+15/-7)
tests/mocks/Unity/Application/MirMock.cpp (+13/-0)
tests/mocks/Unity/Application/MirMock.h (+4/-0)
To merge this branch: bzr merge lp:~lukas-kde/unity8/defaultKeymap
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve on 2017-01-20
Gerry Boland (community) 2016-09-26 Approve on 2017-01-05
Review via email: mp+306761@code.launchpad.net

Commit message

Fix keymap not being applied on the shell itself

Description of the change

Prereq-archive: ppa:ci-train-ppa-service/2272

Bind the keymap to the global device keymap which is then applied to Mir's device config. Need to keep the old surface binding in place as well due to xmir/libertine apps.

 * Are there any related MPs required for this MP to build/function as expected? Please list.

Yes, https://code.launchpad.net/~lukas-kde/qtmir/defaultKeymap/+merge/306519

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

 * If you changed the UI, has there been a design review?

N/A

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

Why the commented out bit?

review: Needs Information
Lukáš Tinkl (lukas-kde) wrote :

This is WIP, need to test it out together with the Mir fix (currently in https://bileto.ubuntu.com/#/ticket/2003) if it doesn't clash with our surface-based approach.

I'd appreciate if someone could look at https://code.launchpad.net/~lukas-kde/qtmir/defaultKeymap/+merge/306519 first :)

Gerry Boland (gerboland) wrote :

Works well, and code is reasonable

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2622
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2908/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3793/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3821
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3664
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3664/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3664
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3664/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3664
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3664/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3664/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3664
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3664/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3664/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2908/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2622
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2930/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3825
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2219
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2219
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3853
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3696
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3696/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3696
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3696/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3696
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3696/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3696
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3696/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3696
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3696/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3696
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3696/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2930/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2622
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2977/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2977/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2622
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2976/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3877
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2267
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2267
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3905
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3750
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3750/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3750
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3750/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3750
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3750/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3750
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3750/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3750
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3750/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3750
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3750/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2976/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-12-12 16:45:09 +0000
3+++ CMakeLists.txt 2017-01-02 11:20:59 +0000
4@@ -70,7 +70,7 @@
5 find_package(Qt5Concurrent 5.4 REQUIRED)
6 find_package(Qt5Sql 5.4 REQUIRED)
7
8-pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=23)
9+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=25)
10 pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
11 pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
12 pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
13
14=== modified file 'debian/control'
15--- debian/control 2016-12-12 16:45:09 +0000
16+++ debian/control 2017-01-02 11:20:59 +0000
17@@ -38,7 +38,7 @@
18 libubuntugestures5-private-dev (>= 1.3.2030),
19 libudev-dev,
20 libudm-common-dev,
21- libunity-api-dev (>= 8.0),
22+ libunity-api-dev (>= 8.1),
23 libusermetricsoutput1-dev,
24 # Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
25 libx11-dev[!arm64 !armhf],
26
27=== modified file 'qml/Components/KeymapSwitcher.qml'
28--- qml/Components/KeymapSwitcher.qml 2016-11-30 19:24:02 +0000
29+++ qml/Components/KeymapSwitcher.qml 2017-01-02 11:20:59 +0000
30@@ -51,6 +51,9 @@
31 nextIndex = currentKeymapIndex + 1;
32 }
33 currentKeymapIndex = nextIndex;
34+ if (actionGroup.currentAction.valid) {
35+ actionGroup.currentAction.updateState(currentKeymapIndex);
36+ }
37 }
38
39 function previousKeymap() {
40@@ -60,30 +63,35 @@
41 prevIndex = currentKeymapIndex - 1;
42 }
43 currentKeymapIndex = prevIndex;
44+ if (actionGroup.currentAction.valid) {
45+ actionGroup.currentAction.updateState(currentKeymapIndex);
46+ }
47 }
48
49- property Binding surfaceKeymapBinding: Binding {
50+ property Binding surfaceKeymapBinding: Binding { // NB: needed mainly for xmir & libertine apps
51 target: root.focusedSurface
52 property: "keymap"
53 value: root.currentKeymap
54 }
55
56+ property Binding unityKeymapBinding: Binding {
57+ target: Mir
58+ property: "currentKeymap"
59+ value: root.currentKeymap
60+ }
61+
62 // indicator
63 property QDBusActionGroup actionGroup: QDBusActionGroup {
64 busType: DBus.SessionBus
65 busName: "com.canonical.indicator.keyboard"
66 objectPath: "/com/canonical/indicator/keyboard"
67
68- property variant currentAction: action("current")
69- property variant activeAction: action("active")
70+ property variant currentAction: action("current") // the one that's checked by the indicator
71+ property variant activeAction: action("active") // the one that we clicked
72
73 Component.onCompleted: actionGroup.start();
74 }
75
76- onCurrentKeymapIndexChanged: {
77- actionGroup.currentAction.updateState(currentKeymapIndex);
78- }
79-
80 readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
81
82 onActiveActionStateChanged: {
83
84=== modified file 'tests/mocks/Unity/Application/MirMock.cpp'
85--- tests/mocks/Unity/Application/MirMock.cpp 2016-10-20 14:37:34 +0000
86+++ tests/mocks/Unity/Application/MirMock.cpp 2017-01-02 11:20:59 +0000
87@@ -47,3 +47,16 @@
88 {
89 return m_cursorName;
90 }
91+
92+QString MirMock::currentKeymap() const
93+{
94+ return m_keymap;
95+}
96+
97+void MirMock::setCurrentKeymap(const QString &keymap)
98+{
99+ if (keymap != m_keymap) {
100+ m_keymap = keymap;
101+ Q_EMIT currentKeymapChanged(m_keymap);
102+ }
103+}
104
105=== modified file 'tests/mocks/Unity/Application/MirMock.h'
106--- tests/mocks/Unity/Application/MirMock.h 2016-10-20 14:37:34 +0000
107+++ tests/mocks/Unity/Application/MirMock.h 2017-01-02 11:20:59 +0000
108@@ -31,9 +31,13 @@
109 void setCursorName(const QString &cursorName) override;
110 QString cursorName() const override;
111
112+ QString currentKeymap() const override;
113+ void setCurrentKeymap(const QString &keymap) override;
114+
115 private:
116 static MirMock *the_mir;
117 QString m_cursorName;
118+ QString m_keymap;
119 };
120
121 #endif

Subscribers

People subscribed via source and target branches