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