Merge lp:~lukas-kde/unity8/minimized-and-fullscreen-window-fixes into lp:unity8
- minimized-and-fullscreen-window-fixes
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michael Zanetti |
Approved revision: | 2779 |
Merged at revision: | 2818 |
Proposed branch: | lp:~lukas-kde/unity8/minimized-and-fullscreen-window-fixes |
Merge into: | lp:unity8 |
Prerequisite: | lp:~ci-train-bot/unity8/unity8-ubuntu-zesty-2272 |
Diff against target: |
188 lines (+80/-11) 4 files modified
qml/Shell.qml (+2/-1) qml/Stage/Stage.qml (+15/-5) tests/mocks/Unity/Application/SurfaceManager.cpp (+4/-5) tests/qmltests/tst_Shell.qml (+59/-0) |
To merge this branch: | bzr merge lp:~lukas-kde/unity8/minimized-and-fullscreen-window-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Astals Cid (community) | Abstain | ||
Michael Zanetti (community) | Approve | ||
Unity8 CI Bot | continuous-integration | Approve | |
Review via email: mp+315523@code.launchpad.net |
Commit message
Fixes for activating minimized windows and restoring fullscreen ones
Description of the change
Fixes for fullscreen windows while in spread, activating minimized windows and restoring fullscreen ones
* Are there any related MPs required for this MP to build/function as expected? Please list.
Yes, prereq (silo 2272)
* 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 : | # |
Lukáš Tinkl (lukas-kde) wrote : | # |
Note this is really only a short-term fix; the long-term one should be to synchronize the various extra window (maximized) types between Mir, Miral and qtmir, and then drop ours from unity8 and use the ones from qtmir.
- 2775. By Lukáš Tinkl
-
add a note about the longterm TODO
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2774
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:2775
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:/
- 2776. By Lukáš Tinkl
-
merge trunk
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2776
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2777. By Lukáš Tinkl
-
add a test for normal -> maximizedRight -> fullscreen -> maximizedRight
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2777
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Michael Zanetti (mzanetti) wrote : | # |
changes look good to me, and fixes seem to work fine.
waiting for CI for top approval
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2777
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:/
- 2778. By Lukáš Tinkl
-
raise the surface when focusing it; fixes alt-tabbing to a minimized window
- 2779. By Lukáš Tinkl
-
add a test for alt-tabbing to a minimized window
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2778
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:2779
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 : | # |
PASSED: Continuous integration, rev:2779
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:/
Michael Zanetti (mzanetti) wrote : | # |
still good, CI finally green
Albert Astals Cid (aacid) wrote : | # |
Text conflict in qml/Stage/Stage.qml
1 conflicts encountered.
- 2780. By Lukáš Tinkl
-
merge trunk, resolve conflict
Lukáš Tinkl (lukas-kde) wrote : | # |
> Text conflict in qml/Stage/Stage.qml
> 1 conflicts encountered.
Fixed
Albert Astals Cid (aacid) : | # |
Preview Diff
1 | === modified file 'qml/Shell.qml' |
2 | --- qml/Shell.qml 2017-01-24 07:43:54 +0000 |
3 | +++ qml/Shell.qml 2017-02-07 16:21:44 +0000 |
4 | @@ -523,12 +523,13 @@ |
5 | hides: [launcher] |
6 | available: (!greeter || !greeter.shown) |
7 | && !shell.waitingOnGreeter |
8 | + && !stage.spreadShown |
9 | } |
10 | |
11 | readonly property bool focusedSurfaceIsFullscreen: topLevelSurfaceList.focusedWindow |
12 | ? topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState |
13 | : false |
14 | - fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0) |
15 | + fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0 && !stage.spreadShown) |
16 | || greeter.hasLockedApp |
17 | greeterShown: greeter && greeter.shown |
18 | } |
19 | |
20 | === modified file 'qml/Stage/Stage.qml' |
21 | --- qml/Stage/Stage.qml 2017-01-26 11:10:01 +0000 |
22 | +++ qml/Stage/Stage.qml 2017-02-07 16:21:44 +0000 |
23 | @@ -101,6 +101,8 @@ |
24 | // No we didn't, do a quick alt-tab |
25 | if (appRepeater.count > 1) { |
26 | appRepeater.itemAt(1).activate(); |
27 | + } else if (appRepeater.count > 0) { |
28 | + appRepeater.itemAt(0).activate(); // quick alt-tab to the only (minimized) window should still activate it |
29 | } |
30 | } |
31 | } |
32 | @@ -811,7 +813,7 @@ |
33 | maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight |
34 | |
35 | readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized |
36 | - readonly property bool fullscreen: window.state === Mir.FullscreenState |
37 | + readonly property bool fullscreen: windowState === WindowStateStorage.WindowStateFullscreen |
38 | |
39 | readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically |
40 | readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) && |
41 | @@ -822,7 +824,10 @@ |
42 | readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height |
43 | readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled |
44 | |
45 | + // TODO drop our own windowType once Mir/Miral/Qtmir gets in sync with ours |
46 | property int windowState: WindowStateStorage.WindowStateNormal |
47 | + property int prevWindowState: WindowStateStorage.WindowStateRestored |
48 | + |
49 | property bool animationsEnabled: true |
50 | property alias title: decoratedWindow.title |
51 | readonly property string appName: model.application ? model.application.name : "" |
52 | @@ -877,9 +882,6 @@ |
53 | } |
54 | priv.updateMainAndSideStageIndexes(); |
55 | } |
56 | - if (root.mode == "windowed") { |
57 | - appDelegate.restore(true /* animated */, appDelegate.windowState); |
58 | - } |
59 | appDelegate.focus = true; |
60 | } |
61 | |
62 | @@ -929,7 +931,14 @@ |
63 | } else if (model.window.state === Mir.MaximizedBottomRightState) { |
64 | appDelegate.maximizeBottomRight(); |
65 | } else if (model.window.state === Mir.RestoredState) { |
66 | - appDelegate.restore(); |
67 | + if (appDelegate.fullscreen && appDelegate.prevWindowState != WindowStateStorage.WindowStateRestored) { |
68 | + model.window.requestState(WindowStateStorage.toMirState(appDelegate.prevWindowState)); |
69 | + } else { |
70 | + appDelegate.restore(); |
71 | + } |
72 | + } else if (model.window.state === Mir.FullscreenState) { |
73 | + appDelegate.prevWindowState = appDelegate.windowState; |
74 | + appDelegate.windowState = WindowStateStorage.WindowStateFullscreen; |
75 | } |
76 | } |
77 | } |
78 | @@ -1031,6 +1040,7 @@ |
79 | animationsEnabled = (animated === undefined) || animated; |
80 | windowState = state || WindowStateStorage.WindowStateRestored; |
81 | windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit |
82 | + prevWindowState = windowState; |
83 | } |
84 | |
85 | function playFocusAnimation() { |
86 | |
87 | === modified file 'tests/mocks/Unity/Application/SurfaceManager.cpp' |
88 | --- tests/mocks/Unity/Application/SurfaceManager.cpp 2017-01-26 11:10:01 +0000 |
89 | +++ tests/mocks/Unity/Application/SurfaceManager.cpp 2017-02-07 16:21:44 +0000 |
90 | @@ -211,8 +211,6 @@ |
91 | |
92 | void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state) |
93 | { |
94 | - Q_ASSERT(!m_underModification); |
95 | - |
96 | DEBUG_MSG("("<<surface<<","<<state<<") started"); |
97 | Q_EMIT modificationsStarted(); |
98 | m_underModification = true; |
99 | @@ -266,9 +264,10 @@ |
100 | if (m_focusedSurface) { |
101 | m_focusedSurface->setFocused(false); |
102 | } |
103 | - if (chosenSurface) { |
104 | - chosenSurface->setFocused(true); |
105 | - } |
106 | + |
107 | + chosenSurface->setFocused(true); |
108 | + doRaise(chosenSurface); |
109 | + |
110 | m_focusedSurface = chosenSurface; |
111 | } |
112 | |
113 | |
114 | === modified file 'tests/qmltests/tst_Shell.qml' |
115 | --- tests/qmltests/tst_Shell.qml 2017-01-24 07:43:54 +0000 |
116 | +++ tests/qmltests/tst_Shell.qml 2017-02-07 16:21:44 +0000 |
117 | @@ -335,6 +335,8 @@ |
118 | Row { |
119 | CheckBox { |
120 | id: fullscreeAppCheck |
121 | + activeFocusOnPress: false |
122 | + activeFocusOnTab: false |
123 | |
124 | onTriggered: { |
125 | if (!topLevelSurfaceList.focusedWindow) return; |
126 | @@ -2779,5 +2781,62 @@ |
127 | } |
128 | tryCompareFunction(function() { return drawer.visible; }, false); |
129 | } |
130 | + |
131 | + function test_restoreFromFullscreen() { |
132 | + loadShell("desktop"); |
133 | + shell.usageScenario = "desktop"; |
134 | + waitForRendering(shell); |
135 | + swipeAwayGreeter(); |
136 | + |
137 | + var appSurfaceId = topLevelSurfaceList.nextId; |
138 | + var app = ApplicationManager.startApplication("dialer-app") |
139 | + waitUntilAppWindowIsFullyLoaded(appSurfaceId); |
140 | + |
141 | + // start dialer |
142 | + var appContainer = findChild(shell, "appContainer"); |
143 | + var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId); |
144 | + verify(appDelegate); |
145 | + tryCompare(appDelegate, "state", "normal"); |
146 | + |
147 | + // now maximize to right |
148 | + appDelegate.requestMaximizeRight(); |
149 | + tryCompare(appDelegate, "state", "maximizedRight"); |
150 | + |
151 | + // switch to fullscreen |
152 | + app.surfaceList.get(0).requestState(Mir.FullscreenState); |
153 | + tryCompare(appDelegate, "state", "fullscreen"); |
154 | + |
155 | + // restore, should go back to maximizedRight, not restored |
156 | + appDelegate.requestRestore(); |
157 | + tryCompare(appDelegate, "state", "maximizedRight"); |
158 | + } |
159 | + |
160 | + function test_altTabToMinimizedApp() { |
161 | + loadShell("desktop"); |
162 | + shell.usageScenario = "desktop"; |
163 | + waitForRendering(shell); |
164 | + swipeAwayGreeter(); |
165 | + |
166 | + var appSurfaceId = topLevelSurfaceList.nextId; |
167 | + var app = ApplicationManager.startApplication("dialer-app") |
168 | + waitUntilAppWindowIsFullyLoaded(appSurfaceId); |
169 | + |
170 | + // start dialer |
171 | + var appContainer = findChild(shell, "appContainer"); |
172 | + var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId); |
173 | + verify(appDelegate); |
174 | + tryCompare(appDelegate, "state", "normal"); |
175 | + |
176 | + // minimize dialer |
177 | + appDelegate.requestMinimize(); |
178 | + tryCompare(appDelegate, "state", "minimized"); |
179 | + |
180 | + // try to bring dialer back from minimized by doing alt-tab |
181 | + keyClick(Qt.Key_Tab, Qt.AltModifier); |
182 | + tryCompare(appDelegate, "visible", true); |
183 | + tryCompare(appDelegate, "focus", true); |
184 | + tryCompare(topLevelSurfaceList.focusedWindow, "surface", appDelegate.surface); |
185 | + tryCompare(topLevelSurfaceList.applicationAt(0), "appId", "dialer-app"); |
186 | + } |
187 | } |
188 | } |
FAILED: Continuous integration, rev:2774 /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/3021/ /unity8- jenkins. ubuntu. com/job/ build/3928/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/3956 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 3801/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/3801/ console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 3801/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/3801/ console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 3801/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/3801/ console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/3021/ rebuild
https:/