Merge lp:~aacid/unity8/alt_tab_close_top_menu into lp:unity8
- alt_tab_close_top_menu
- Merge into trunk
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~aacid/unity8/alt_tab_close_top_menu | ||||
Merge into: | lp:unity8 | ||||
Prerequisite: | lp:~aacid/unity8/stray_menus | ||||
Diff against target: |
225 lines (+68/-34) 7 files modified
qml/Panel/Panel.qml (+8/-8) qml/Shell.qml (+1/-0) qml/Stage/DecoratedWindow.qml (+1/-0) qml/Stage/Stage.qml (+2/-1) qml/Stage/WindowDecoration.qml (+1/-0) tests/qmltests/Panel/tst_Panel.qml (+3/-25) tests/qmltests/tst_Shell.qml (+52/-0) |
||||
To merge this branch: | bzr merge lp:~aacid/unity8/alt_tab_close_top_menu | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot | continuous-integration | Approve | |
Daniel d'Andrada (community) | Approve | ||
Review via email: mp+319826@code.launchpad.net |
This proposal has been superseded by a proposal from 2017-04-03.
Commit message
Close top bar menu on alt+tab
Includes test that checks it works (and checks focus doesn't get lost in the middle of nowhere later)
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
No
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
Daniel d'Andrada (dandrader) wrote : | # |
"""
mouseClick(
"""
Just mouseClick(
Daniel d'Andrada (dandrader) wrote : | # |
Still about the test:
- Can you click to show the menu instead of doing it programmatically?
- Shouldn't you check that the menu is no longer around while Alt is still pressed (and so the spread is still being shown)?
Daniel d'Andrada (dandrader) : | # |
Albert Astals Cid (aacid) wrote : | # |
> Still about the test:
> - Can you click to show the menu instead of doing it programmatically?
Yep, done
> - Shouldn't you check that the menu is no longer around while Alt is still
> pressed (and so the spread is still being shown)?
Makes sense, done.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2870
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2870
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2871
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : | # |
Thanks
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass? If not, please explain why.
Yes
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2873
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2876
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2876
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2876
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2877. By Albert Astals Cid
- 2878. By Albert Astals Cid
-
Adapt to code changes, now it's mostly a test
- 2879. By Albert Astals Cid
-
mrege again
Unmerged revisions
- 2879. By Albert Astals Cid
-
mrege again
- 2878. By Albert Astals Cid
-
Adapt to code changes, now it's mostly a test
- 2877. By Albert Astals Cid
- 2876. By Albert Astals Cid
-
try to find a non conflicting place ^_^
- 2875. By Albert Astals Cid
-
Merge
- 2874. By Albert Astals Cid
-
Need to wait a bit
- 2873. By Albert Astals Cid
-
whitespace
- 2872. By Albert Astals Cid
-
Merge
- 2871. By Albert Astals Cid
-
Move the check for no popup to before releasing alt
- 2870. By Albert Astals Cid
-
Use the mouse to show the menu
Preview Diff
1 | === modified file 'qml/Panel/Panel.qml' |
2 | --- qml/Panel/Panel.qml 2017-03-21 10:55:52 +0000 |
3 | +++ qml/Panel/Panel.qml 2017-04-03 13:39:39 +0000 |
4 | @@ -1,5 +1,5 @@ |
5 | /* |
6 | - * Copyright (C) 2013-2016 Canonical, Ltd. |
7 | + * Copyright (C) 2013-2017 Canonical, Ltd. |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by |
11 | @@ -85,15 +85,15 @@ |
12 | property bool showWindowDecorationControls: (revealControls && PanelState.decorationsVisible) || |
13 | PanelState.decorationsAlwaysVisible |
14 | |
15 | - property bool showPointerMenu: revealControls && |
16 | + property bool showPointerMenu: revealControls && enablePointerMenu && |
17 | (PanelState.decorationsVisible || mode == "staged") |
18 | |
19 | - property bool enablePointerMenu: revealControls && |
20 | - applicationMenus.available && |
21 | + property bool enablePointerMenu: applicationMenus.available && |
22 | applicationMenus.model |
23 | |
24 | property bool showTouchMenu: !greeterShown && |
25 | - !showPointerMenu |
26 | + !showPointerMenu && |
27 | + !showWindowDecorationControls |
28 | |
29 | property bool enableTouchMenus: showTouchMenu && |
30 | applicationMenus.available && |
31 | @@ -211,7 +211,7 @@ |
32 | opacity: d.showPointerMenu ? 1 : 0 |
33 | visible: opacity != 0 |
34 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
35 | - active: __applicationMenus.model && !callHint.visible |
36 | + active: d.showPointerMenu && !callHint.visible |
37 | |
38 | width: parent.width - windowControlButtons.width - units.gu(2) - __indicators.barWidth |
39 | |
40 | @@ -220,7 +220,7 @@ |
41 | sourceComponent: MenuBar { |
42 | id: bar |
43 | objectName: "menuBar" |
44 | - anchors.left: parent.left |
45 | + anchors.left: parent ? parent.left : undefined |
46 | anchors.margins: units.gu(1) |
47 | height: menuBarLoader.height |
48 | enableKeyFilter: valid && PanelState.decorationsVisible |
49 | @@ -339,7 +339,7 @@ |
50 | maximumLineCount: 1 |
51 | fontSize: "medium" |
52 | font.weight: Font.Medium |
53 | - color: Theme.palette.selected.backgroundText |
54 | + color: theme.palette.selected.backgroundText |
55 | opacity: __applicationMenus.visible && !__applicationMenus.expanded ? 1 : 0 |
56 | visible: opacity != 0 |
57 | Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
58 | |
59 | === modified file 'qml/Shell.qml' |
60 | --- qml/Shell.qml 2017-03-24 14:04:50 +0000 |
61 | +++ qml/Shell.qml 2017-04-03 13:39:39 +0000 |
62 | @@ -328,6 +328,7 @@ |
63 | panel.indicators.hide(); |
64 | panel.applicationMenus.hide(); |
65 | } |
66 | + onAltTabPressedChanged: if (altTabPressed) focus = true; |
67 | } |
68 | |
69 | TouchGestureArea { |
70 | |
71 | === modified file 'qml/Stage/DecoratedWindow.qml' |
72 | --- qml/Stage/DecoratedWindow.qml 2017-03-24 14:04:50 +0000 |
73 | +++ qml/Stage/DecoratedWindow.qml 2017-04-03 13:39:39 +0000 |
74 | @@ -38,6 +38,7 @@ |
75 | property alias maximizeButtonShown: decoration.maximizeButtonShown |
76 | property alias interactive: applicationWindow.interactive |
77 | readonly property alias orientationChangesEnabled: applicationWindow.orientationChangesEnabled |
78 | + property alias windowControlButtonsVisible: decoration.windowControlButtonsVisible |
79 | |
80 | // Changing this will actually add/remove a decoration, meaning, requestedHeight will take the decoration into account. |
81 | property bool hasDecoration: true |
82 | |
83 | === modified file 'qml/Stage/Stage.qml' |
84 | --- qml/Stage/Stage.qml 2017-03-28 21:46:37 +0000 |
85 | +++ qml/Stage/Stage.qml 2017-04-03 13:39:39 +0000 |
86 | @@ -390,7 +390,7 @@ |
87 | Binding { |
88 | target: PanelState |
89 | property: "decorationsVisible" |
90 | - value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus |
91 | + value: mode == "windowed" && priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !root.spreadShown |
92 | } |
93 | |
94 | Binding { |
95 | @@ -1385,6 +1385,7 @@ |
96 | requestedHeight: appContainer.height; |
97 | } |
98 | PropertyChanges { target: touchControls; enabled: true } |
99 | + PropertyChanges { target: decoratedWindow; windowControlButtonsVisible: false } |
100 | }, |
101 | State { |
102 | name: "fullscreen"; when: appDelegate.fullscreen && !appDelegate.minimized |
103 | |
104 | === modified file 'qml/Stage/WindowDecoration.qml' |
105 | --- qml/Stage/WindowDecoration.qml 2017-03-01 12:18:59 +0000 |
106 | +++ qml/Stage/WindowDecoration.qml 2017-04-03 13:39:39 +0000 |
107 | @@ -34,6 +34,7 @@ |
108 | property var menu: undefined |
109 | property bool enableMenus: true |
110 | property bool windowMoving: false |
111 | + property alias windowControlButtonsVisible: buttons.visible |
112 | |
113 | readonly property real buttonsWidth: buttons.width + row.spacing |
114 | |
115 | |
116 | === modified file 'tests/qmltests/Panel/tst_Panel.qml' |
117 | --- tests/qmltests/Panel/tst_Panel.qml 2017-03-17 13:44:30 +0000 |
118 | +++ tests/qmltests/Panel/tst_Panel.qml 2017-04-03 13:39:39 +0000 |
119 | @@ -779,40 +779,18 @@ |
120 | |
121 | var appTitle = findChild(panel, "panelTitle"); verify(appTitle); |
122 | var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow); |
123 | - var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar); |
124 | + var menuBarLoader = findChild(panel, "menuBarLoader"); verify(menuBarLoader); |
125 | |
126 | tryCompare(appTitle, "visible", true, undefined, "App title should be visible"); |
127 | - tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible"); |
128 | + tryCompare(menuBarLoader, "visible", false, undefined, "App menu bar should not be visible"); |
129 | |
130 | mouseMove(panel, panel.width/2, panel.panelHeight); |
131 | |
132 | + var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar); |
133 | tryCompare(appTitle, "visible", false, undefined, "App title should not be visible on mouse hover"); |
134 | tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover"); |
135 | } |
136 | |
137 | - function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown() { |
138 | - PanelState.title = "Fake Title"; |
139 | - panel.mode = "windowed"; |
140 | - mouseEmulation.checked = false; |
141 | - |
142 | - var appTitle = findChild(panel, "panelTitle"); verify(appTitle); |
143 | - var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow); |
144 | - var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar); |
145 | - |
146 | - tryCompare(appTitle, "visible", true, undefined, "App title should be visible"); |
147 | - tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible"); |
148 | - |
149 | - mouseMove(panel, panel.width/2, panel.panelHeight); |
150 | - |
151 | - tryCompare(appTitle, "visible", true, undefined, "App title should still be visible on mouse hover when panel decorations are not visible"); |
152 | - tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should be visible on mouse hover when panel decorations are not visible"); |
153 | - |
154 | - PanelState.decorationsVisible = true; |
155 | - |
156 | - tryCompare(appTitle, "visible", false, undefined, "App title should still be visible on mouse hover when panel decorations are visible"); |
157 | - tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover when panel decorations not visible"); |
158 | - } |
159 | - |
160 | function test_keyboardNavigation_data() { |
161 | return [ |
162 | {tag: "tab to start", doTab: false}, |
163 | |
164 | === modified file 'tests/qmltests/tst_Shell.qml' |
165 | --- tests/qmltests/tst_Shell.qml 2017-03-24 11:08:11 +0000 |
166 | +++ tests/qmltests/tst_Shell.qml 2017-04-03 13:39:39 +0000 |
167 | @@ -3057,6 +3057,58 @@ |
168 | tryCompare(topLevelSurfaceList.applicationAt(0), "appId", "dialer-app"); |
169 | } |
170 | |
171 | + function test_maximizedWindowMenuThenAltTab_data() { |
172 | + return [ |
173 | + { tag: "show spread", showSpread: true }, |
174 | + { tag: "do not show spread", showSpread: false }, |
175 | + ]; |
176 | + } |
177 | + |
178 | + function test_maximizedWindowMenuThenAltTab(data) { |
179 | + loadShell("desktop"); |
180 | + shell.usageScenario = "desktop"; |
181 | + waitForRendering(shell); |
182 | + swipeAwayGreeter(); |
183 | + |
184 | + var appDelegate = startApplication("gmail-webapp"); |
185 | + var appDelegate2 = startApplication("dialer-app"); |
186 | + |
187 | + var maximizeButton = findChild(appDelegate2, "maximizeWindowButton"); |
188 | + mouseClick(maximizeButton); |
189 | + tryCompare(appDelegate2, "state", "maximized"); |
190 | + |
191 | + var panel = findChild(shell, "panel"); |
192 | + var panelMouse = findChild(panel, "windowControlArea"); |
193 | + mouseMove(panelMouse); |
194 | + var panelMenu = findChild(panel, "menuBar"); |
195 | + var menuBarLoader = findChild(panel, "menuBarLoader"); |
196 | + mouseMove(panelMenu); |
197 | + var panelMenuItem = findChild(panelMenu, "menuBar-item0"); |
198 | + tryCompare(panelMenuItem, "visible", true); |
199 | + Util.waitForBehaviors(shell); |
200 | + mouseClick(panelMenuItem); |
201 | + var panelMenuItemItem = findChild(panelMenu, "menuBar-item0-menu-item0-actionItem"); |
202 | + mouseMove(panelMenuItemItem, panelMenuItemItem.width/2, panelMenuItemItem.height/2); |
203 | + verify(panelMenuItemItem.activeFocus); |
204 | + verify(panelMenuItem.__popup); |
205 | + |
206 | + keyPress(Qt.Key_Alt); |
207 | + keyClick(Qt.Key_Tab); |
208 | + if (data.showSpread) { |
209 | + tryCompare(stage, "spreadShown", true); |
210 | + } |
211 | + tryCompareFunction(function() { return menuBarLoader.active === false; }, true); |
212 | + keyRelease(Qt.Key_Alt) |
213 | + |
214 | + tryCompare(appDelegate.surface, "activeFocus", true); |
215 | + |
216 | + keyPress(Qt.Key_Alt); |
217 | + keyClick(Qt.Key_Tab); |
218 | + keyRelease(Qt.Key_Alt) |
219 | + |
220 | + tryCompare(appDelegate2.surface, "activeFocus", true); |
221 | + } |
222 | + |
223 | function test_touchMenuPosition_data() { |
224 | return [ |
225 | { tag: "launcher locked", lockLauncher: true }, |
PASSED: Continuous integration, rev:2869 /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/3371/ /unity8- jenkins. ubuntu. com/job/ build/4443 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= xenial+ overlay, testname= qmluitests. sh/2662 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= zesty,testname= qmluitests. sh/2662 /unity8- jenkins. ubuntu. com/job/ build-0- fetch/4471 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 4301 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 4301/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/4301 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/4301/ artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 4301 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 4301/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/4301 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/4301/ artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 4301 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 4301/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/4301 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/4301/ artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/3371/ rebuild
https:/