Merge lp:~ci-train-bot/unity8/unity8-ubuntu-zesty-2668 into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Merged at revision: 2924
Proposed branch: lp:~ci-train-bot/unity8/unity8-ubuntu-zesty-2668
Merge into: lp:unity8
Diff against target: 1317 lines (+385/-168)
28 files modified
data/unity8-dash.conf (+0/-25)
data/unity8-dash.desktop.in (+0/-1)
debian/changelog (+28/-0)
debian/unity8.install (+0/-1)
plugins/LightDM/UsersModel.cpp (+5/-0)
po/unity8.pot (+6/-6)
qml/Greeter/Greeter.qml (+1/-1)
qml/Greeter/LoginList.qml (+1/-1)
qml/Greeter/SessionsList.qml (+34/-17)
qml/Greeter/WideView.qml (+7/-5)
qml/Launcher/Drawer.qml (+43/-2)
qml/Launcher/Launcher.qml (+5/-2)
qml/Panel/Panel.qml (+8/-8)
qml/Shell.qml (+2/-3)
qml/Stage/ChildWindow.qml (+0/-4)
qml/Stage/DecoratedWindow.qml (+2/-1)
qml/Stage/Stage.qml (+25/-13)
qml/Stage/WindowDecoration.qml (+1/-0)
qml/Tutorial/TutorialContent.qml (+1/-2)
tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp (+1/-1)
tests/mocks/liblightdm/MockUsersModel.cpp (+1/-0)
tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp (+13/-0)
tests/qmltests/Greeter/tst_WideView.qml (+16/-1)
tests/qmltests/Launcher/tst_Drawer.qml (+14/-0)
tests/qmltests/Launcher/tst_Launcher.qml (+12/-0)
tests/qmltests/Panel/tst_Panel.qml (+3/-25)
tests/qmltests/Stage/tst_DesktopStage.qml (+1/-12)
tests/qmltests/tst_Shell.qml (+155/-37)
To merge this branch: bzr merge lp:~ci-train-bot/unity8/unity8-ubuntu-zesty-2668
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+322000@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'data/unity8-dash.conf'
2--- data/unity8-dash.conf 2016-10-07 17:22:21 +0000
3+++ data/unity8-dash.conf 1970-01-01 00:00:00 +0000
4@@ -1,25 +0,0 @@
5-description "Unity Shell v8 Dash"
6-author "Michael Zanetti <michael.zanetti@canonical.com>"
7-
8-emits scope-ui-starting
9-
10-start on started unity8
11-stop on stopping unity8
12-
13-kill timeout 120
14-
15-# Focused app is 100 so we want to be less likely to get
16-# killed than the focused app but more than Unity8
17-
18-oom score 50
19-
20-respawn
21-respawn limit unlimited
22-
23-env APP_ID=unity8-dash
24-
25-pre-start script
26- initctl emit scope-ui-starting
27-end script
28-
29-exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=unity8-dash.desktop
30
31=== modified file 'data/unity8-dash.desktop.in'
32--- data/unity8-dash.desktop.in 2016-04-20 13:22:20 +0000
33+++ data/unity8-dash.desktop.in 2017-04-05 14:04:26 +0000
34@@ -5,5 +5,4 @@
35 Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-dash
36 Terminal=false
37 Icon=@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/Dash/unity8-dash.png
38-NoDisplay=true
39 X-Ubuntu-Touch=true
40
41=== modified file 'debian/changelog'
42--- debian/changelog 2017-03-28 21:50:21 +0000
43+++ debian/changelog 2017-04-05 14:04:26 +0000
44@@ -1,3 +1,31 @@
45+unity8 (8.15+17.04.20170404.7-0ubuntu1) zesty; urgency=medium
46+
47+ [ Albert Astals Cid ]
48+ * Tweak app drawer a bit (LP: #1667570)
49+
50+ [ Josh Arenson ]
51+ * Make some small changes to the greeter's session list
52+ * Handle a user in the greeter having never selected a session better
53+ (LP: #1673199)
54+
55+ [ Lukáš Tinkl ]
56+ * Do not occlude windows with an ongoing unmaximize transition (LP:
57+ #1666363)
58+ * Show and implement close buttons for child windows (LP: #1668053)
59+ * Sanitize the logic for pointer vs. touch menus, fixes hiding the
60+ window title in staged mode, when hovering the panel with mouse and
61+ no menus available.
62+
63+ [ Michael Zanetti ]
64+ * Don't hide the launcher on super press if it's locked visible (LP:
65+ #1675373)
66+ * fix searchfield selection in drawer (LP: #1677259)
67+ * make sure the stage has focus when going to spread (LP: #1672053,
68+ #1672673, #1676995)
69+ * don't autostart the dash app, but show its .desktop file instead
70+
71+ -- Michał Sawicz <michal.sawicz@canonical.com> Tue, 04 Apr 2017 22:56:06 +0000
72+
73 unity8 (8.15+17.04.20170328.3-0ubuntu1) zesty; urgency=medium
74
75 [ Albert Astals Cid ]
76
77=== modified file 'debian/unity8.install'
78--- debian/unity8.install 2016-10-04 16:21:38 +0000
79+++ debian/unity8.install 2017-04-05 14:04:26 +0000
80@@ -1,6 +1,5 @@
81 debian/usr.bin.unity8-dash etc/apparmor.d
82 var/lib/unity8/version
83-data/unity8-dash.conf usr/share/upstart/sessions/
84 data/unity8-filewatcher.conf usr/share/upstart/sessions/
85 data/unity8.conf usr/share/upstart/sessions/
86 data/devices.conf etc/ubuntu/
87
88=== modified file 'plugins/LightDM/UsersModel.cpp'
89--- plugins/LightDM/UsersModel.cpp 2017-01-19 15:25:53 +0000
90+++ plugins/LightDM/UsersModel.cpp 2017-04-05 14:04:26 +0000
91@@ -109,6 +109,11 @@
92 variantData = stringData;
93 }
94
95+ // Workaround for liblightdm returning "" when a user has no default session
96+ if (Q_UNLIKELY(role == QLightDM::UsersModel::SessionRole && variantData.toString().isEmpty())) {
97+ variantData = Greeter::instance()->defaultSessionHint();
98+ }
99+
100 return variantData;
101 }
102
103
104=== modified file 'po/unity8.pot'
105--- po/unity8.pot 2017-03-28 21:50:21 +0000
106+++ po/unity8.pot 2017-04-05 14:04:26 +0000
107@@ -8,7 +8,7 @@
108 msgstr ""
109 "Project-Id-Version: unity8\n"
110 "Report-Msgid-Bugs-To: \n"
111-"POT-Creation-Date: 2017-03-28 21:50+0000\n"
112+"POT-Creation-Date: 2017-04-04 22:56+0000\n"
113 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
114 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
115 "Language-Team: LANGUAGE <LL@li.org>\n"
116@@ -42,11 +42,11 @@
117 msgid "Retry"
118 msgstr ""
119
120-#: plugins/LightDM/UsersModel.cpp:152
121+#: plugins/LightDM/UsersModel.cpp:157
122 msgid "Login"
123 msgstr ""
124
125-#: plugins/LightDM/UsersModel.cpp:160
126+#: plugins/LightDM/UsersModel.cpp:165
127 msgid "Guest Session"
128 msgstr ""
129
130@@ -521,15 +521,15 @@
131 msgid "Passcode"
132 msgstr ""
133
134-#: qml/Greeter/SessionsList.qml:122
135+#: qml/Greeter/SessionsList.qml:124
136 msgid "Select desktop environment"
137 msgstr ""
138
139-#: qml/Launcher/Drawer.qml:93
140+#: qml/Launcher/Drawer.qml:94
141 msgid "Search…"
142 msgstr ""
143
144-#: qml/Launcher/Drawer.qml:128
145+#: qml/Launcher/Drawer.qml:129
146 msgctxt "Apps sorted alphabetically"
147 msgid "A-Z"
148 msgstr ""
149
150=== modified file 'qml/Greeter/Greeter.qml'
151--- qml/Greeter/Greeter.qml 2017-03-22 20:14:44 +0000
152+++ qml/Greeter/Greeter.qml 2017-04-05 14:04:26 +0000
153@@ -102,7 +102,7 @@
154 show();
155 d.startUnlock(false /* toTheRight */);
156 }
157- } else if (appId !== "unity8-dash") { // dash isn't started by user
158+ } else {
159 d.startUnlock(false /* toTheRight */);
160 }
161 }
162
163=== modified file 'qml/Greeter/LoginList.qml'
164--- qml/Greeter/LoginList.qml 2017-01-24 07:40:40 +0000
165+++ qml/Greeter/LoginList.qml 2017-04-05 14:04:26 +0000
166@@ -35,7 +35,7 @@
167 readonly property int cellHeight: units.gu(5)
168 readonly property int highlightedHeight: highlightItem.height
169 readonly property int moveDuration: UbuntuAnimation.FastDuration
170- property string currentSession
171+ property string currentSession // Initially set by LightDM
172 readonly property string currentUser: userList.currentItem.username
173
174 signal responded(string response)
175
176=== modified file 'qml/Greeter/SessionsList.qml'
177--- qml/Greeter/SessionsList.qml 2016-12-19 19:55:07 +0000
178+++ qml/Greeter/SessionsList.qml 2017-04-05 14:04:26 +0000
179@@ -24,22 +24,24 @@
180 id: root
181 objectName: "sessionsList"
182
183- property string initiallySelectedSession
184 signal sessionSelected(string sessionKey)
185 signal showLoginList()
186
187- onInitiallySelectedSessionChanged: {
188- sessionsList.currentIndex = getSelectedIndex();
189- sessionsList.positionViewAtIndex(sessionsList.currentIndex, ListView.Contain);
190+ // Sets the position of the background highlight
191+ function updateHighlight(session) {
192+ sessionsList.currentIndex = getIndexOfSession(session);
193+ sessionsList.currentItem.initialSession = session;
194 }
195
196- function getSelectedIndex() {
197+ function getIndexOfSession(session) {
198 for (var i = 0; i < sessionsList.model.count; i++) {
199- var key = sessionsList.model.get(i).key
200- if (key === initiallySelectedSession) {
201+ var key = sessionsList.model.get(i).key;
202+ if (key === session) {
203 return i;
204 }
205 }
206+
207+ return 0; // Just choose the first session
208 }
209
210 function currentKey() {
211@@ -49,7 +51,8 @@
212 }
213
214 Keys.onEnterPressed: {
215- showLoginList(); // Session is already selected
216+ sessionSelected(currentKey());
217+ showLoginList();
218 event.accepted = true;
219 }
220
221@@ -59,6 +62,7 @@
222 }
223
224 Keys.onReturnPressed: {
225+ sessionSelected(currentKey());
226 showLoginList();
227 event.accepted = true;
228 }
229@@ -66,20 +70,18 @@
230 Keys.onDownPressed: {
231 if (sessionsList.currentIndex < sessionsList.model.count - 1)
232 sessionsList.currentIndex++;
233- sessionSelected(currentKey());
234 event.accepted = true;
235 }
236
237 Keys.onUpPressed: {
238 if (sessionsList.currentIndex > 0)
239 sessionsList.currentIndex--;
240- sessionSelected(currentKey());
241 event.accepted = true;
242 }
243
244 LoginAreaContainer {
245 readonly property real margins: sessionsList.anchors.margins
246- readonly property real prefferedHeight: {
247+ readonly property real preferredHeight: {
248 if (sessionsList.currentItem) {
249 return (sessionsList.currentItem.height *
250 (1 + sessionsList.model.count)) + 2 * margins
251@@ -88,7 +90,7 @@
252 }
253 }
254
255- height: prefferedHeight < parent.height ? prefferedHeight : parent.height - units.gu(4)
256+ height: preferredHeight < parent.height ? preferredHeight : parent.height - units.gu(4)
257 width: parent.width
258
259 anchors {
260@@ -107,8 +109,8 @@
261 margins: units.gu(2)
262 }
263
264- height: parent.height - headerItem.height
265-
266+ clip: true
267+ height: parent.height - units.gu(2.5)
268 boundsBehavior: Flickable.StopAtBounds
269
270 model: LightDMService.sessions
271@@ -135,14 +137,18 @@
272 }
273
274 headerPositioning: ListView.OverlayHeader
275+
276+ // The highlighting is all self-managed, so account for that
277 highlightFollowsCurrentItem: false
278+ highlight: QtObject {}
279
280 delegate: ListItem {
281 id: delegate
282 objectName: "sessionDelegate" + index
283
284+ property string initialSession: ""
285+
286 divider.visible: false
287-
288 visible: y > sessionsList.headerItem.y
289 + sessionsList.headerItem.height
290 - sessionsList.anchors.margins
291@@ -157,6 +163,16 @@
292 }
293
294 Rectangle {
295+ id: backgroundHighlight
296+
297+ height: sessionsList.currentItem.height
298+ width: sessionsList.currentItem.width
299+ color: theme.palette.normal.selection
300+
301+ visible: initialSession === key && !!key
302+ }
303+
304+ Rectangle {
305 height: parent.height
306 width: parent.width
307 color: "transparent"
308@@ -171,15 +187,16 @@
309 ListItemLayout {
310 id: layout
311
312+ readonly property color itemColor: theme.palette.normal.raisedText
313 SessionIcon {
314 id: sessionIcon
315 source: icon_url
316 SlotsLayout.position: SlotsLayout.Leading
317- color: theme.palette.normal.raisedSecondaryText
318+ color: parent.itemColor
319 }
320
321 title.text: display
322- title.color: theme.palette.normal.raisedText
323+ title.color: itemColor
324 }
325 }
326 }
327
328=== modified file 'qml/Greeter/WideView.qml'
329--- qml/Greeter/WideView.qml 2017-03-22 20:14:44 +0000
330+++ qml/Greeter/WideView.qml 2017-04-05 14:04:26 +0000
331@@ -20,6 +20,8 @@
332
333 FocusScope {
334 id: root
335+ objectName: "WideView"
336+
337 focus: true
338
339 property alias background: coverPage.background
340@@ -32,13 +34,13 @@
341 property int delayMinutes // TODO
342 property alias alphanumeric: loginList.alphanumeric
343 property alias locked: loginList.locked
344- property alias sessionToStart: loginList.currentSession
345 property alias waiting: loginList.waiting
346 property var userModel // Set from outside
347
348 readonly property bool animating: coverPage.showAnimation.running || coverPage.hideAnimation.running
349 readonly property bool fullyShown: coverPage.showProgress === 1
350 readonly property bool required: coverPage.required
351+ readonly property alias sessionToStart: loginList.currentSession
352
353 // so that it can be replaced in tests with a mock object
354 property var inputMethod: Qt.inputMethod
355@@ -144,6 +146,7 @@
356
357 height: loginList.height
358 width: loginList.width
359+
360 anchors {
361 left: parent.left
362 leftMargin: Math.min(parent.width * 0.16, units.gu(20))
363@@ -153,10 +156,9 @@
364 active: false
365
366 onLoaded: sessionChooserLoader.item.forceActiveFocus();
367- Binding {
368- target: sessionChooserLoader.item
369- property: "initiallySelectedSession"
370- value: loginList.currentSession
371+ onActiveChanged: {
372+ if (!active) return;
373+ item.updateHighlight(loginList.currentSession);
374 }
375
376 Connections {
377
378=== modified file 'qml/Launcher/Drawer.qml'
379--- qml/Launcher/Drawer.qml 2017-03-24 11:51:31 +0000
380+++ qml/Launcher/Drawer.qml 2017-04-05 14:04:26 +0000
381@@ -28,6 +28,7 @@
382 property int panelWidth: 0
383 readonly property bool moving: listLoader.item && listLoader.item.moving
384 readonly property Item searchTextField: searchField
385+ readonly property real delegateWidth: units.gu(10)
386
387 signal applicationSelected(string appId)
388
389@@ -272,7 +273,7 @@
390
391 model: sortProxyModel
392
393- delegateWidth: units.gu(8)
394+ delegateWidth: root.delegateWidth
395 delegateHeight: units.gu(10)
396 delegate: drawerDelegateComponent
397 }
398@@ -332,7 +333,7 @@
399 filterLetter: model.letter
400 dynamicSortFilter: false
401 }
402- delegateWidth: units.gu(8)
403+ delegateWidth: root.delegateWidth
404 delegateHeight: units.gu(10)
405 delegate: drawerDelegateComponent
406 }
407@@ -352,6 +353,7 @@
408 readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus
409
410 onClicked: root.applicationSelected(model.appId)
411+ z: loader.active ? 1 : 0
412
413 Column {
414 width: units.gu(8)
415@@ -384,11 +386,50 @@
416 }
417
418 Label {
419+ id: label
420 text: model.name
421 width: parent.width
422 horizontalAlignment: Text.AlignHCenter
423 fontSize: "small"
424 elide: Text.ElideRight
425+
426+ Loader {
427+ id: loader
428+ x: {
429+ var aux = 0;
430+ if (item) {
431+ aux = label.width / 2 - item.width / 2;
432+ var containerXMap = mapToItem(contentContainer, aux, 0).x
433+ if (containerXMap < 0) {
434+ aux = aux - containerXMap;
435+ containerXMap = 0;
436+ }
437+ if (containerXMap + item.width > contentContainer.width) {
438+ aux = aux - (containerXMap + item.width - contentContainer.width);
439+ }
440+ }
441+ return aux;
442+ }
443+ y: -units.gu(0.5)
444+ active: label.truncated && (drawerDelegate.hovered || drawerDelegate.focused)
445+ sourceComponent: Rectangle {
446+ color: UbuntuColors.jet
447+ width: fullLabel.contentWidth + units.gu(1)
448+ height: fullLabel.height + units.gu(1)
449+ radius: units.dp(4)
450+ Label {
451+ id: fullLabel
452+ width: Math.min(root.delegateWidth * 2, implicitWidth)
453+ wrapMode: Text.Wrap
454+ horizontalAlignment: Text.AlignHCenter
455+ maximumLineCount: 3
456+ elide: Text.ElideRight
457+ anchors.centerIn: parent
458+ text: model.name
459+ fontSize: "small"
460+ }
461+ }
462+ }
463 }
464 }
465 }
466
467=== modified file 'qml/Launcher/Launcher.qml'
468--- qml/Launcher/Launcher.qml 2017-03-21 10:54:59 +0000
469+++ qml/Launcher/Launcher.qml 2017-04-05 14:04:26 +0000
470@@ -75,7 +75,7 @@
471 } else {
472 superPressTimer.stop();
473 superLongPressTimer.stop();
474- switchToNextState("");
475+ switchToNextState(root.lockedVisible ? "visible" : "");
476 panel.shortcutHintsShown = false;
477 }
478 }
479@@ -88,7 +88,7 @@
480 superPressTimer.stop();
481 superLongPressTimer.stop();
482 } else {
483- switchToNextState("");
484+ switchToNextState(root.lockedVisible ? "visible" : "");
485 root.focus = false;
486 if (panel.highlightIndex == -1) {
487 root.showDashHome();
488@@ -368,8 +368,11 @@
489 // Remove (and put back) the focus for the searchfield in
490 // order to hide the copy/paste popover when we move the drawer
491 var hadFocus = drawer.searchTextField.focus;
492+ var oldSelectionStart = drawer.searchTextField.selectionStart;
493+ var oldSelectionEnd = drawer.searchTextField.selectionEnd;
494 drawer.searchTextField.focus = false;
495 drawer.searchTextField.focus = hadFocus;
496+ drawer.searchTextField.select(oldSelectionStart, oldSelectionEnd);
497 }
498 }
499 width: Math.min(root.width, units.gu(90)) * .9
500
501=== modified file 'qml/Panel/Panel.qml'
502--- qml/Panel/Panel.qml 2017-03-21 10:55:52 +0000
503+++ qml/Panel/Panel.qml 2017-04-05 14:04:26 +0000
504@@ -1,5 +1,5 @@
505 /*
506- * Copyright (C) 2013-2016 Canonical, Ltd.
507+ * Copyright (C) 2013-2017 Canonical, Ltd.
508 *
509 * This program is free software; you can redistribute it and/or modify
510 * it under the terms of the GNU General Public License as published by
511@@ -85,15 +85,15 @@
512 property bool showWindowDecorationControls: (revealControls && PanelState.decorationsVisible) ||
513 PanelState.decorationsAlwaysVisible
514
515- property bool showPointerMenu: revealControls &&
516+ property bool showPointerMenu: revealControls && enablePointerMenu &&
517 (PanelState.decorationsVisible || mode == "staged")
518
519- property bool enablePointerMenu: revealControls &&
520- applicationMenus.available &&
521+ property bool enablePointerMenu: applicationMenus.available &&
522 applicationMenus.model
523
524 property bool showTouchMenu: !greeterShown &&
525- !showPointerMenu
526+ !showPointerMenu &&
527+ !showWindowDecorationControls
528
529 property bool enableTouchMenus: showTouchMenu &&
530 applicationMenus.available &&
531@@ -211,7 +211,7 @@
532 opacity: d.showPointerMenu ? 1 : 0
533 visible: opacity != 0
534 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
535- active: __applicationMenus.model && !callHint.visible
536+ active: d.showPointerMenu && !callHint.visible
537
538 width: parent.width - windowControlButtons.width - units.gu(2) - __indicators.barWidth
539
540@@ -220,7 +220,7 @@
541 sourceComponent: MenuBar {
542 id: bar
543 objectName: "menuBar"
544- anchors.left: parent.left
545+ anchors.left: parent ? parent.left : undefined
546 anchors.margins: units.gu(1)
547 height: menuBarLoader.height
548 enableKeyFilter: valid && PanelState.decorationsVisible
549@@ -339,7 +339,7 @@
550 maximumLineCount: 1
551 fontSize: "medium"
552 font.weight: Font.Medium
553- color: Theme.palette.selected.backgroundText
554+ color: theme.palette.selected.backgroundText
555 opacity: __applicationMenus.visible && !__applicationMenus.expanded ? 1 : 0
556 visible: opacity != 0
557 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
558
559=== modified file 'qml/Shell.qml'
560--- qml/Shell.qml 2017-03-24 14:04:50 +0000
561+++ qml/Shell.qml 2017-04-05 14:04:26 +0000
562@@ -110,7 +110,7 @@
563 }
564 }
565 function _onMainAppChanged(appId) {
566- if (wizard.active && appId != "" && appId != "unity8-dash") {
567+ if (wizard.active && appId != "") {
568 // If this happens on first boot, we may be in the
569 // wizard while receiving a call. But a call is more
570 // important than the wizard so just bail out of it.
571@@ -241,8 +241,7 @@
572 onHomeKeyActivated: {
573 // Ignore when greeter is active, to avoid pocket presses
574 if (!greeter.active) {
575- launcher.fadeOut();
576- ApplicationManager.requestFocusApplication("unity8-dash");
577+ launcher.openDrawer(false);
578 }
579 }
580 onTouchBegun: { cursor.opacity = 0; }
581
582=== modified file 'qml/Stage/ChildWindow.qml'
583--- qml/Stage/ChildWindow.qml 2017-03-24 14:04:50 +0000
584+++ qml/Stage/ChildWindow.qml 2017-04-05 14:04:26 +0000
585@@ -104,10 +104,6 @@
586 height: root.decorationHeight
587 title: root.surface ? root.surface.name : ""
588 active: root.surface ? root.surface.focused : false
589- closeButtonVisible: root.surface ? root.surface.type === Mir.SatelliteType
590- || root.surface.type === Mir.NormalType
591- || root.surface.type === Mir.UtilityType
592- : false
593 minimizeButtonVisible: false
594 maximizeButtonShown: false
595 onPressed: root.surface.activate();
596
597=== modified file 'qml/Stage/DecoratedWindow.qml'
598--- qml/Stage/DecoratedWindow.qml 2017-03-24 14:04:50 +0000
599+++ qml/Stage/DecoratedWindow.qml 2017-04-05 14:04:26 +0000
600@@ -38,6 +38,7 @@
601 property alias maximizeButtonShown: decoration.maximizeButtonShown
602 property alias interactive: applicationWindow.interactive
603 readonly property alias orientationChangesEnabled: applicationWindow.orientationChangesEnabled
604+ property alias windowControlButtonsVisible: decoration.windowControlButtonsVisible
605
606 // Changing this will actually add/remove a decoration, meaning, requestedHeight will take the decoration into account.
607 property bool hasDecoration: true
608@@ -210,7 +211,7 @@
609
610 WindowDecoration {
611 id: decoration
612- closeButtonVisible: root.application.appId !== "unity8-dash"
613+ closeButtonVisible: true
614 objectName: "appWindowDecoration"
615
616 anchors { left: parent.left; top: parent.top; right: parent.right }
617
618=== modified file 'qml/Stage/Stage.qml'
619--- qml/Stage/Stage.qml 2017-03-28 21:46:37 +0000
620+++ qml/Stage/Stage.qml 2017-04-05 14:04:26 +0000
621@@ -91,6 +91,7 @@
622
623
624 onAltTabPressedChanged: {
625+ root.focus = true;
626 if (altTabPressed) {
627 if (root.spreadEnabled) {
628 altTabDelayTimer.start();
629@@ -171,7 +172,7 @@
630 id: closeFocusedShortcut
631 shortcut: Qt.AltModifier|Qt.Key_F4
632 onTriggered: {
633- if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {
634+ if (priv.focusedAppDelegate) {
635 priv.focusedAppDelegate.close();
636 }
637 }
638@@ -390,7 +391,7 @@
639 Binding {
640 target: PanelState
641 property: "decorationsVisible"
642- value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
643+ value: mode == "windowed" && priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !root.spreadShown
644 }
645
646 Binding {
647@@ -431,7 +432,7 @@
648 Binding {
649 target: PanelState
650 property: "closeButtonShown"
651- value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
652+ value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized
653 }
654
655 Component.onDestruction: {
656@@ -477,6 +478,7 @@
657 State {
658 name: "spread"; when: priv.goneToSpread
659 PropertyChanges { target: floatingFlickable; enabled: true }
660+ PropertyChanges { target: root; focus: true }
661 PropertyChanges { target: spreadItem; focus: true }
662 PropertyChanges { target: hoverMouseArea; enabled: true }
663 PropertyChanges { target: rightEdgeDragArea; enabled: false }
664@@ -516,14 +518,20 @@
665 State {
666 name: "staged"; when: root.mode === "staged"
667 PropertyChanges { target: wallpaper; visible: !priv.focusedAppDelegate || priv.focusedAppDelegate.x !== 0 }
668+ PropertyChanges { target: root; focus: true }
669+ PropertyChanges { target: appContainer; focus: true }
670 },
671 State {
672 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
673 PropertyChanges { target: triGestureArea; enabled: priv.sideStageEnabled }
674 PropertyChanges { target: sideStage; visible: true }
675+ PropertyChanges { target: root; focus: true }
676+ PropertyChanges { target: appContainer; focus: true }
677 },
678 State {
679 name: "windowed"; when: root.mode === "windowed"
680+ PropertyChanges { target: root; focus: true }
681+ PropertyChanges { target: appContainer; focus: true }
682 }
683 ]
684 transitions: [
685@@ -606,9 +614,7 @@
686 }
687
688 onCloseCurrentApp: {
689- if (!appRepeater.itemAt(highlightedIndex).isDash) {
690- appRepeater.itemAt(highlightedIndex).close();
691- }
692+ appRepeater.itemAt(highlightedIndex).close();
693 }
694 }
695
696@@ -1380,11 +1386,11 @@
697 requestedX: root.availableDesktopArea.x;
698 requestedY: 0;
699 visuallyMinimized: false;
700- visuallyMaximized: true
701 requestedWidth: root.availableDesktopArea.width;
702 requestedHeight: appContainer.height;
703 }
704 PropertyChanges { target: touchControls; enabled: true }
705+ PropertyChanges { target: decoratedWindow; windowControlButtonsVisible: false }
706 },
707 State {
708 name: "fullscreen"; when: appDelegate.fullscreen && !appDelegate.minimized
709@@ -1403,11 +1409,10 @@
710 PropertyChanges {
711 target: appDelegate
712 visuallyMinimized: false
713- visuallyMaximized: false
714 }
715 PropertyChanges { target: touchControls; enabled: true }
716 PropertyChanges { target: resizeArea; enabled: true }
717- PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
718+ PropertyChanges { target: decoratedWindow; shadowOpacity: .3; windowControlButtonsVisible: true}
719 },
720 State {
721 name: "restored";
722@@ -1596,11 +1601,18 @@
723 to: ",normal,restored,maximized,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
724 enabled: appDelegate.animationsEnabled
725 SequentialAnimation {
726+ ScriptAction { script: {
727+ if (appDelegate.visuallyMaximized) visuallyMaximized = false; // maximized before -> going to restored
728+ }
729+ }
730 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
731 UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,windowedX,windowedY,opacity,scale,requestedWidth,requestedHeight,windowedWidth,windowedHeight";
732 duration: priv.animationDuration }
733- PropertyAction { target: appDelegate; property: "visuallyMaximized" }
734- ScriptAction { script: { fakeRectangle.stop(); } }
735+ ScriptAction { script: {
736+ fakeRectangle.stop();
737+ appDelegate.visuallyMaximized = appDelegate.maximized; // reflect the target state
738+ }
739+ }
740 }
741 }
742 ]
743@@ -1741,7 +1753,7 @@
744 objectName: "dragArea"
745 anchors.fill: decoratedWindow
746 enabled: false
747- closeable: !appDelegate.isDash
748+ closeable: true
749
750 onClicked: {
751 spreadItem.highlightedIndex = index;
752@@ -1784,7 +1796,7 @@
753 objectName: "closeMouseArea"
754 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
755 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
756- visible: !appDelegate.isDash && dragArea.distance == 0
757+ visible: dragArea.distance == 0
758 && index == spreadItem.highlightedIndex
759 && mousePos.y < (decoratedWindow.height / 3)
760 && mousePos.y > -units.gu(4)
761
762=== modified file 'qml/Stage/WindowDecoration.qml'
763--- qml/Stage/WindowDecoration.qml 2017-03-01 12:18:59 +0000
764+++ qml/Stage/WindowDecoration.qml 2017-04-05 14:04:26 +0000
765@@ -34,6 +34,7 @@
766 property var menu: undefined
767 property bool enableMenus: true
768 property bool windowMoving: false
769+ property alias windowControlButtonsVisible: buttons.visible
770
771 readonly property real buttonsWidth: buttons.width + row.spacing
772
773
774=== modified file 'qml/Tutorial/TutorialContent.qml'
775--- qml/Tutorial/TutorialContent.qml 2016-05-19 17:23:12 +0000
776+++ qml/Tutorial/TutorialContent.qml 2017-04-05 14:04:26 +0000
777@@ -153,8 +153,7 @@
778 paused: root.paused
779
780 skipped: tutorialLeftLongLoader.skipped
781- isReady: tutorialTopLoader.skipped && !skipped && !paused && !delayed &&
782- ApplicationManager.focusedApplicationId != "unity8-dash"
783+ isReady: tutorialTopLoader.skipped && !skipped && !paused && !delayed
784
785 InactivityTimer {
786 id: tutorialLeftLongTimer
787
788=== modified file 'tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp'
789--- tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp 2017-01-16 11:12:00 +0000
790+++ tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp 2017-04-05 14:04:26 +0000
791@@ -46,7 +46,7 @@
792 m_list.append(item);
793 item = new MockLauncherItem("calendar-app", "/usr/share/applications/calendar-app.desktop","Calendar", "calendar", this);
794 m_list.append(item);
795- item = new MockLauncherItem("libreoffice", "/usr/share/applications/libreoffice.desktop","Libre Office", "libreoffice", this);
796+ item = new MockLauncherItem("libreoffice", "/usr/share/applications/libreoffice.desktop","Libre Office Writer", "libreoffice", this);
797 m_list.append(item);
798
799 qsrand(QDateTime::currentMSecsSinceEpoch() / 1000);
800
801=== modified file 'tests/mocks/liblightdm/MockUsersModel.cpp'
802--- tests/mocks/liblightdm/MockUsersModel.cpp 2017-01-19 20:12:34 +0000
803+++ tests/mocks/liblightdm/MockUsersModel.cpp 2017-04-05 14:04:26 +0000
804@@ -186,6 +186,7 @@
805 { "no-background", "No Background", "", 0, false, false, "ubuntu", 0 },
806 { "no-password", "No Password", 0, 0, false, false, "ubuntu", 0 },
807 { "no-response", "No Response", 0, 0, false, false, "ubuntu", 0 },
808+ { "no-session", "No Session", 0, 0, false, false, "", 0 },
809 { "question-prompt", "Question Prompt", 0, 0, false, false, "ubuntu", 0 },
810 { "two-factor", "Two Factor", 0, 0, false, false, "ubuntu", 0 },
811 { "two-prompts", "Two Prompts", 0, 0, false, false, "ubuntu", 0 },
812
813=== modified file 'tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp'
814--- tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp 2017-01-19 15:25:53 +0000
815+++ tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp 2017-04-05 14:04:26 +0000
816@@ -113,6 +113,19 @@
817 QCOMPARE(session, Greeter::instance()->defaultSessionHint());
818 }
819
820+
821+ void testEmptySession()
822+ {
823+ int i = findName(model, QStringLiteral("no-session"));
824+ QVERIFY(i >= 0);
825+
826+ // A valid test as 'no-session' is instantiated with it's
827+ // SessionRole as an empty string. This ensures something,
828+ // hopefully sensical, is returned.
829+ auto session = model->data(i, QLightDM::UsersModel::SessionRole);
830+ QCOMPARE(session.toString().isEmpty(), false);
831+ }
832+
833 void testHideUsers()
834 {
835 QLightDM::MockController::instance()->setHideUsersHint(true);
836
837=== modified file 'tests/qmltests/Greeter/tst_WideView.qml'
838--- tests/qmltests/Greeter/tst_WideView.qml 2017-02-28 16:49:40 +0000
839+++ tests/qmltests/Greeter/tst_WideView.qml 2017-04-05 14:04:26 +0000
840@@ -395,6 +395,20 @@
841 waitForRendering(view);
842 }
843
844+ function test_sessionless_user_is_still_valid() {
845+ var loginList = findChild(view, "loginList")
846+
847+ /*
848+ * If a user has never logged in before, or, for some reason
849+ * has no sessionHint, ensure that the model returns the default
850+ * session and that the view respects this
851+ */
852+ selectUser("no-session");
853+ compare(LightDM.Users.data(loginList.currentIndex, LightDM.UserRoles.SessionRole), LightDM.Greeter.defaultSession);
854+
855+ tryCompare(loginList, "currentSession", LightDM.Greeter.defaultSession);
856+ }
857+
858 function test_changingSessionSticksToUser() {
859 var loginList = findChild(view, "loginList");
860
861@@ -426,7 +440,8 @@
862 var sessionChooserButton = findChild(view, "sessionChooserButton");
863 compare(sessionChooserButton.visible, true);
864
865- var session = String(view.sessionToStart).toLowerCase();
866+ var loginList = findChild(view, "loginList");
867+ var session = String(loginList.currentSession).toLowerCase();
868 var icon = String(sessionChooserButton.icon);
869 compare(icon.indexOf(session) > -1, true);
870
871
872=== modified file 'tests/qmltests/Launcher/tst_Drawer.qml'
873--- tests/qmltests/Launcher/tst_Drawer.qml 2017-03-13 14:52:26 +0000
874+++ tests/qmltests/Launcher/tst_Drawer.qml 2017-04-05 14:04:26 +0000
875@@ -271,8 +271,22 @@
876
877 var searchField = findChild(drawer, "searchField");
878 tryCompareFunction(function() { return !!searchField }, true);
879+ tryCompare(searchField, "selectedText", searchField.displayText);
880 typeString("cam");
881 tryCompareFunction(function() { return searchField.displayText }, "cam");
882+
883+ // Try again to make sure it cleaned and everything
884+ keyClick(Qt.Key_Escape);
885+ waitForRendering(launcher);
886+ waitUntilTransitionsEnd(launcher);
887+ launcher.openDrawer(true);
888+ waitForRendering(launcher);
889+ waitUntilTransitionsEnd(launcher);
890+
891+ tryCompare(searchField, "selectedText", searchField.displayText);
892+ typeString("terminal");
893+ tryCompareFunction(function() { return searchField.displayText }, "terminal");
894+
895 }
896
897 function test_kbdNavigation() {
898
899=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
900--- tests/qmltests/Launcher/tst_Launcher.qml 2017-03-24 08:27:54 +0000
901+++ tests/qmltests/Launcher/tst_Launcher.qml 2017-04-05 14:04:26 +0000
902@@ -1543,6 +1543,18 @@
903 launcher.panelWidth = oldSize;
904 }
905
906+ function test_doesntHideOnSuperWhenLockedVisible() {
907+ launcher.lockedVisible = true;
908+
909+ waitForRendering(launcher);
910+ launcher.superPressed = true;
911+ wait(400); // Longpress
912+ launcher.superPressed = false;
913+ waitForRendering(launcher);
914+
915+ verify(launcher.state, "visible");
916+ }
917+
918 function test_mouseHoverSelectQuickList() {
919 dragLauncherIntoView();
920 var clickedItem = findChild(launcher, "launcherDelegate5")
921
922=== modified file 'tests/qmltests/Panel/tst_Panel.qml'
923--- tests/qmltests/Panel/tst_Panel.qml 2017-03-17 13:44:30 +0000
924+++ tests/qmltests/Panel/tst_Panel.qml 2017-04-05 14:04:26 +0000
925@@ -779,40 +779,18 @@
926
927 var appTitle = findChild(panel, "panelTitle"); verify(appTitle);
928 var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);
929- var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);
930+ var menuBarLoader = findChild(panel, "menuBarLoader"); verify(menuBarLoader);
931
932 tryCompare(appTitle, "visible", true, undefined, "App title should be visible");
933- tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible");
934+ tryCompare(menuBarLoader, "visible", false, undefined, "App menu bar should not be visible");
935
936 mouseMove(panel, panel.width/2, panel.panelHeight);
937
938+ var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);
939 tryCompare(appTitle, "visible", false, undefined, "App title should not be visible on mouse hover");
940 tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover");
941 }
942
943- function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown() {
944- PanelState.title = "Fake Title";
945- panel.mode = "windowed";
946- mouseEmulation.checked = false;
947-
948- var appTitle = findChild(panel, "panelTitle"); verify(appTitle);
949- var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);
950- var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);
951-
952- tryCompare(appTitle, "visible", true, undefined, "App title should be visible");
953- tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible");
954-
955- mouseMove(panel, panel.width/2, panel.panelHeight);
956-
957- tryCompare(appTitle, "visible", true, undefined, "App title should still be visible on mouse hover when panel decorations are not visible");
958- tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should be visible on mouse hover when panel decorations are not visible");
959-
960- PanelState.decorationsVisible = true;
961-
962- tryCompare(appTitle, "visible", false, undefined, "App title should still be visible on mouse hover when panel decorations are visible");
963- tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover when panel decorations not visible");
964- }
965-
966 function test_keyboardNavigation_data() {
967 return [
968 {tag: "tab to start", doTab: false},
969
970=== modified file 'tests/qmltests/Stage/tst_DesktopStage.qml'
971--- tests/qmltests/Stage/tst_DesktopStage.qml 2017-03-24 14:04:50 +0000
972+++ tests/qmltests/Stage/tst_DesktopStage.qml 2017-04-05 14:04:26 +0000
973@@ -693,13 +693,6 @@
974 tryCompare(facebookAppDelegate, "maximized", true);
975 }
976
977- function test_dashHasNoCloseButton() {
978- var dashAppDelegate = startApplication("unity8-dash");
979- verify(dashAppDelegate);
980- var closeButton = findChild(dashAppDelegate, "closeWindowButton");
981- tryCompare(closeButton, "visible", false);
982- }
983-
984 function test_hideMaximizeButtonWhenSizeConstrained() {
985 var dialerDelegate = startApplication("dialer-app");
986
987@@ -870,11 +863,7 @@
988 maximizeAppDelegate(appDelegate);
989
990 // Close the window and restart the application
991- var closeButton = findChild(appDelegate, "closeWindowButton");
992- appDelegate = null;
993- verify(closeButton);
994- mouseClick(closeButton);
995- closeButton = null;
996+ appDelegate.close();
997 tryCompare(topSurfaceList, "count", originalWindowCount);
998 wait(100); // plus some spare room
999 appDelegate = startApplication("dialer-app");
1000
1001=== modified file 'tests/qmltests/tst_Shell.qml'
1002--- tests/qmltests/tst_Shell.qml 2017-03-24 11:08:11 +0000
1003+++ tests/qmltests/tst_Shell.qml 2017-04-05 14:04:26 +0000
1004@@ -138,9 +138,6 @@
1005 }
1006 mode: shellLoader.mode
1007 hasTouchscreen: true
1008- Component.onCompleted: {
1009- ApplicationManager.startApplication("unity8-dash");
1010- }
1011 Component.onDestruction: {
1012 shellLoader.itemDestroyed = true;
1013 }
1014@@ -601,10 +598,6 @@
1015 topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
1016 verify(topLevelSurfaceList);
1017 stage = findChild(shell, "stage");
1018-
1019- // wait until unity8-dash is fully loaded
1020- tryCompare(topLevelSurfaceList, "count", 1);
1021- waitUntilAppWindowIsFullyLoaded(topLevelSurfaceList.idAt(0));
1022 }
1023
1024 function loadDesktopShellWithApps() {
1025@@ -612,6 +605,7 @@
1026 waitForRendering(shell)
1027 shell.usageScenario = "desktop"
1028 waitForRendering(shell)
1029+ var app0 = ApplicationManager.startApplication("unity8-dash")
1030 var app1 = ApplicationManager.startApplication("dialer-app")
1031 var app2 = ApplicationManager.startApplication("webbrowser-app")
1032 var app3 = ApplicationManager.startApplication("camera-app")
1033@@ -794,8 +788,37 @@
1034 tryCompare(ApplicationManager, "focusedApplicationId", mainAppId);
1035 }
1036
1037+ function test_greeterStartsCorrectSession() {
1038+ loadShell("desktop");
1039+ setLightDMMockMode("full");
1040+
1041+ LightDMController.sessionMode = "full"
1042+ LightDMController.numSessions = LightDMController.numAvailableSessions;
1043+ var greeter = findChild(shell, "greeter");
1044+ var view = findChild(greeter, "WideView");
1045+ verify(view, "This test requires WideView to be loaded");
1046+
1047+ var loginList = findChild(view, "loginList");
1048+
1049+ compare(view.sessionToStart, greeter.sessionToStart());
1050+
1051+ // Ensure another session can actually be selected
1052+ compare(LightDMController.numSessions > 1, true);
1053+ loginList.currentSession = LightDM.Sessions.data(1, LightDM.SessionRoles.KeyRole);
1054+
1055+ compare(view.sessionToStart, greeter.sessionToStart());
1056+
1057+ }
1058+
1059+
1060 function swipeAwayGreeter() {
1061 var greeter = findChild(shell, "greeter");
1062+
1063+ if (!greeter.shown) {
1064+ console.log("Greeter not shown. Not swiping.");
1065+ return;
1066+ }
1067+
1068 tryCompare(greeter, "fullyShown", true);
1069 waitForGreeterToStabilize();
1070 removeTimeConstraintsFromSwipeAreas(greeter);
1071@@ -1222,26 +1245,11 @@
1072
1073 var wizard = findChild(shell, "wizard");
1074 tryCompare(wizard, "active", true);
1075- tryCompareFunction(function() { return topLevelSurfaceList.applicationAt(0).appId; }, "unity8-dash");
1076-
1077- // Make sure we stay running when there's no top level window (can happen for
1078- // a moment when we restart the dash after switching language)
1079- var dashApplication = ApplicationManager.findApplication("unity8-dash");
1080- ApplicationManager.stopApplication(dashApplication.appId);
1081- // wait until all zombie surfaces are gone. As MirSurfaceItems hold references over them.
1082- // They won't be gone until those surface items are destroyed.
1083- tryCompareFunction(function() { return dashApplication.surfaceList.count }, 0);
1084
1085 tryCompare(topLevelSurfaceList, "count", 0);
1086 compare(wizard.shown, true);
1087
1088- // And make sure we stay running when dash comes back again
1089- var dashSurfaceId = topLevelSurfaceList.nextId;
1090- ApplicationManager.startApplication(dashApplication.appId);
1091- waitUntilAppWindowIsFullyLoaded(dashSurfaceId);
1092- compare(wizard.shown, true);
1093-
1094- // And make sure we stop when some other surface shows app
1095+ // And make sure we stop when some surface shows app
1096 var gallerySurfaceId = topLevelSurfaceList.nextId;
1097 var galleryApp = ApplicationManager.startApplication("gallery-app");
1098 waitUntilAppWindowIsFullyLoaded(gallerySurfaceId);
1099@@ -1291,6 +1299,11 @@
1100 function test_tapOnRightEdgeReachesApplicationSurface() {
1101 loadShell("phone");
1102 swipeAwayGreeter();
1103+
1104+ var appSurfaceId = topLevelSurfaceList.nextId;
1105+ var app = ApplicationManager.startApplication("unity8-dash")
1106+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1107+
1108 var topmostSpreadDelegate = findChild(shell, "appDelegate_" + topLevelSurfaceList.idAt(0));
1109 verify(topmostSpreadDelegate);
1110
1111@@ -1320,6 +1333,11 @@
1112 function test_rightEdgeDragDoesNotReachApplicationSurface() {
1113 loadShell("phone");
1114 swipeAwayGreeter();
1115+
1116+ var appSurfaceId = topLevelSurfaceList.nextId;
1117+ var app = ApplicationManager.startApplication("unity8-dash")
1118+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1119+
1120 var topmostSpreadDelegate = findChild(shell, "appDelegate_" + topLevelSurfaceList.idAt(0));
1121 var topmostSurfaceItem = findChild(topmostSpreadDelegate, "surfaceItem");
1122 var rightEdgeDragArea = findChild(shell, "rightEdgeDragArea");
1123@@ -1372,15 +1390,15 @@
1124 verify(coverPage.shown);
1125 }
1126
1127- function test_physicalHomeKeyPressFocusesDash() {
1128+ function test_physicalHomeKeyPressOpensDrawer() {
1129 loadShell("phone");
1130-
1131- var galleryApp = ApplicationManager.startApplication("gallery-app");
1132- tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
1133+ swipeAwayGreeter();
1134
1135 var windowInputMonitor = findInvisibleChild(shell, "windowInputMonitor");
1136 windowInputMonitor.homeKeyActivated();
1137- tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
1138+
1139+ var launcher = findChild(shell, "launcher");
1140+ tryCompare(launcher, "drawerShown", true);
1141 }
1142
1143 function test_tabletLogin_data() {
1144@@ -1499,6 +1517,10 @@
1145 loadShell("tablet");
1146 shell.usageScenario = "desktop";
1147
1148+ var appSurfaceId = topLevelSurfaceList.nextId;
1149+ var app = ApplicationManager.startApplication("unity8-dash")
1150+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1151+
1152 var webBrowserSurfaceId = topLevelSurfaceList.nextId;
1153 var webBrowserApp = ApplicationManager.startApplication("webbrowser-app");
1154 waitUntilAppWindowIsFullyLoaded(webBrowserSurfaceId);
1155@@ -1523,6 +1545,10 @@
1156 loadShell("tablet");
1157 shell.usageScenario = "tablet";
1158
1159+ var appSurfaceId = topLevelSurfaceList.nextId;
1160+ var app = ApplicationManager.startApplication("unity8-dash")
1161+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1162+
1163 var webBrowserSurfaceId = topLevelSurfaceList.nextId;
1164 var webBrowserApp = ApplicationManager.startApplication("webbrowser-app");
1165 waitUntilAppWindowIsFullyLoaded(webBrowserSurfaceId);
1166@@ -2415,7 +2441,7 @@
1167
1168 tryCompare(broadcastUrlSpy, "count", 1);
1169 compare(broadcastUrlSpy.signalArguments[0][0], "application:///" + appIcon.appId + ".desktop");
1170- compare(ApplicationManager.count, 1); // confirm only dash is open, we didn't start new app
1171+ compare(ApplicationManager.count, 0); // confirm no app is open, we didn't start new app
1172
1173 var coverPage = findChild(shell, "coverPage");
1174 tryCompare(coverPage, "showProgress", 0);
1175@@ -2456,7 +2482,7 @@
1176
1177 tryCompare(broadcastUrlSpy, "count", 1);
1178 compare(broadcastUrlSpy.signalArguments[0][0], "test:");
1179- compare(ApplicationManager.count, 1); // confirm only dash is open, we didn't start new app
1180+ compare(ApplicationManager.count, 0); // confirm no app is open, we didn't start new app
1181
1182 var coverPage = findChild(shell, "coverPage");
1183 tryCompare(coverPage, "showProgress", 0);
1184@@ -2685,6 +2711,10 @@
1185 ensureInputMethodSurface();
1186 shell.oskEnabled = data.oskEnabled;
1187
1188+ var appSurfaceId = topLevelSurfaceList.nextId;
1189+ var app = ApplicationManager.startApplication("unity8-dash")
1190+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1191+
1192 var oldOSKState = topLevelSurfaceList.inputMethodSurface.state;
1193 topLevelSurfaceList.inputMethodSurface.requestState(Mir.RestoredState);
1194 var appRepeater = findChild(shell, "appRepeater");
1195@@ -2957,7 +2987,11 @@
1196 swipeAwayGreeter();
1197
1198 var appSurfaceId = topLevelSurfaceList.nextId;
1199- var app = ApplicationManager.startApplication("dialer-app")
1200+ var app = ApplicationManager.startApplication("unity8-dash")
1201+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1202+
1203+ appSurfaceId = topLevelSurfaceList.nextId;
1204+ app = ApplicationManager.startApplication("dialer-app")
1205 waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1206
1207 appSurfaceId = topLevelSurfaceList.nextId;
1208@@ -2984,12 +3018,6 @@
1209 // Now the dash should be highlighted
1210 tryCompareFunction(function() {return appRepeater.itemAt(spread.highlightedIndex).appId == "unity8-dash"}, true);
1211
1212- keyClick(Qt.Key_Q);
1213-
1214- // Dash is not closeable, should still be 2
1215- tryCompare(ApplicationManager, "count", 2);
1216-
1217- // Move to the next one, should be closable again
1218 keyClick(Qt.Key_Tab);
1219 tryCompareFunction(function() {return appRepeater.itemAt(spread.highlightedIndex).appId == "calendar-app"}, true);
1220
1221@@ -3170,6 +3198,96 @@
1222 tryCompare(menuBarLoader.item, "visible", true);
1223 }
1224
1225+ function test_enforceFocusOnStageOnAltTab() {
1226+ loadShell("desktop");
1227+ shell.usageScenario = "desktop";
1228+ waitForRendering(shell);
1229+ swipeAwayGreeter();
1230+
1231+ var appSurfaceId = topLevelSurfaceList.nextId;
1232+ var app = ApplicationManager.startApplication("unity8-dash")
1233+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1234+
1235+ var appDelegate = startApplication("music-app")
1236+ verify(appDelegate);
1237+ waitForRendering(shell);
1238+
1239+ var launcher = findChild(shell, "launcher");
1240+ launcher.focus = true;
1241+
1242+ var stage = findChild(shell, "stage");
1243+
1244+ var spreadItem = findChild(shell, "spreadItem");
1245+
1246+ compare(spreadItem.highlightedIndex, -1);
1247+
1248+ keyPress(Qt.Key_Alt);
1249+ keyClick(Qt.Key_Tab);
1250+
1251+ tryCompare(spreadItem, "highlightedIndex", 1);
1252+ tryCompare(stage, "focus", true);
1253+
1254+ keyClick(Qt.Key_Tab);
1255+
1256+ tryCompare(spreadItem, "highlightedIndex", 0);
1257+
1258+ keyRelease(Qt.Key_Alt);
1259+ }
1260+
1261+ function test_maximizedWindowMenuThenAltTab_data() {
1262+ return [
1263+ { tag: "show spread", showSpread: true },
1264+ { tag: "do not show spread", showSpread: false },
1265+ ];
1266+ }
1267+
1268+ function test_maximizedWindowMenuThenAltTab(data) {
1269+ loadShell("desktop");
1270+ shell.usageScenario = "desktop";
1271+ waitForRendering(shell);
1272+ swipeAwayGreeter();
1273+
1274+ var appDelegate = startApplication("gmail-webapp");
1275+ var appDelegate2 = startApplication("dialer-app");
1276+
1277+ tryCompare(appDelegate2.surface, "activeFocus", true);
1278+
1279+ var maximizeButton = findChild(appDelegate2, "maximizeWindowButton");
1280+ mouseClick(maximizeButton);
1281+ tryCompare(appDelegate2, "state", "maximized");
1282+
1283+ var panel = findChild(shell, "panel");
1284+ var panelMouse = findChild(panel, "windowControlArea");
1285+ mouseMove(panelMouse);
1286+ var panelMenu = findChild(panel, "menuBar");
1287+ var menuBarLoader = findChild(panel, "menuBarLoader");
1288+ mouseMove(panelMenu);
1289+ var panelMenuItem = findChild(panelMenu, "menuBar-item0");
1290+ tryCompare(panelMenuItem, "visible", true);
1291+ Util.waitForBehaviors(shell);
1292+ mouseClick(panelMenuItem);
1293+ var panelMenuItemItem = findChild(panelMenu, "menuBar-item0-menu-item0-actionItem");
1294+ mouseMove(panelMenuItemItem, panelMenuItemItem.width/2, panelMenuItemItem.height/2);
1295+ verify(panelMenuItemItem.activeFocus);
1296+ verify(panelMenuItem.__popup);
1297+
1298+ keyPress(Qt.Key_Alt);
1299+ keyClick(Qt.Key_Tab);
1300+ if (data.showSpread) {
1301+ tryCompare(stage, "spreadShown", true);
1302+ }
1303+ tryCompareFunction(function() { return menuBarLoader.active === false; }, true);
1304+ keyRelease(Qt.Key_Alt)
1305+
1306+ tryCompare(appDelegate.surface, "activeFocus", true);
1307+
1308+ keyPress(Qt.Key_Alt);
1309+ keyClick(Qt.Key_Tab);
1310+ keyRelease(Qt.Key_Alt)
1311+
1312+ tryCompare(appDelegate2.surface, "activeFocus", true);
1313+ }
1314+
1315 function test_maximizedWindowAndMenuInPanel() {
1316 loadShell("desktop");
1317 shell.usageScenario = "desktop";

Subscribers

People subscribed via source and target branches