Merge lp:~unity-team/unity8/keymapSwitching into lp:unity8
- keymapSwitching
- Merge into trunk
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Michael Terry | ||||||||||||
Approved revision: | 2281 | ||||||||||||
Merged at revision: | 2291 | ||||||||||||
Proposed branch: | lp:~unity-team/unity8/keymapSwitching | ||||||||||||
Merge into: | lp:unity8 | ||||||||||||
Prerequisite: | lp:~unity-team/unity8/shell_chrome | ||||||||||||
Diff against target: |
634 lines (+265/-10) 20 files modified
plugins/AccountsService/AccountsService.cpp (+26/-0) plugins/AccountsService/AccountsService.h (+6/-0) qml/Shell.qml (+50/-0) qml/Stages/AbstractStage.qml (+1/-0) qml/Stages/ApplicationWindow.qml (+4/-0) qml/Stages/DesktopStage.qml (+4/-0) qml/Stages/PhoneStage.qml (+2/-0) qml/Stages/SpreadDelegate.qml (+1/-0) qml/Stages/SurfaceContainer.qml (+13/-0) qml/Stages/TabletStage.qml (+2/-0) tests/mocks/AccountsService/AccountsService.cpp (+17/-0) tests/mocks/AccountsService/AccountsService.h (+8/-0) tests/mocks/QMenuModel/QDBusActionGroup.qml (+5/-5) tests/mocks/Unity/Application/MirSurface.cpp (+18/-2) tests/mocks/Unity/Application/MirSurface.h (+5/-0) tests/plugins/AccountsService/PropertiesServer.cpp (+9/-0) tests/plugins/AccountsService/PropertiesServer.h (+0/-1) tests/plugins/AccountsService/client.cpp (+30/-0) tests/qmltests/Stages/tst_DesktopStage.qml (+0/-2) tests/qmltests/tst_Shell.qml (+64/-0) |
||||||||||||
To merge this branch: | bzr merge lp:~unity-team/unity8/keymapSwitching | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | Needs Information | ||
Michael Terry | Approve | ||
Unity8 CI Bot | continuous-integration | Approve | |
Review via email: mp+288842@code.launchpad.net |
This proposal supersedes a proposal from 2016-03-11.
Commit message
Keymap switching support
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
lp:~unity-team/unity-api/kbdLayout
lp:~unity-team/qtmir/kbdLayout
lp:~lukas-kde/qtubuntu/kbdLayout
* Did you perform an exploratory manual test run of your code change and any related functionality?
Will in silo
* Did you make sure that your branch does not contain spurious tags?
Y
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Y
* If you changed the UI, has there been a design review?
N/A
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
Michael Terry (mterry) wrote : Posted in a previous version of this proposal | # |
Some inline comments. Haven't reviewed test code yet. Am still setting up my phone to test these branches there.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2276
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2277
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2278
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2279. By Lukáš Tinkl
-
refine test for switching keymaps, move to tst_Shell
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2279
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Michael Terry (mterry) wrote : | # |
As mentioned in telegram, I think we can drop activeKeymap. And the qmltest should test going past the front / end of keymap list. But besides that, it looks fine. Haven't tested yet, waiting for silo to rebuild.
- 2280. By Lukáš Tinkl
-
remove activeKeymapIndex, refine tests
- 2281. By Lukáš Tinkl
-
remove debug
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2280
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Lukáš Tinkl (lukas-kde) wrote : | # |
> As mentioned in telegram, I think we can drop activeKeymap. And the qmltest
> should test going past the front / end of keymap list. But besides that, it
> looks fine. Haven't tested yet, waiting for silo to rebuild.
Fixed both issues
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2281
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Michael Terry (mterry) wrote : | # |
Note to self:
sudo gdbus call --system --dest org.freedesktop
Michael Terry (mterry) wrote : | # |
OK, worked fine in my testing. Modulo a crasher if you give invalid input. (bug 1557634) But that's not a blocker for now.
Thanks!
Daniel d'Andrada (dandrader) wrote : | # |
"""
function switchToKeymap(
var finalKeymap = keymap.split("+");
savedKeymap = keymap; // save the keymap in case the surface changes later
if (surface) {
}
}
"""
I know I'm late to the party, but as I'm rebasing surface-based WM on top of silo 041 I couldn't help frowning when I saw that.
This kind of imperative work doesn't belong to QML. Can't the surface have a property that takes the full string and does any and all parsing needed behind the scenes?
Something like that:
"""
SurfaceContainer {
id: root
property string keymap
Binding {
target: surface
property: "keymap"
value: root.keymap
}
}
"""
Daniel d'Andrada (dandrader) wrote : | # |
And as a continuation of the idea in my previous comment, in ApplicationWindow:
"""
function switchToKeymap(
}
"""
Would be something like:
"""
property alias keymap: sessionContaine
"""
Lukáš Tinkl (lukas-kde) wrote : | # |
Yeah, thanks for the comments, I'm totally aware this will need some rework with surface based WM (this and the switching based on the currently focused _app_, not surface).
Daniel d'Andrada (dandrader) wrote : | # |
My comments are not related to surface-based versus application-based WM. They are about imperative versus declarative code.
Preview Diff
1 | === modified file 'plugins/AccountsService/AccountsService.cpp' | |||
2 | --- plugins/AccountsService/AccountsService.cpp 2016-03-14 17:35:28 +0000 | |||
3 | +++ plugins/AccountsService/AccountsService.cpp 2016-03-14 17:35:29 +0000 | |||
4 | @@ -36,6 +36,7 @@ | |||
5 | 36 | #define PROP_ENABLE_INDICATORS_WHILE_LOCKED QStringLiteral("EnableIndicatorsWhileLocked") | 36 | #define PROP_ENABLE_INDICATORS_WHILE_LOCKED QStringLiteral("EnableIndicatorsWhileLocked") |
6 | 37 | #define PROP_ENABLE_LAUNCHER_WHILE_LOCKED QStringLiteral("EnableLauncherWhileLocked") | 37 | #define PROP_ENABLE_LAUNCHER_WHILE_LOCKED QStringLiteral("EnableLauncherWhileLocked") |
7 | 38 | #define PROP_FAILED_LOGINS QStringLiteral("FailedLogins") | 38 | #define PROP_FAILED_LOGINS QStringLiteral("FailedLogins") |
8 | 39 | #define PROP_INPUT_SOURCES QStringLiteral("InputSources") | ||
9 | 39 | #define PROP_LICENSE_ACCEPTED QStringLiteral("LicenseAccepted") | 40 | #define PROP_LICENSE_ACCEPTED QStringLiteral("LicenseAccepted") |
10 | 40 | #define PROP_LICENSE_BASE_PATH QStringLiteral("LicenseBasePath") | 41 | #define PROP_LICENSE_BASE_PATH QStringLiteral("LicenseBasePath") |
11 | 41 | #define PROP_MOUSE_CURSOR_SPEED QStringLiteral("MouseCursorSpeed") | 42 | #define PROP_MOUSE_CURSOR_SPEED QStringLiteral("MouseCursorSpeed") |
12 | @@ -54,6 +55,10 @@ | |||
13 | 54 | #define PROP_TOUCHPAD_TAP_TO_CLICK QStringLiteral("TouchpadTapToClick") | 55 | #define PROP_TOUCHPAD_TAP_TO_CLICK QStringLiteral("TouchpadTapToClick") |
14 | 55 | #define PROP_TOUCHPAD_TWO_FINGER_SCROLL QStringLiteral("TouchpadTwoFingerScroll") | 56 | #define PROP_TOUCHPAD_TWO_FINGER_SCROLL QStringLiteral("TouchpadTwoFingerScroll") |
15 | 56 | 57 | ||
16 | 58 | using StringMap = QMap<QString,QString>; | ||
17 | 59 | using StringMapList = QList<StringMap>; | ||
18 | 60 | Q_DECLARE_METATYPE(StringMapList) | ||
19 | 61 | |||
20 | 57 | 62 | ||
21 | 58 | QVariant primaryButtonConverter(const QVariant &value) | 63 | QVariant primaryButtonConverter(const QVariant &value) |
22 | 59 | { | 64 | { |
23 | @@ -82,6 +87,7 @@ | |||
24 | 82 | registerProperty(IFACE_ACCOUNTS_USER, PROP_BACKGROUND_FILE, QStringLiteral("backgroundFileChanged")); | 87 | registerProperty(IFACE_ACCOUNTS_USER, PROP_BACKGROUND_FILE, QStringLiteral("backgroundFileChanged")); |
25 | 83 | registerProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, QStringLiteral("emailChanged")); | 88 | registerProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, QStringLiteral("emailChanged")); |
26 | 84 | registerProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, QStringLiteral("realNameChanged")); | 89 | registerProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, QStringLiteral("realNameChanged")); |
27 | 90 | registerProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES, QStringLiteral("keymapsChanged")); | ||
28 | 85 | registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, QStringLiteral("hereEnabledChanged")); | 91 | registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, QStringLiteral("hereEnabledChanged")); |
29 | 86 | registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH, QStringLiteral("hereLicensePathChanged")); | 92 | registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH, QStringLiteral("hereLicensePathChanged")); |
30 | 87 | registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED, QStringLiteral("enableLauncherWhileLockedChanged")); | 93 | registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED, QStringLiteral("enableLauncherWhileLockedChanged")); |
31 | @@ -230,6 +236,26 @@ | |||
32 | 230 | setProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, email); | 236 | setProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, email); |
33 | 231 | } | 237 | } |
34 | 232 | 238 | ||
35 | 239 | QStringList AccountsService::keymaps() const | ||
36 | 240 | { | ||
37 | 241 | auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES); | ||
38 | 242 | QDBusArgument arg = value.value<QDBusArgument>(); | ||
39 | 243 | StringMapList maps = qdbus_cast<StringMapList>(arg); | ||
40 | 244 | QStringList simplifiedMaps; | ||
41 | 245 | |||
42 | 246 | Q_FOREACH(const StringMap &map, maps) { | ||
43 | 247 | Q_FOREACH(const QString &entry, map) { | ||
44 | 248 | simplifiedMaps.append(entry); | ||
45 | 249 | } | ||
46 | 250 | } | ||
47 | 251 | |||
48 | 252 | if (!simplifiedMaps.isEmpty()) { | ||
49 | 253 | return simplifiedMaps; | ||
50 | 254 | } | ||
51 | 255 | |||
52 | 256 | return {QStringLiteral("us")}; | ||
53 | 257 | } | ||
54 | 258 | |||
55 | 233 | uint AccountsService::failedLogins() const | 259 | uint AccountsService::failedLogins() const |
56 | 234 | { | 260 | { |
57 | 235 | return getProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS).toUInt(); | 261 | return getProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS).toUInt(); |
58 | 236 | 262 | ||
59 | === modified file 'plugins/AccountsService/AccountsService.h' | |||
60 | --- plugins/AccountsService/AccountsService.h 2016-03-14 17:35:28 +0000 | |||
61 | +++ plugins/AccountsService/AccountsService.h 2016-03-14 17:35:29 +0000 | |||
62 | @@ -20,6 +20,7 @@ | |||
63 | 20 | #include <QHash> | 20 | #include <QHash> |
64 | 21 | #include <QObject> | 21 | #include <QObject> |
65 | 22 | #include <QString> | 22 | #include <QString> |
66 | 23 | #include <QStringList> | ||
67 | 23 | #include <QVariant> | 24 | #include <QVariant> |
68 | 24 | 25 | ||
69 | 25 | class AccountsServiceDBusAdaptor; | 26 | class AccountsServiceDBusAdaptor; |
70 | @@ -68,6 +69,9 @@ | |||
71 | 68 | NOTIFY hereLicensePathChanged) | 69 | NOTIFY hereLicensePathChanged) |
72 | 69 | Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged) | 70 | Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged) |
73 | 70 | Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged) | 71 | Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged) |
74 | 72 | Q_PROPERTY(QStringList keymaps | ||
75 | 73 | READ keymaps | ||
76 | 74 | NOTIFY keymapsChanged) | ||
77 | 71 | 75 | ||
78 | 72 | public: | 76 | public: |
79 | 73 | enum PasswordDisplayHint { | 77 | enum PasswordDisplayHint { |
80 | @@ -97,6 +101,7 @@ | |||
81 | 97 | void setRealName(const QString &realName); | 101 | void setRealName(const QString &realName); |
82 | 98 | QString email() const; | 102 | QString email() const; |
83 | 99 | void setEmail(const QString &email); | 103 | void setEmail(const QString &email); |
84 | 104 | QStringList keymaps() const; | ||
85 | 100 | 105 | ||
86 | 101 | Q_SIGNALS: | 106 | Q_SIGNALS: |
87 | 102 | void userChanged(); | 107 | void userChanged(); |
88 | @@ -111,6 +116,7 @@ | |||
89 | 111 | void hereLicensePathChanged(); | 116 | void hereLicensePathChanged(); |
90 | 112 | void realNameChanged(); | 117 | void realNameChanged(); |
91 | 113 | void emailChanged(); | 118 | void emailChanged(); |
92 | 119 | void keymapsChanged(); | ||
93 | 114 | 120 | ||
94 | 115 | private Q_SLOTS: | 121 | private Q_SLOTS: |
95 | 116 | void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed); | 122 | void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed); |
96 | 117 | 123 | ||
97 | === modified file 'qml/Shell.qml' | |||
98 | --- qml/Shell.qml 2016-03-14 17:35:28 +0000 | |||
99 | +++ qml/Shell.qml 2016-03-14 17:35:29 +0000 | |||
100 | @@ -102,6 +102,8 @@ | |||
101 | 102 | // internal props from here onwards | 102 | // internal props from here onwards |
102 | 103 | readonly property var mainApp: | 103 | readonly property var mainApp: |
103 | 104 | applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainApp : null | 104 | applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainApp : null |
104 | 105 | readonly property var mainAppWindow: | ||
105 | 106 | applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainAppWindow : null | ||
106 | 105 | 107 | ||
107 | 106 | // Disable everything while greeter is waiting, so that the user can't swipe | 108 | // Disable everything while greeter is waiting, so that the user can't swipe |
108 | 107 | // the greeter or launcher until we know whether the session is locked. | 109 | // the greeter or launcher until we know whether the session is locked. |
109 | @@ -736,6 +738,54 @@ | |||
110 | 736 | onMouseMoved: { cursor.opacity = 1; } | 738 | onMouseMoved: { cursor.opacity = 1; } |
111 | 737 | } | 739 | } |
112 | 738 | 740 | ||
113 | 741 | // keymap switching | ||
114 | 742 | GlobalShortcut { | ||
115 | 743 | shortcut: Qt.MetaModifier|Qt.Key_Space | ||
116 | 744 | onTriggered: keymapPriv.nextKeymap() | ||
117 | 745 | active: keymapPriv.keymapCount > 1 | ||
118 | 746 | } | ||
119 | 747 | |||
120 | 748 | GlobalShortcut { | ||
121 | 749 | shortcut: Qt.MetaModifier|Qt.ShiftModifier|Qt.Key_Space | ||
122 | 750 | onTriggered: keymapPriv.previousKeymap() | ||
123 | 751 | active: keymapPriv.keymapCount > 1 | ||
124 | 752 | } | ||
125 | 753 | |||
126 | 754 | QtObject { | ||
127 | 755 | id: keymapPriv | ||
128 | 756 | |||
129 | 757 | readonly property var keymaps: AccountsService.keymaps | ||
130 | 758 | readonly property int keymapCount: keymaps.length | ||
131 | 759 | property int currentKeymapIndex: 0 // the new one that we're setting | ||
132 | 760 | onCurrentKeymapIndexChanged: switchToKeymap(); | ||
133 | 761 | |||
134 | 762 | function nextKeymap() { | ||
135 | 763 | var nextIndex = 0; | ||
136 | 764 | |||
137 | 765 | if (currentKeymapIndex !== -1 && currentKeymapIndex < keymapCount - 1) { | ||
138 | 766 | nextIndex = currentKeymapIndex + 1; | ||
139 | 767 | } | ||
140 | 768 | currentKeymapIndex = nextIndex; | ||
141 | 769 | } | ||
142 | 770 | |||
143 | 771 | function previousKeymap() { | ||
144 | 772 | var prevIndex = keymapCount - 1; | ||
145 | 773 | |||
146 | 774 | if (currentKeymapIndex > 0) { | ||
147 | 775 | prevIndex = currentKeymapIndex - 1; | ||
148 | 776 | } | ||
149 | 777 | currentKeymapIndex = prevIndex; | ||
150 | 778 | } | ||
151 | 779 | |||
152 | 780 | function switchToKeymap() { | ||
153 | 781 | if (mainAppWindow) { | ||
154 | 782 | mainAppWindow.switchToKeymap(keymaps[currentKeymapIndex]); | ||
155 | 783 | } | ||
156 | 784 | } | ||
157 | 785 | } | ||
158 | 786 | |||
159 | 787 | onMainAppWindowChanged: keymapPriv.switchToKeymap() | ||
160 | 788 | |||
161 | 739 | Rectangle { | 789 | Rectangle { |
162 | 740 | id: shutdownFadeOutRectangle | 790 | id: shutdownFadeOutRectangle |
163 | 741 | z: cursor.z + 1 | 791 | z: cursor.z + 1 |
164 | 742 | 792 | ||
165 | === modified file 'qml/Stages/AbstractStage.qml' | |||
166 | --- qml/Stages/AbstractStage.qml 2016-03-14 17:35:28 +0000 | |||
167 | +++ qml/Stages/AbstractStage.qml 2016-03-14 17:35:29 +0000 | |||
168 | @@ -44,6 +44,7 @@ | |||
169 | 44 | 44 | ||
170 | 45 | // To be read from outside | 45 | // To be read from outside |
171 | 46 | property var mainApp: null | 46 | property var mainApp: null |
172 | 47 | property var mainAppWindow: null | ||
173 | 47 | property int mainAppWindowOrientationAngle: 0 | 48 | property int mainAppWindowOrientationAngle: 0 |
174 | 48 | property bool orientationChangesEnabled | 49 | property bool orientationChangesEnabled |
175 | 49 | property int supportedOrientations: Qt.PortraitOrientation | 50 | property int supportedOrientations: Qt.PortraitOrientation |
176 | 50 | 51 | ||
177 | === modified file 'qml/Stages/ApplicationWindow.qml' | |||
178 | --- qml/Stages/ApplicationWindow.qml 2016-03-14 17:35:28 +0000 | |||
179 | +++ qml/Stages/ApplicationWindow.qml 2016-03-14 17:35:29 +0000 | |||
180 | @@ -39,6 +39,10 @@ | |||
181 | 39 | property int requestedWidth: -1 | 39 | property int requestedWidth: -1 |
182 | 40 | property int requestedHeight: -1 | 40 | property int requestedHeight: -1 |
183 | 41 | 41 | ||
184 | 42 | function switchToKeymap(keymap) { | ||
185 | 43 | sessionContainer.surfaceContainer.switchToKeymap(keymap); | ||
186 | 44 | } | ||
187 | 45 | |||
188 | 42 | readonly property int minimumWidth: sessionContainer.surface ? sessionContainer.surface.minimumWidth : 0 | 46 | readonly property int minimumWidth: sessionContainer.surface ? sessionContainer.surface.minimumWidth : 0 |
189 | 43 | readonly property int minimumHeight: sessionContainer.surface ? sessionContainer.surface.minimumHeight : 0 | 47 | readonly property int minimumHeight: sessionContainer.surface ? sessionContainer.surface.minimumHeight : 0 |
190 | 44 | readonly property int maximumWidth: sessionContainer.surface ? sessionContainer.surface.maximumWidth : 0 | 48 | readonly property int maximumWidth: sessionContainer.surface ? sessionContainer.surface.maximumWidth : 0 |
191 | 45 | 49 | ||
192 | === modified file 'qml/Stages/DesktopStage.qml' | |||
193 | --- qml/Stages/DesktopStage.qml 2016-03-14 17:35:28 +0000 | |||
194 | +++ qml/Stages/DesktopStage.qml 2016-03-14 17:35:29 +0000 | |||
195 | @@ -40,6 +40,8 @@ | |||
196 | 40 | ? ApplicationManager.findApplication(ApplicationManager.focusedApplicationId) | 40 | ? ApplicationManager.findApplication(ApplicationManager.focusedApplicationId) |
197 | 41 | : null | 41 | : null |
198 | 42 | 42 | ||
199 | 43 | mainAppWindow: priv.focusedAppDelegate ? priv.focusedAppDelegate.appWindow : null | ||
200 | 44 | |||
201 | 43 | // application windows never rotate independently | 45 | // application windows never rotate independently |
202 | 44 | mainAppWindowOrientationAngle: shellOrientationAngle | 46 | mainAppWindowOrientationAngle: shellOrientationAngle |
203 | 45 | 47 | ||
204 | @@ -284,6 +286,8 @@ | |||
205 | 284 | property bool visuallyMaximized: false | 286 | property bool visuallyMaximized: false |
206 | 285 | property bool visuallyMinimized: false | 287 | property bool visuallyMinimized: false |
207 | 286 | 288 | ||
208 | 289 | readonly property alias appWindow: decoratedWindow.window | ||
209 | 290 | |||
210 | 287 | onFocusChanged: { | 291 | onFocusChanged: { |
211 | 288 | if (focus && ApplicationManager.focusedApplicationId !== appId) { | 292 | if (focus && ApplicationManager.focusedApplicationId !== appId) { |
212 | 289 | ApplicationManager.focusApplication(appId); | 293 | ApplicationManager.focusApplication(appId); |
213 | 290 | 294 | ||
214 | === modified file 'qml/Stages/PhoneStage.qml' | |||
215 | --- qml/Stages/PhoneStage.qml 2016-03-14 17:35:28 +0000 | |||
216 | +++ qml/Stages/PhoneStage.qml 2016-03-14 17:35:29 +0000 | |||
217 | @@ -111,6 +111,8 @@ | |||
218 | 111 | ? applicationManager.findApplication(applicationManager.focusedApplicationId) | 111 | ? applicationManager.findApplication(applicationManager.focusedApplicationId) |
219 | 112 | : null | 112 | : null |
220 | 113 | 113 | ||
221 | 114 | mainAppWindow: priv.focusedAppDelegate ? priv.focusedAppDelegate.appWindow : null | ||
222 | 115 | |||
223 | 114 | orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled | 116 | orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled |
224 | 115 | && !priv.focusedAppDelegateIsDislocated | 117 | && !priv.focusedAppDelegateIsDislocated |
225 | 116 | && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running) | 118 | && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running) |
226 | 117 | 119 | ||
227 | === modified file 'qml/Stages/SpreadDelegate.qml' | |||
228 | --- qml/Stages/SpreadDelegate.qml 2016-03-14 17:35:28 +0000 | |||
229 | +++ qml/Stages/SpreadDelegate.qml 2016-03-14 17:35:29 +0000 | |||
230 | @@ -37,6 +37,7 @@ | |||
231 | 37 | | Qt.LandscapeOrientation | 37 | | Qt.LandscapeOrientation |
232 | 38 | | Qt.InvertedPortraitOrientation | 38 | | Qt.InvertedPortraitOrientation |
233 | 39 | | Qt.InvertedLandscapeOrientation | 39 | | Qt.InvertedLandscapeOrientation |
234 | 40 | readonly property alias appWindow: appWindow | ||
235 | 40 | 41 | ||
236 | 41 | // to be set from outside | 42 | // to be set from outside |
237 | 42 | property bool interactive: true | 43 | property bool interactive: true |
238 | 43 | 44 | ||
239 | === modified file 'qml/Stages/SurfaceContainer.qml' | |||
240 | --- qml/Stages/SurfaceContainer.qml 2016-03-14 17:35:28 +0000 | |||
241 | +++ qml/Stages/SurfaceContainer.qml 2016-03-14 17:35:29 +0000 | |||
242 | @@ -19,6 +19,7 @@ | |||
243 | 19 | import Ubuntu.Gestures 0.1 // For TouchGate | 19 | import Ubuntu.Gestures 0.1 // For TouchGate |
244 | 20 | import Utils 0.1 // for InputWatcher | 20 | import Utils 0.1 // for InputWatcher |
245 | 21 | import Unity.Application 0.1 // for MirSurfaceItem | 21 | import Unity.Application 0.1 // for MirSurfaceItem |
246 | 22 | import AccountsService 0.1 | ||
247 | 22 | 23 | ||
248 | 23 | FocusScope { | 24 | FocusScope { |
249 | 24 | id: root | 25 | id: root |
250 | @@ -34,10 +35,22 @@ | |||
251 | 34 | property int requestedWidth: -1 | 35 | property int requestedWidth: -1 |
252 | 35 | property int requestedHeight: -1 | 36 | property int requestedHeight: -1 |
253 | 36 | 37 | ||
254 | 38 | property string savedKeymap: AccountsService.keymaps[0] // start with the user default | ||
255 | 39 | |||
256 | 37 | onSurfaceChanged: { | 40 | onSurfaceChanged: { |
257 | 38 | if (surface) { | 41 | if (surface) { |
258 | 39 | surfaceItem.surface = surface; | 42 | surfaceItem.surface = surface; |
259 | 40 | root.hadSurface = false; | 43 | root.hadSurface = false; |
260 | 44 | switchToKeymap(savedKeymap); | ||
261 | 45 | } | ||
262 | 46 | } | ||
263 | 47 | |||
264 | 48 | function switchToKeymap(keymap) { | ||
265 | 49 | var finalKeymap = keymap.split("+"); | ||
266 | 50 | savedKeymap = keymap; // save the keymap in case the surface changes later | ||
267 | 51 | |||
268 | 52 | if (surface) { | ||
269 | 53 | surface.setKeymap(finalKeymap[0], finalKeymap[1] || ""); | ||
270 | 41 | } | 54 | } |
271 | 42 | } | 55 | } |
272 | 43 | 56 | ||
273 | 44 | 57 | ||
274 | === modified file 'qml/Stages/TabletStage.qml' | |||
275 | --- qml/Stages/TabletStage.qml 2016-03-14 17:35:28 +0000 | |||
276 | +++ qml/Stages/TabletStage.qml 2016-03-14 17:35:29 +0000 | |||
277 | @@ -76,6 +76,8 @@ | |||
278 | 76 | } | 76 | } |
279 | 77 | } | 77 | } |
280 | 78 | 78 | ||
281 | 79 | mainAppWindow: priv.focusedAppDelegate ? priv.focusedAppDelegate.appWindow : null | ||
282 | 80 | |||
283 | 79 | orientationChangesEnabled: priv.mainAppOrientationChangesEnabled | 81 | orientationChangesEnabled: priv.mainAppOrientationChangesEnabled |
284 | 80 | 82 | ||
285 | 81 | supportedOrientations: { | 83 | supportedOrientations: { |
286 | 82 | 84 | ||
287 | === modified file 'tests/mocks/AccountsService/AccountsService.cpp' | |||
288 | --- tests/mocks/AccountsService/AccountsService.cpp 2016-03-14 17:35:28 +0000 | |||
289 | +++ tests/mocks/AccountsService/AccountsService.cpp 2016-03-14 17:35:29 +0000 | |||
290 | @@ -172,3 +172,20 @@ | |||
291 | 172 | m_email = email; | 172 | m_email = email; |
292 | 173 | Q_EMIT emailChanged(); | 173 | Q_EMIT emailChanged(); |
293 | 174 | } | 174 | } |
294 | 175 | |||
295 | 176 | QStringList AccountsService::keymaps() const | ||
296 | 177 | { | ||
297 | 178 | if (!m_kbdMap.isEmpty()) { | ||
298 | 179 | return m_kbdMap; | ||
299 | 180 | } | ||
300 | 181 | |||
301 | 182 | return {QStringLiteral("us")}; | ||
302 | 183 | } | ||
303 | 184 | |||
304 | 185 | void AccountsService::setKeymaps(const QStringList &keymaps) | ||
305 | 186 | { | ||
306 | 187 | if (keymaps != m_kbdMap) { | ||
307 | 188 | m_kbdMap = keymaps; | ||
308 | 189 | Q_EMIT keymapsChanged(); | ||
309 | 190 | } | ||
310 | 191 | } | ||
311 | 175 | 192 | ||
312 | === modified file 'tests/mocks/AccountsService/AccountsService.h' | |||
313 | --- tests/mocks/AccountsService/AccountsService.h 2016-03-14 17:35:28 +0000 | |||
314 | +++ tests/mocks/AccountsService/AccountsService.h 2016-03-14 17:35:29 +0000 | |||
315 | @@ -69,6 +69,10 @@ | |||
316 | 69 | NOTIFY hereLicensePathChanged) | 69 | NOTIFY hereLicensePathChanged) |
317 | 70 | Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged) | 70 | Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged) |
318 | 71 | Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged) | 71 | Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged) |
319 | 72 | Q_PROPERTY(QStringList keymaps | ||
320 | 73 | READ keymaps | ||
321 | 74 | WRITE setKeymaps // only in mock | ||
322 | 75 | NOTIFY keymapsChanged) | ||
323 | 72 | 76 | ||
324 | 73 | public: | 77 | public: |
325 | 74 | enum PasswordDisplayHint { | 78 | enum PasswordDisplayHint { |
326 | @@ -102,6 +106,8 @@ | |||
327 | 102 | void setRealName(const QString &realName); | 106 | void setRealName(const QString &realName); |
328 | 103 | QString email() const; | 107 | QString email() const; |
329 | 104 | void setEmail(const QString &email); | 108 | void setEmail(const QString &email); |
330 | 109 | QStringList keymaps() const; | ||
331 | 110 | void setKeymaps(const QStringList &keymaps); | ||
332 | 105 | 111 | ||
333 | 106 | Q_SIGNALS: | 112 | Q_SIGNALS: |
334 | 107 | void userChanged(); | 113 | void userChanged(); |
335 | @@ -116,6 +122,7 @@ | |||
336 | 116 | void hereLicensePathChanged(); | 122 | void hereLicensePathChanged(); |
337 | 117 | void realNameChanged(); | 123 | void realNameChanged(); |
338 | 118 | void emailChanged(); | 124 | void emailChanged(); |
339 | 125 | void keymapsChanged(); | ||
340 | 119 | 126 | ||
341 | 120 | private: | 127 | private: |
342 | 121 | bool m_enableLauncherWhileLocked; | 128 | bool m_enableLauncherWhileLocked; |
343 | @@ -128,6 +135,7 @@ | |||
344 | 128 | bool m_hereEnabled; | 135 | bool m_hereEnabled; |
345 | 129 | QString m_hereLicensePath; | 136 | QString m_hereLicensePath; |
346 | 130 | QString m_realName; | 137 | QString m_realName; |
347 | 138 | QStringList m_kbdMap; | ||
348 | 131 | QString m_email; | 139 | QString m_email; |
349 | 132 | }; | 140 | }; |
350 | 133 | 141 | ||
351 | 134 | 142 | ||
352 | === modified file 'tests/mocks/QMenuModel/QDBusActionGroup.qml' | |||
353 | --- tests/mocks/QMenuModel/QDBusActionGroup.qml 2015-07-21 14:38:35 +0000 | |||
354 | +++ tests/mocks/QMenuModel/QDBusActionGroup.qml 2016-03-14 17:35:29 +0000 | |||
355 | @@ -1,8 +1,5 @@ | |||
356 | 1 | /* | 1 | /* |
361 | 2 | * Copyright (C) 2013 Canonical, Ltd. | 2 | * Copyright (C) 2013-2016 Canonical, Ltd. |
358 | 3 | * | ||
359 | 4 | * Authors: | ||
360 | 5 | * Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
362 | 6 | * | 3 | * |
363 | 7 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
364 | 8 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
365 | @@ -18,7 +15,6 @@ | |||
366 | 18 | */ | 15 | */ |
367 | 19 | 16 | ||
368 | 20 | import QtQuick 2.4 | 17 | import QtQuick 2.4 |
369 | 21 | import Ubuntu.Settings.Menus 0.1 as Menus | ||
370 | 22 | import QMenuModel 0.1 | 18 | import QMenuModel 0.1 |
371 | 23 | 19 | ||
372 | 24 | QtObject { | 20 | QtObject { |
373 | @@ -47,6 +43,10 @@ | |||
374 | 47 | function activate() { | 43 | function activate() { |
375 | 48 | activated(); | 44 | activated(); |
376 | 49 | } | 45 | } |
377 | 46 | |||
378 | 47 | function updateState(newState) { | ||
379 | 48 | state = newState; | ||
380 | 49 | } | ||
381 | 50 | }", actionGroup); | 50 | }", actionGroup); |
382 | 51 | } | 51 | } |
383 | 52 | } | 52 | } |
384 | 53 | 53 | ||
385 | === modified file 'tests/mocks/Unity/Application/MirSurface.cpp' | |||
386 | --- tests/mocks/Unity/Application/MirSurface.cpp 2016-03-14 17:35:28 +0000 | |||
387 | +++ tests/mocks/Unity/Application/MirSurface.cpp 2016-03-14 17:35:29 +0000 | |||
388 | @@ -134,7 +134,6 @@ | |||
389 | 134 | Q_EMIT orientationAngleChanged(angle); | 134 | Q_EMIT orientationAngleChanged(angle); |
390 | 135 | } | 135 | } |
391 | 136 | 136 | ||
392 | 137 | |||
393 | 138 | Mir::ShellChrome MirSurface::shellChrome() const | 137 | Mir::ShellChrome MirSurface::shellChrome() const |
394 | 139 | { | 138 | { |
395 | 140 | return m_shellChrome; | 139 | return m_shellChrome; |
396 | @@ -149,7 +148,24 @@ | |||
397 | 149 | Q_EMIT shellChromeChanged(shellChrome); | 148 | Q_EMIT shellChromeChanged(shellChrome); |
398 | 150 | } | 149 | } |
399 | 151 | 150 | ||
401 | 152 | 151 | QString MirSurface::keymapLayout() const | |
402 | 152 | { | ||
403 | 153 | return m_keyMap.first; | ||
404 | 154 | } | ||
405 | 155 | |||
406 | 156 | QString MirSurface::keymapVariant() const | ||
407 | 157 | { | ||
408 | 158 | return m_keyMap.second; | ||
409 | 159 | } | ||
410 | 160 | |||
411 | 161 | void MirSurface::setKeymap(const QString &layout, const QString &variant) | ||
412 | 162 | { | ||
413 | 163 | if (layout.isEmpty()) { | ||
414 | 164 | return; | ||
415 | 165 | } | ||
416 | 166 | m_keyMap = qMakePair(layout, variant); | ||
417 | 167 | Q_EMIT keymapChanged(layout, variant); | ||
418 | 168 | } | ||
419 | 153 | 169 | ||
420 | 154 | void MirSurface::registerView(qintptr viewId) | 170 | void MirSurface::registerView(qintptr viewId) |
421 | 155 | { | 171 | { |
422 | 156 | 172 | ||
423 | === modified file 'tests/mocks/Unity/Application/MirSurface.h' | |||
424 | --- tests/mocks/Unity/Application/MirSurface.h 2016-03-14 17:35:28 +0000 | |||
425 | +++ tests/mocks/Unity/Application/MirSurface.h 2016-03-14 17:35:29 +0000 | |||
426 | @@ -75,6 +75,9 @@ | |||
427 | 75 | int heightIncrement() const override { return m_heightIncrement; } | 75 | int heightIncrement() const override { return m_heightIncrement; } |
428 | 76 | 76 | ||
429 | 77 | Mir::ShellChrome shellChrome() const override; | 77 | Mir::ShellChrome shellChrome() const override; |
430 | 78 | QString keymapLayout() const override; | ||
431 | 79 | QString keymapVariant() const override; | ||
432 | 80 | Q_INVOKABLE void setKeymap(const QString &layout, const QString &variant) override; | ||
433 | 78 | 81 | ||
434 | 79 | //// | 82 | //// |
435 | 80 | // API for tests | 83 | // API for tests |
436 | @@ -158,6 +161,8 @@ | |||
437 | 158 | bool visible; | 161 | bool visible; |
438 | 159 | }; | 162 | }; |
439 | 160 | QHash<qintptr, View> m_views; | 163 | QHash<qintptr, View> m_views; |
440 | 164 | |||
441 | 165 | QPair<QString,QString> m_keyMap; // pair of layout+variant | ||
442 | 161 | }; | 166 | }; |
443 | 162 | 167 | ||
444 | 163 | #endif // MOCK_MIR_SURFACE_H | 168 | #endif // MOCK_MIR_SURFACE_H |
445 | 164 | 169 | ||
446 | === modified file 'tests/plugins/AccountsService/PropertiesServer.cpp' | |||
447 | --- tests/plugins/AccountsService/PropertiesServer.cpp 2016-03-10 22:42:54 +0000 | |||
448 | +++ tests/plugins/AccountsService/PropertiesServer.cpp 2016-03-14 17:35:29 +0000 | |||
449 | @@ -25,10 +25,16 @@ | |||
450 | 25 | #include <QDBusMessage> | 25 | #include <QDBusMessage> |
451 | 26 | #include <QDBusMetaType> | 26 | #include <QDBusMetaType> |
452 | 27 | 27 | ||
453 | 28 | using StringMap = QMap<QString,QString>; | ||
454 | 29 | using StringMapList = QList<StringMap>; | ||
455 | 30 | Q_DECLARE_METATYPE(StringMapList) | ||
456 | 31 | |||
457 | 28 | PropertiesServer::PropertiesServer(QObject *parent) | 32 | PropertiesServer::PropertiesServer(QObject *parent) |
458 | 29 | : QObject(parent) | 33 | : QObject(parent) |
459 | 30 | { | 34 | { |
460 | 31 | qDBusRegisterMetaType<QList<QVariantMap>>(); | 35 | qDBusRegisterMetaType<QList<QVariantMap>>(); |
461 | 36 | qDBusRegisterMetaType<StringMap>(); | ||
462 | 37 | qDBusRegisterMetaType<StringMapList>(); | ||
463 | 32 | Reset(); | 38 | Reset(); |
464 | 33 | } | 39 | } |
465 | 34 | 40 | ||
466 | @@ -63,6 +69,8 @@ | |||
467 | 63 | if (interface == QStringLiteral("com.canonical.unity.AccountsService") && | 69 | if (interface == QStringLiteral("com.canonical.unity.AccountsService") && |
468 | 64 | property == QStringLiteral("LauncherItems")) { | 70 | property == QStringLiteral("LauncherItems")) { |
469 | 65 | newValue = QVariant::fromValue(qdbus_cast<QList<QVariantMap>>(newValue.value<QDBusArgument>())); | 71 | newValue = QVariant::fromValue(qdbus_cast<QList<QVariantMap>>(newValue.value<QDBusArgument>())); |
470 | 72 | } else if (interface == "org.freedesktop.Accounts.User" && property == "InputSources") { | ||
471 | 73 | newValue = QVariant::fromValue(qdbus_cast<StringMapList>(newValue.value<QDBusArgument>())); | ||
472 | 66 | } | 74 | } |
473 | 67 | 75 | ||
474 | 68 | oldValue = newValue; | 76 | oldValue = newValue; |
475 | @@ -100,4 +108,5 @@ | |||
476 | 100 | m_properties["com.ubuntu.location.providers.here.AccountsService"]["LicenseBasePath"] = ""; | 108 | m_properties["com.ubuntu.location.providers.here.AccountsService"]["LicenseBasePath"] = ""; |
477 | 101 | m_properties["org.freedesktop.Accounts.User"]["BackgroundFile"] = ""; | 109 | m_properties["org.freedesktop.Accounts.User"]["BackgroundFile"] = ""; |
478 | 102 | m_properties["org.freedesktop.Accounts.User"]["RealName"] = ""; | 110 | m_properties["org.freedesktop.Accounts.User"]["RealName"] = ""; |
479 | 111 | m_properties["org.freedesktop.Accounts.User"]["InputSources"] = QVariant::fromValue(StringMapList()); | ||
480 | 103 | } | 112 | } |
481 | 104 | 113 | ||
482 | === modified file 'tests/plugins/AccountsService/PropertiesServer.h' | |||
483 | --- tests/plugins/AccountsService/PropertiesServer.h 2016-02-09 13:58:35 +0000 | |||
484 | +++ tests/plugins/AccountsService/PropertiesServer.h 2016-03-14 17:35:29 +0000 | |||
485 | @@ -20,7 +20,6 @@ | |||
486 | 20 | #ifndef UNITY_PROPERTIESSERVER_H | 20 | #ifndef UNITY_PROPERTIESSERVER_H |
487 | 21 | #define UNITY_PROPERTIESSERVER_H | 21 | #define UNITY_PROPERTIESSERVER_H |
488 | 22 | 22 | ||
489 | 23 | #include "PropertiesServer.h" | ||
490 | 24 | #include <QDBusContext> | 23 | #include <QDBusContext> |
491 | 25 | #include <QDBusVariant> | 24 | #include <QDBusVariant> |
492 | 26 | #include <QObject> | 25 | #include <QObject> |
493 | 27 | 26 | ||
494 | === modified file 'tests/plugins/AccountsService/client.cpp' | |||
495 | --- tests/plugins/AccountsService/client.cpp 2016-02-25 10:57:17 +0000 | |||
496 | +++ tests/plugins/AccountsService/client.cpp 2016-03-14 17:35:29 +0000 | |||
497 | @@ -23,6 +23,11 @@ | |||
498 | 23 | #include <QTest> | 23 | #include <QTest> |
499 | 24 | #include <QDebug> | 24 | #include <QDebug> |
500 | 25 | #include <QDBusReply> | 25 | #include <QDBusReply> |
501 | 26 | #include <QDBusMetaType> | ||
502 | 27 | |||
503 | 28 | using StringMap = QMap<QString,QString>; | ||
504 | 29 | using StringMapList = QList<StringMap>; | ||
505 | 30 | Q_DECLARE_METATYPE(StringMapList) | ||
506 | 26 | 31 | ||
507 | 27 | template <class T> | 32 | template <class T> |
508 | 28 | QVariant dbusVariant(const T& value) { return QVariant::fromValue(QDBusVariant(value)); } | 33 | QVariant dbusVariant(const T& value) { return QVariant::fromValue(QDBusVariant(value)); } |
509 | @@ -52,6 +57,9 @@ | |||
510 | 52 | 57 | ||
511 | 53 | QObject::connect(m_uscInputInterface, SIGNAL(setMousePrimaryButtonCalled(int)), | 58 | QObject::connect(m_uscInputInterface, SIGNAL(setMousePrimaryButtonCalled(int)), |
512 | 54 | this, SIGNAL(setMousePrimaryButtonCalled(int))); | 59 | this, SIGNAL(setMousePrimaryButtonCalled(int))); |
513 | 60 | |||
514 | 61 | qDBusRegisterMetaType<StringMap>(); | ||
515 | 62 | qDBusRegisterMetaType<StringMapList>(); | ||
516 | 55 | } | 63 | } |
517 | 56 | 64 | ||
518 | 57 | private Q_SLOTS: | 65 | private Q_SLOTS: |
519 | @@ -266,6 +274,28 @@ | |||
520 | 266 | QCOMPARE(arguments.at(0).toInt(), 0); | 274 | QCOMPARE(arguments.at(0).toInt(), 0); |
521 | 267 | } | 275 | } |
522 | 268 | 276 | ||
523 | 277 | void testAsynchronousChangeForKeymaps() | ||
524 | 278 | { | ||
525 | 279 | AccountsService session(this, QTest::currentTestFunction()); | ||
526 | 280 | |||
527 | 281 | QCOMPARE(session.keymaps(), {"us"}); | ||
528 | 282 | |||
529 | 283 | StringMapList inputSources; | ||
530 | 284 | StringMap map1; | ||
531 | 285 | map1.insert("xkb", "cz+qwerty"); | ||
532 | 286 | inputSources.append(map1); | ||
533 | 287 | StringMap map2; | ||
534 | 288 | map2.insert("xkb", "fr"); | ||
535 | 289 | inputSources.append(map2); | ||
536 | 290 | |||
537 | 291 | ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set", | ||
538 | 292 | "org.freedesktop.Accounts.User", | ||
539 | 293 | "InputSources", | ||
540 | 294 | QVariant::fromValue(QDBusVariant(QVariant::fromValue(inputSources))))); | ||
541 | 295 | QStringList result = {"cz+qwerty", "fr"}; | ||
542 | 296 | QTRY_COMPARE(session.keymaps(), result); | ||
543 | 297 | } | ||
544 | 298 | |||
545 | 269 | Q_SIGNALS: | 299 | Q_SIGNALS: |
546 | 270 | void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid); | 300 | void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid); |
547 | 271 | void setMousePrimaryButtonCalled(int button); | 301 | void setMousePrimaryButtonCalled(int button); |
548 | 272 | 302 | ||
549 | === modified file 'tests/qmltests/Stages/tst_DesktopStage.qml' | |||
550 | --- tests/qmltests/Stages/tst_DesktopStage.qml 2016-02-15 17:18:15 +0000 | |||
551 | +++ tests/qmltests/Stages/tst_DesktopStage.qml 2016-03-14 17:35:29 +0000 | |||
552 | @@ -510,8 +510,6 @@ | |||
553 | 510 | } | 510 | } |
554 | 511 | 511 | ||
555 | 512 | function test_dropShadow() { | 512 | function test_dropShadow() { |
556 | 513 | killAllRunningApps(); | ||
557 | 514 | |||
558 | 515 | // verify the drop shadow is not visible initially | 513 | // verify the drop shadow is not visible initially |
559 | 516 | verify(PanelState.dropShadow == false); | 514 | verify(PanelState.dropShadow == false); |
560 | 517 | 515 | ||
561 | 518 | 516 | ||
562 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
563 | --- tests/qmltests/tst_Shell.qml 2016-03-14 17:35:28 +0000 | |||
564 | +++ tests/qmltests/tst_Shell.qml 2016-03-14 17:35:29 +0000 | |||
565 | @@ -2274,5 +2274,69 @@ | |||
566 | 2274 | compare(topmostSurfaceItem.touchPressCount, 2); | 2274 | compare(topmostSurfaceItem.touchPressCount, 2); |
567 | 2275 | compare(topmostSurfaceItem.touchReleaseCount, 2); | 2275 | compare(topmostSurfaceItem.touchReleaseCount, 2); |
568 | 2276 | } | 2276 | } |
569 | 2277 | |||
570 | 2278 | function test_switchKeymap() { | ||
571 | 2279 | // start with phone shell | ||
572 | 2280 | loadShell("phone"); | ||
573 | 2281 | shell.usageScenario = "shell"; | ||
574 | 2282 | waitForRendering(shell); | ||
575 | 2283 | swipeAwayGreeter(); | ||
576 | 2284 | |||
577 | 2285 | // configure keymaps | ||
578 | 2286 | AccountsService.keymaps = ["sk", "cz+qwerty", "fr"] // "configure" the keymaps for user | ||
579 | 2287 | |||
580 | 2288 | // start some app | ||
581 | 2289 | var app = ApplicationManager.startApplication("dialer-app"); | ||
582 | 2290 | waitUntilAppWindowIsFullyLoaded(app); | ||
583 | 2291 | |||
584 | 2292 | // verify the initial keymap of the newly started app is the first one from the list | ||
585 | 2293 | tryCompare(app.session.lastSurface, "keymapLayout", "sk"); | ||
586 | 2294 | tryCompare(app.session.lastSurface, "keymapVariant", ""); | ||
587 | 2295 | |||
588 | 2296 | // switch to next keymap, should go to "cz+qwerty" | ||
589 | 2297 | keyClick(Qt.Key_Space, Qt.MetaModifier); | ||
590 | 2298 | tryCompare(app.session.lastSurface, "keymapLayout", "cz"); | ||
591 | 2299 | tryCompare(app.session.lastSurface, "keymapVariant", "qwerty"); | ||
592 | 2300 | |||
593 | 2301 | // switch to next keymap, should go to "fr" | ||
594 | 2302 | keyClick(Qt.Key_Space, Qt.MetaModifier); | ||
595 | 2303 | |||
596 | 2304 | // go to e.g. desktop stage | ||
597 | 2305 | loadShell("desktop"); | ||
598 | 2306 | shell.usageScenario = "desktop"; | ||
599 | 2307 | waitForRendering(shell); | ||
600 | 2308 | |||
601 | 2309 | // start a second app, should get the last configured keyboard, "fr" | ||
602 | 2310 | var app2 = ApplicationManager.startApplication("calendar-app"); | ||
603 | 2311 | waitUntilAppWindowIsFullyLoaded(app2); | ||
604 | 2312 | tryCompare(app2.session.lastSurface, "keymapLayout", "fr"); | ||
605 | 2313 | tryCompare(app2.session.lastSurface, "keymapVariant", ""); | ||
606 | 2314 | |||
607 | 2315 | // focus our first app, make sure it also has the "fr" keymap | ||
608 | 2316 | ApplicationManager.requestFocusApplication("dialer-app"); | ||
609 | 2317 | tryCompare(app.session.lastSurface, "keymapLayout", "fr"); | ||
610 | 2318 | tryCompare(app.session.lastSurface, "keymapVariant", ""); | ||
611 | 2319 | |||
612 | 2320 | // switch to previous keymap, should be "cz+qwerty" | ||
613 | 2321 | keyClick(Qt.Key_Space, Qt.MetaModifier|Qt.ShiftModifier); | ||
614 | 2322 | tryCompare(app.session.lastSurface, "keymapLayout", "cz"); | ||
615 | 2323 | tryCompare(app.session.lastSurface, "keymapVariant", "qwerty"); | ||
616 | 2324 | |||
617 | 2325 | // go next twice to "sk", past the end | ||
618 | 2326 | keyClick(Qt.Key_Space, Qt.MetaModifier); | ||
619 | 2327 | keyClick(Qt.Key_Space, Qt.MetaModifier); | ||
620 | 2328 | tryCompare(app.session.lastSurface, "keymapLayout", "sk"); | ||
621 | 2329 | tryCompare(app.session.lastSurface, "keymapVariant", ""); | ||
622 | 2330 | |||
623 | 2331 | // go back once to past the beginning, to "fr" | ||
624 | 2332 | keyClick(Qt.Key_Space, Qt.MetaModifier|Qt.ShiftModifier); | ||
625 | 2333 | tryCompare(app.session.lastSurface, "keymapLayout", "fr"); | ||
626 | 2334 | tryCompare(app.session.lastSurface, "keymapVariant", ""); | ||
627 | 2335 | |||
628 | 2336 | // switch to app2, should also get "fr" | ||
629 | 2337 | ApplicationManager.requestFocusApplication("calendar-app"); | ||
630 | 2338 | tryCompare(app2.session.lastSurface, "keymapLayout", "fr"); | ||
631 | 2339 | tryCompare(app2.session.lastSurface, "keymapVariant", ""); | ||
632 | 2340 | } | ||
633 | 2277 | } | 2341 | } |
634 | 2278 | } | 2342 | } |
FAILED: Continuous integration, rev:2275 /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/674/ /unity8- jenkins. ubuntu. com/job/ build-0- fetch/887 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 903 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 903 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 901/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial/ 901/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 901/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial/ 901/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 901/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial/ 901/console
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/674/ rebuild
https:/