Merge lp:~ci-train-bot/unity8/unity8-ubuntu-xenial-landing-058 into lp:unity8

Proposed by Michał Sawicz
Status: Work in progress
Proposed branch: lp:~ci-train-bot/unity8/unity8-ubuntu-xenial-landing-058
Merge into: lp:unity8
Diff against target: 457 lines (+137/-46)
15 files modified
debian/changelog (+20/-0)
po/unity8.pot (+2/-2)
qml/Components/InputMethod.qml (+2/-2)
qml/DisabledScreenNotice.qml (+7/-0)
qml/Notifications/NotificationMenuItemFactory.qml (+1/-0)
qml/Panel/Indicators/MenuItemFactory.qml (+2/-2)
qml/Panel/Panel.qml (+6/-15)
qml/Stages/SurfaceContainer.qml (+3/-0)
qml/Stages/TabletStage.qml (+4/-3)
tests/mocks/Unity/Application/MirSurfaceItem.cpp (+16/-7)
tests/mocks/Unity/Application/MirSurfaceItem.h (+1/-1)
tests/mocks/Utils/windowstatestorage.cpp (+1/-0)
tests/mocks/Utils/windowstatestorage.h (+3/-0)
tests/qmltests/Stages/tst_TabletStage.qml (+66/-2)
tests/qmltests/Wizard/tst_Wizard.qml (+3/-12)
To merge this branch: bzr merge lp:~ci-train-bot/unity8/unity8-ubuntu-xenial-landing-058
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+295171@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

2405. By CI Train Bot Account

Releasing 8.12+16.04.20160518.2-0ubuntu1

2404. By Lukáš Tinkl

Stabilize flaky wizard tests Fixes: #1582994
Approved by: Michael Terry

2403. By Michael Zanetti

fix the SIM PIN darkening after it got removed accidentally Fixes: #1577147
Approved by: Lukáš Tinkl

2402. By Lukáš Tinkl

Don't dim screen when the indicators are open Fixes: #1564342
Approved by: Michael Zanetti

2401. By Lukáš Tinkl

Fix upcoming alarms ETA labels Fixes: #1576741
Approved by: Albert Astals Cid

2400. By Nick Dedekind

Fixed saving current stage and loss of surface focus when switching stages

2399. By Nick Dedekind

Fixed incorrect osk surface item resizing the surface.
Approved by: Daniel d'Andrada

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-05-18 11:20:04 +0000
3+++ debian/changelog 2016-05-19 08:20:26 +0000
4@@ -1,3 +1,23 @@
5+unity8 (8.12+16.04.20160518.2-0ubuntu1) xenial; urgency=medium
6+
7+ [ Lukáš Tinkl ]
8+ * Don't dim screen when the indicators are open (LP: #1564342)
9+ * Fix upcoming alarms ETA labels (LP: #1576741)
10+ * Stabilize flaky wizard tests (LP: #1582994)
11+
12+ [ Michael Zanetti ]
13+ * fix the SIM PIN darkening after it got removed accidentally (LP:
14+ #1577147)
15+
16+ [ Michał Sawicz, Nick Dedekind ]
17+ * Fixed saving current stage and loss of surface focus when switching
18+ stages
19+
20+ [ Nick Dedekind ]
21+ * Fixed incorrect osk surface item resizing the surface.
22+
23+ -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 18 May 2016 22:02:39 +0000
24+
25 unity8 (8.12+16.04.20160518.1-0ubuntu1) xenial; urgency=medium
26
27 [ CI Train Bot ]
28
29=== modified file 'po/unity8.pot'
30--- po/unity8.pot 2016-05-18 11:20:04 +0000
31+++ po/unity8.pot 2016-05-19 08:20:26 +0000
32@@ -8,7 +8,7 @@
33 msgstr ""
34 "Project-Id-Version: unity8\n"
35 "Report-Msgid-Bugs-To: \n"
36-"POT-Creation-Date: 2016-05-18 11:19+0000\n"
37+"POT-Creation-Date: 2016-05-18 22:02+0000\n"
38 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
39 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
40 "Language-Team: LANGUAGE <LL@li.org>\n"
41@@ -256,7 +256,7 @@
42 msgid "Also installed"
43 msgstr ""
44
45-#: qml/DisabledScreenNotice.qml:104
46+#: qml/DisabledScreenNotice.qml:109
47 msgid ""
48 "Your device is now connected to an external display. Use this screen as a "
49 "touch pad to interact with the pointer."
50
51=== modified file 'qml/Components/InputMethod.qml'
52--- qml/Components/InputMethod.qml 2016-03-29 03:47:39 +0000
53+++ qml/Components/InputMethod.qml 2016-05-19 08:20:26 +0000
54@@ -30,8 +30,8 @@
55
56 consumesInput: true
57
58- surfaceWidth: width
59- surfaceHeight: height
60+ surfaceWidth: root.enabled ? width : -1
61+ surfaceHeight: root.enabled ? height : -1
62 surface: SurfaceManager.inputMethodSurface
63
64 onLiveChanged: {
65
66=== modified file 'qml/DisabledScreenNotice.qml'
67--- qml/DisabledScreenNotice.qml 2016-02-18 19:50:30 +0000
68+++ qml/DisabledScreenNotice.qml 2016-05-19 08:20:26 +0000
69@@ -18,6 +18,7 @@
70 import QtQuick.Layouts 1.1
71 import Ubuntu.Components 1.3
72 import Unity.Session 0.1
73+import Unity.Screens 0.1
74 import QtQuick.Window 2.2
75 import "Components"
76
77@@ -35,6 +36,10 @@
78 name: applicationArguments.deviceName
79 }
80
81+ Screens {
82+ id: screens
83+ }
84+
85 Item {
86 id: contentContainer
87 objectName: "contentContainer"
88@@ -119,6 +124,8 @@
89
90 InputMethod {
91 id: inputMethod
92+ // Don't resize when there is only one screen to avoid resize clashing with the InputMethod in the Shell.
93+ enabled: screens.count > 1
94 objectName: "inputMethod"
95 anchors.fill: parent
96 }
97
98=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
99--- qml/Notifications/NotificationMenuItemFactory.qml 2016-04-05 19:29:33 +0000
100+++ qml/Notifications/NotificationMenuItemFactory.qml 2016-05-19 08:20:26 +0000
101@@ -146,6 +146,7 @@
102 errorText: errorAction.valid ? errorAction.state : ""
103 retryText: notification.body
104 background: menuFactory.background
105+ darkenBackground: 0.4
106
107 onEntered: {
108 menuModel.changeState(menuIndex, passphrase);
109
110=== modified file 'qml/Panel/Indicators/MenuItemFactory.qml'
111--- qml/Panel/Indicators/MenuItemFactory.qml 2016-04-27 15:01:10 +0000
112+++ qml/Panel/Indicators/MenuItemFactory.qml 2016-05-19 08:20:26 +0000
113@@ -377,11 +377,11 @@
114 property int menuIndex: -1
115 property var extendedData: menuData && menuData.ext || undefined
116
117- property date serverTime: new Date(getExtendedProperty(extendedData, "xCanonicalTime", 0) * 1000)
118+ readonly property date serverTime: new Date(getExtendedProperty(extendedData, "xCanonicalTime", 0) * 1000)
119 LiveTimer {
120 frequency: LiveTimer.Relative
121 relativeTime: alarmItem.serverTime
122- onTrigger: alarmItem.serverTime = new Date(getExtendedProperty(extendedData, "xCanonicalTime", 0) * 1000)
123+ onTrigger: alarmItem.time = i18n.relativeDateTime(alarmItem.serverTime)
124 }
125
126 text: menuData && menuData.label || ""
127
128=== modified file 'qml/Panel/Panel.qml'
129--- qml/Panel/Panel.qml 2016-04-27 15:01:10 +0000
130+++ qml/Panel/Panel.qml 2016-05-19 08:20:26 +0000
131@@ -30,22 +30,13 @@
132 property real indicatorAreaShowProgress: 1.0
133 property bool locked: false
134
135- Rectangle {
136- id: darkenedArea
137- property real darkenedOpacity: 0.6
138- anchors {
139- fill: parent
140- topMargin: panelHeight
141- }
142- color: "black"
143- opacity: indicators.unitProgress * darkenedOpacity
144+ MouseArea {
145+ anchors.fill: parent
146+ anchors.topMargin: panelHeight
147 visible: !indicators.fullyClosed
148-
149- MouseArea {
150- anchors.fill: parent
151- onClicked: if (indicators.fullyOpened) indicators.hide();
152- hoverEnabled: true // should also eat hover events, otherwise they will pass through
153- }
154+ enabled: visible
155+ onClicked: if (indicators.fullyOpened) indicators.hide();
156+ hoverEnabled: true // should also eat hover events, otherwise they will pass through
157 }
158
159 Binding {
160
161=== modified file 'qml/Stages/SurfaceContainer.qml'
162--- qml/Stages/SurfaceContainer.qml 2016-05-17 19:25:23 +0000
163+++ qml/Stages/SurfaceContainer.qml 2016-05-19 08:20:26 +0000
164@@ -34,6 +34,9 @@
165 property int surfaceOrientationAngle: 0
166 property bool resizeSurface: true
167 property bool isPromptSurface: false
168+ // FIME - dont export, use interactive property. Need to fix qtmir to handle consumesInputChanged
169+ // to update surface activeFocus. See mock MirSurfaceItem.
170+ property alias consumesInput: surfaceItem.consumesInput
171
172 onSurfaceChanged: {
173 // Not a binding because animations might remove the surface from the surfaceItem
174
175=== modified file 'qml/Stages/TabletStage.qml'
176--- qml/Stages/TabletStage.qml 2016-04-29 20:07:21 +0000
177+++ qml/Stages/TabletStage.qml 2016-05-19 08:20:26 +0000
178@@ -752,7 +752,7 @@
179
180 readonly property bool wantsMainStage: stage == ApplicationInfoInterface.MainStage
181
182- readonly property bool isDash: model.application.appId == "unity8-dash"
183+ readonly property bool isDash: application.appId == "unity8-dash"
184
185 onFocusChanged: {
186 if (focus && !spreadRepeater.startingUp) {
187@@ -768,7 +768,7 @@
188 onFocusRequested: spreadTile.focus = true;
189 }
190 Connections {
191- target: model.application
192+ target: spreadTile.application
193 onFocusRequested: {
194 if (!model.surface) {
195 // when an app has no surfaces, we assume there's only one entry representing it:
196@@ -844,7 +844,7 @@
197 _constructing = false;
198 }
199 Component.onDestruction: {
200- WindowStateStorage.saveStage(model.application.appId, stage);
201+ WindowStateStorage.saveStage(application.appId, stage);
202 }
203
204 function refreshStage() {
205@@ -1073,6 +1073,7 @@
206
207 surface: spreadDelegate ? spreadDelegate.surface : null
208
209+ consumesInput: false
210 interactive: false
211 resizeSurface: false
212 focus: false
213
214=== modified file 'tests/mocks/Unity/Application/MirSurfaceItem.cpp'
215--- tests/mocks/Unity/Application/MirSurfaceItem.cpp 2016-04-27 15:01:10 +0000
216+++ tests/mocks/Unity/Application/MirSurfaceItem.cpp 2016-05-19 08:20:26 +0000
217@@ -56,7 +56,11 @@
218 Qt::ExtraButton9 | Qt::ExtraButton10 | Qt::ExtraButton11 |
219 Qt::ExtraButton12 | Qt::ExtraButton13);
220
221+ connect(this, &QQuickItem::activeFocusChanged, this, &MirSurfaceItem::updateMirSurfaceActiveFocus);
222 connect(this, &QQuickItem::visibleChanged, this, &MirSurfaceItem::updateMirSurfaceVisibility);
223+ connect(this, &MirSurfaceItem::consumesInputChanged, this, [this]() {
224+ updateMirSurfaceActiveFocus(hasActiveFocus());
225+ });
226 }
227
228 MirSurfaceItem::~MirSurfaceItem()
229@@ -234,6 +238,10 @@
230 delete m_qmlContentComponent;
231 m_qmlContentComponent = nullptr;
232
233+ if (hasActiveFocus() && m_consumesInput && m_qmlSurface->live()) {
234+ m_qmlSurface->setActiveFocus(false);
235+ }
236+
237 disconnect(m_qmlSurface, nullptr, this, nullptr);
238 m_qmlSurface->unregisterView((qintptr)this);
239 }
240@@ -243,8 +251,6 @@
241 if (m_qmlSurface) {
242 m_qmlSurface->registerView((qintptr)this);
243
244- m_qmlSurface->setActiveFocus(hasActiveFocus());
245-
246 updateSurfaceSize();
247 updateMirSurfaceVisibility();
248
249@@ -277,17 +283,20 @@
250 default:
251 qFatal("MirSurfaceItem: Unhandled component status");
252 }
253+
254+ if (m_consumesInput) {
255+ m_qmlSurface->setActiveFocus(hasActiveFocus());
256+ }
257 }
258
259 Q_EMIT surfaceChanged(m_qmlSurface);
260 }
261
262-void MirSurfaceItem::itemChange(ItemChange change, const ItemChangeData & value)
263+
264+void MirSurfaceItem::updateMirSurfaceActiveFocus(bool focused)
265 {
266- if (change == QQuickItem::ItemActiveFocusHasChanged) {
267- if (m_qmlSurface) {
268- m_qmlSurface->setActiveFocus(value.boolValue);
269- }
270+ if (m_qmlSurface && m_consumesInput && m_qmlSurface->live()) {
271+ m_qmlSurface->setActiveFocus(focused);
272 }
273 }
274
275
276=== modified file 'tests/mocks/Unity/Application/MirSurfaceItem.h'
277--- tests/mocks/Unity/Application/MirSurfaceItem.h 2016-03-29 03:47:39 +0000
278+++ tests/mocks/Unity/Application/MirSurfaceItem.h 2016-05-19 08:20:26 +0000
279@@ -98,12 +98,12 @@
280 void mousePressEvent(QMouseEvent * event) override;
281 void mouseMoveEvent(QMouseEvent * event) override;
282 void mouseReleaseEvent(QMouseEvent * event) override;
283- void itemChange(ItemChange change, const ItemChangeData & value) override;
284
285 private Q_SLOTS:
286 void onComponentStatusChanged(QQmlComponent::Status status);
287 void updateScreenshot(QUrl screenshot);
288 void updateMirSurfaceVisibility();
289+ void updateMirSurfaceActiveFocus(bool focused);
290
291 private:
292 void createQmlContentItem();
293
294=== modified file 'tests/mocks/Utils/windowstatestorage.cpp'
295--- tests/mocks/Utils/windowstatestorage.cpp 2016-03-29 03:47:39 +0000
296+++ tests/mocks/Utils/windowstatestorage.cpp 2016-05-19 08:20:26 +0000
297@@ -50,6 +50,7 @@
298 void WindowStateStorage::saveStage(const QString &appId, int stage)
299 {
300 m_stage[appId] = stage;
301+ Q_EMIT stageSaved(appId, stage);
302 }
303
304 int WindowStateStorage::getStage(const QString &appId) const
305
306=== modified file 'tests/mocks/Utils/windowstatestorage.h'
307--- tests/mocks/Utils/windowstatestorage.h 2016-03-29 03:47:39 +0000
308+++ tests/mocks/Utils/windowstatestorage.h 2016-05-19 08:20:26 +0000
309@@ -45,6 +45,9 @@
310 Q_SIGNALS:
311 void geometryChanged(const QVariantMap& geometry);
312
313+ // For testing.
314+ void stageSaved(const QString& appId, int stage);
315+
316 private:
317 void setGeometry(const QVariantMap& geometry);
318 QVariantMap geometry() const;
319
320=== modified file 'tests/qmltests/Stages/tst_TabletStage.qml'
321--- tests/qmltests/Stages/tst_TabletStage.qml 2016-04-27 15:01:10 +0000
322+++ tests/qmltests/Stages/tst_TabletStage.qml 2016-05-19 08:20:26 +0000
323@@ -129,6 +129,12 @@
324 }
325 }
326
327+ SignalSpy {
328+ id: stageSaver
329+ target: WindowStateStorage
330+ signalName: "stageSaved"
331+ }
332+
333 UnityTestCase {
334 id: testCase
335 name: "TabletStage"
336@@ -138,6 +144,7 @@
337 property Item sideStage: tabletStage ? findChild(tabletStage, "sideStage") : null
338
339 function init() {
340+ stageSaver.clear();
341 tabletStageLoader.active = true;
342 tryCompare(tabletStageLoader, "status", Loader.Ready);
343
344@@ -510,7 +517,35 @@
345 tryCompare(stagesPriv, "sideStageAppId", data.sideStageAppId);
346 }
347
348- function test_loadSideStageByDragginFromMainStage() {
349+ function test_applicationSavesLastStage_data() {
350+ return [
351+ { tag: "MainStage", stage: ApplicationInfoInterface.MainStage},
352+ { tag: "SideStage", stage: ApplicationInfoInterface.SideStage},
353+ ];
354+ }
355+
356+ function test_applicationSavesLastStage(data) {
357+ WindowStateStorage.saveStage(webbrowserCheckBox.appId, data.stage);
358+ stageSaver.clear();
359+
360+ var stagesPriv = findInvisibleChild(tabletStage, "stagesPriv");
361+ verify(stagesPriv);
362+
363+ tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
364+ tryCompare(stagesPriv, "sideStageAppId", "");
365+
366+ var webbrowserSurfaceId = topSurfaceList.nextId;
367+ webbrowserCheckBox.checked = true;
368+ waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
369+
370+ webbrowserCheckBox.checked = false;
371+
372+ tryCompare(stageSaver, "count", 1);
373+ compare(stageSaver.signalArguments[0][0], "webbrowser-app")
374+ compare(stageSaver.signalArguments[0][1], data.stage)
375+ }
376+
377+ function test_loadSideStageByDraggingFromMainStage() {
378 sideStage.showNow();
379 var webbrowserSurfaceId = topSurfaceList.nextId;
380 webbrowserCheckBox.checked = true;
381@@ -538,7 +573,7 @@
382 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
383 }
384
385- function test_unloadSideStageByDragginFromStageStage() {
386+ function test_unloadSideStageByDraggingFromStageStage() {
387 sideStage.showNow();
388 WindowStateStorage.saveStage(webbrowserCheckBox.appId, ApplicationInfoInterface.SideStage)
389 var webbrowserSurfaceId = topSurfaceList.nextId;
390@@ -690,5 +725,34 @@
391 // only unity8-dash surface is left
392 compare(topSurfaceList.count, 1);
393 }
394+
395+ function test_draggingSurfaceKeepsSurfaceFocus() {
396+ var webbrowserSurfaceId = topSurfaceList.nextId;
397+ webbrowserCheckBox.checked = true;
398+ waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
399+
400+ var appDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
401+ verify(appDelegate);
402+ compare(appDelegate.stage, ApplicationInfoInterface.MainStage);
403+
404+ tryCompare(appDelegate.surface, "activeFocus", true);
405+
406+ var pos = tabletStage.width - sideStage.width - (tabletStage.width - sideStage.width) / 2;
407+ var end_pos = tabletStage.width - sideStage.width / 2;
408+
409+ multiTouchDragUntil([0,1,2],
410+ tabletStage,
411+ pos,
412+ tabletStage.height / 2,
413+ units.gu(3),
414+ 0,
415+ function() {
416+ pos += units.gu(3);
417+ return sideStage.shown && !sideStage.showAnimation.running &&
418+ pos >= end_pos;
419+ });
420+
421+ tryCompare(appDelegate.surface, "activeFocus", true);
422+ }
423 }
424 }
425
426=== modified file 'tests/qmltests/Wizard/tst_Wizard.qml'
427--- tests/qmltests/Wizard/tst_Wizard.qml 2016-04-27 15:01:10 +0000
428+++ tests/qmltests/Wizard/tst_Wizard.qml 2016-05-19 08:20:26 +0000
429@@ -144,7 +144,9 @@
430 var pages = findChild(wizard, "wizardPages");
431 var stack = findChild(pages, "pageStack");
432 // don't simply call tryCompare here, because stack.currentPage will be swapped out itself
433- tryCompareFunction(function() { return stack.currentPage.objectName; }, name);
434+ tryCompareFunction(function() { return stack.currentPage.objectName; }, name, 15000);
435+ var contentAnimation = findInvisibleChild(stack.currentPage, "contentAnimation");
436+ tryCompareFunction(function() { return contentAnimation.running; }, false);
437 tryCompare(stack.currentPage, "opacity", 1.0);
438 tryCompare(stack.currentPage, "enabled", true);
439 tryCompare(stack.currentPage, "skipValid", true);
440@@ -153,17 +155,6 @@
441 return stack.currentPage;
442 }
443
444- function verifyPageIsBlocked(name) {
445- var pages = findChild(wizard, "wizardPages");
446- var stack = findChild(pages, "pageStack");
447- // don't simply call tryCompare here, because stack.currentPage will be swapped out itself
448- tryCompareFunction(function() { return stack.currentPage.objectName; }, name);
449- tryCompare(stack.currentPage, "enabled", false);
450- tryCompare(stack.currentPage, "skipValid", false);
451- waitForRendering(stack.currentPage);
452- return stack.currentPage;
453- }
454-
455 function goToPage(name, skipSim, skipLocation, skipReporting) {
456 if (skipSim === undefined) {
457 skipSim = false;

Subscribers

People subscribed via source and target branches