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 | 523 | hides: [launcher] | 523 | hides: [launcher] |
6 | 524 | available: (!greeter || !greeter.shown) | 524 | available: (!greeter || !greeter.shown) |
7 | 525 | && !shell.waitingOnGreeter | 525 | && !shell.waitingOnGreeter |
8 | 526 | && !stage.spreadShown | ||
9 | 526 | } | 527 | } |
10 | 527 | 528 | ||
11 | 528 | readonly property bool focusedSurfaceIsFullscreen: topLevelSurfaceList.focusedWindow | 529 | readonly property bool focusedSurfaceIsFullscreen: topLevelSurfaceList.focusedWindow |
12 | 529 | ? topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState | 530 | ? topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState |
13 | 530 | : false | 531 | : false |
15 | 531 | fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0) | 532 | fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0 && !stage.spreadShown) |
16 | 532 | || greeter.hasLockedApp | 533 | || greeter.hasLockedApp |
17 | 533 | greeterShown: greeter && greeter.shown | 534 | greeterShown: greeter && greeter.shown |
18 | 534 | } | 535 | } |
19 | 535 | 536 | ||
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 | 101 | // No we didn't, do a quick alt-tab | 101 | // No we didn't, do a quick alt-tab |
25 | 102 | if (appRepeater.count > 1) { | 102 | if (appRepeater.count > 1) { |
26 | 103 | appRepeater.itemAt(1).activate(); | 103 | appRepeater.itemAt(1).activate(); |
27 | 104 | } else if (appRepeater.count > 0) { | ||
28 | 105 | appRepeater.itemAt(0).activate(); // quick alt-tab to the only (minimized) window should still activate it | ||
29 | 104 | } | 106 | } |
30 | 105 | } | 107 | } |
31 | 106 | } | 108 | } |
32 | @@ -811,7 +813,7 @@ | |||
33 | 811 | maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight | 813 | maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight |
34 | 812 | 814 | ||
35 | 813 | readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized | 815 | readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized |
37 | 814 | readonly property bool fullscreen: window.state === Mir.FullscreenState | 816 | readonly property bool fullscreen: windowState === WindowStateStorage.WindowStateFullscreen |
38 | 815 | 817 | ||
39 | 816 | readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically | 818 | readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically |
40 | 817 | readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) && | 819 | readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) && |
41 | @@ -822,7 +824,10 @@ | |||
42 | 822 | readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height | 824 | readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height |
43 | 823 | readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled | 825 | readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled |
44 | 824 | 826 | ||
45 | 827 | // TODO drop our own windowType once Mir/Miral/Qtmir gets in sync with ours | ||
46 | 825 | property int windowState: WindowStateStorage.WindowStateNormal | 828 | property int windowState: WindowStateStorage.WindowStateNormal |
47 | 829 | property int prevWindowState: WindowStateStorage.WindowStateRestored | ||
48 | 830 | |||
49 | 826 | property bool animationsEnabled: true | 831 | property bool animationsEnabled: true |
50 | 827 | property alias title: decoratedWindow.title | 832 | property alias title: decoratedWindow.title |
51 | 828 | readonly property string appName: model.application ? model.application.name : "" | 833 | readonly property string appName: model.application ? model.application.name : "" |
52 | @@ -877,9 +882,6 @@ | |||
53 | 877 | } | 882 | } |
54 | 878 | priv.updateMainAndSideStageIndexes(); | 883 | priv.updateMainAndSideStageIndexes(); |
55 | 879 | } | 884 | } |
56 | 880 | if (root.mode == "windowed") { | ||
57 | 881 | appDelegate.restore(true /* animated */, appDelegate.windowState); | ||
58 | 882 | } | ||
59 | 883 | appDelegate.focus = true; | 885 | appDelegate.focus = true; |
60 | 884 | } | 886 | } |
61 | 885 | 887 | ||
62 | @@ -929,7 +931,14 @@ | |||
63 | 929 | } else if (model.window.state === Mir.MaximizedBottomRightState) { | 931 | } else if (model.window.state === Mir.MaximizedBottomRightState) { |
64 | 930 | appDelegate.maximizeBottomRight(); | 932 | appDelegate.maximizeBottomRight(); |
65 | 931 | } else if (model.window.state === Mir.RestoredState) { | 933 | } else if (model.window.state === Mir.RestoredState) { |
67 | 932 | appDelegate.restore(); | 934 | if (appDelegate.fullscreen && appDelegate.prevWindowState != WindowStateStorage.WindowStateRestored) { |
68 | 935 | model.window.requestState(WindowStateStorage.toMirState(appDelegate.prevWindowState)); | ||
69 | 936 | } else { | ||
70 | 937 | appDelegate.restore(); | ||
71 | 938 | } | ||
72 | 939 | } else if (model.window.state === Mir.FullscreenState) { | ||
73 | 940 | appDelegate.prevWindowState = appDelegate.windowState; | ||
74 | 941 | appDelegate.windowState = WindowStateStorage.WindowStateFullscreen; | ||
75 | 933 | } | 942 | } |
76 | 934 | } | 943 | } |
77 | 935 | } | 944 | } |
78 | @@ -1031,6 +1040,7 @@ | |||
79 | 1031 | animationsEnabled = (animated === undefined) || animated; | 1040 | animationsEnabled = (animated === undefined) || animated; |
80 | 1032 | windowState = state || WindowStateStorage.WindowStateRestored; | 1041 | windowState = state || WindowStateStorage.WindowStateRestored; |
81 | 1033 | windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit | 1042 | windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit |
82 | 1043 | prevWindowState = windowState; | ||
83 | 1034 | } | 1044 | } |
84 | 1035 | 1045 | ||
85 | 1036 | function playFocusAnimation() { | 1046 | function playFocusAnimation() { |
86 | 1037 | 1047 | ||
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 | 211 | 211 | ||
92 | 212 | void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state) | 212 | void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state) |
93 | 213 | { | 213 | { |
94 | 214 | Q_ASSERT(!m_underModification); | ||
95 | 215 | |||
96 | 216 | DEBUG_MSG("("<<surface<<","<<state<<") started"); | 214 | DEBUG_MSG("("<<surface<<","<<state<<") started"); |
97 | 217 | Q_EMIT modificationsStarted(); | 215 | Q_EMIT modificationsStarted(); |
98 | 218 | m_underModification = true; | 216 | m_underModification = true; |
99 | @@ -266,9 +264,10 @@ | |||
100 | 266 | if (m_focusedSurface) { | 264 | if (m_focusedSurface) { |
101 | 267 | m_focusedSurface->setFocused(false); | 265 | m_focusedSurface->setFocused(false); |
102 | 268 | } | 266 | } |
106 | 269 | if (chosenSurface) { | 267 | |
107 | 270 | chosenSurface->setFocused(true); | 268 | chosenSurface->setFocused(true); |
108 | 271 | } | 269 | doRaise(chosenSurface); |
109 | 270 | |||
110 | 272 | m_focusedSurface = chosenSurface; | 271 | m_focusedSurface = chosenSurface; |
111 | 273 | } | 272 | } |
112 | 274 | 273 | ||
113 | 275 | 274 | ||
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 | 335 | Row { | 335 | Row { |
119 | 336 | CheckBox { | 336 | CheckBox { |
120 | 337 | id: fullscreeAppCheck | 337 | id: fullscreeAppCheck |
121 | 338 | activeFocusOnPress: false | ||
122 | 339 | activeFocusOnTab: false | ||
123 | 338 | 340 | ||
124 | 339 | onTriggered: { | 341 | onTriggered: { |
125 | 340 | if (!topLevelSurfaceList.focusedWindow) return; | 342 | if (!topLevelSurfaceList.focusedWindow) return; |
126 | @@ -2779,5 +2781,62 @@ | |||
127 | 2779 | } | 2781 | } |
128 | 2780 | tryCompareFunction(function() { return drawer.visible; }, false); | 2782 | tryCompareFunction(function() { return drawer.visible; }, false); |
129 | 2781 | } | 2783 | } |
130 | 2784 | |||
131 | 2785 | function test_restoreFromFullscreen() { | ||
132 | 2786 | loadShell("desktop"); | ||
133 | 2787 | shell.usageScenario = "desktop"; | ||
134 | 2788 | waitForRendering(shell); | ||
135 | 2789 | swipeAwayGreeter(); | ||
136 | 2790 | |||
137 | 2791 | var appSurfaceId = topLevelSurfaceList.nextId; | ||
138 | 2792 | var app = ApplicationManager.startApplication("dialer-app") | ||
139 | 2793 | waitUntilAppWindowIsFullyLoaded(appSurfaceId); | ||
140 | 2794 | |||
141 | 2795 | // start dialer | ||
142 | 2796 | var appContainer = findChild(shell, "appContainer"); | ||
143 | 2797 | var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId); | ||
144 | 2798 | verify(appDelegate); | ||
145 | 2799 | tryCompare(appDelegate, "state", "normal"); | ||
146 | 2800 | |||
147 | 2801 | // now maximize to right | ||
148 | 2802 | appDelegate.requestMaximizeRight(); | ||
149 | 2803 | tryCompare(appDelegate, "state", "maximizedRight"); | ||
150 | 2804 | |||
151 | 2805 | // switch to fullscreen | ||
152 | 2806 | app.surfaceList.get(0).requestState(Mir.FullscreenState); | ||
153 | 2807 | tryCompare(appDelegate, "state", "fullscreen"); | ||
154 | 2808 | |||
155 | 2809 | // restore, should go back to maximizedRight, not restored | ||
156 | 2810 | appDelegate.requestRestore(); | ||
157 | 2811 | tryCompare(appDelegate, "state", "maximizedRight"); | ||
158 | 2812 | } | ||
159 | 2813 | |||
160 | 2814 | function test_altTabToMinimizedApp() { | ||
161 | 2815 | loadShell("desktop"); | ||
162 | 2816 | shell.usageScenario = "desktop"; | ||
163 | 2817 | waitForRendering(shell); | ||
164 | 2818 | swipeAwayGreeter(); | ||
165 | 2819 | |||
166 | 2820 | var appSurfaceId = topLevelSurfaceList.nextId; | ||
167 | 2821 | var app = ApplicationManager.startApplication("dialer-app") | ||
168 | 2822 | waitUntilAppWindowIsFullyLoaded(appSurfaceId); | ||
169 | 2823 | |||
170 | 2824 | // start dialer | ||
171 | 2825 | var appContainer = findChild(shell, "appContainer"); | ||
172 | 2826 | var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId); | ||
173 | 2827 | verify(appDelegate); | ||
174 | 2828 | tryCompare(appDelegate, "state", "normal"); | ||
175 | 2829 | |||
176 | 2830 | // minimize dialer | ||
177 | 2831 | appDelegate.requestMinimize(); | ||
178 | 2832 | tryCompare(appDelegate, "state", "minimized"); | ||
179 | 2833 | |||
180 | 2834 | // try to bring dialer back from minimized by doing alt-tab | ||
181 | 2835 | keyClick(Qt.Key_Tab, Qt.AltModifier); | ||
182 | 2836 | tryCompare(appDelegate, "visible", true); | ||
183 | 2837 | tryCompare(appDelegate, "focus", true); | ||
184 | 2838 | tryCompare(topLevelSurfaceList.focusedWindow, "surface", appDelegate.surface); | ||
185 | 2839 | tryCompare(topLevelSurfaceList.applicationAt(0), "appId", "dialer-app"); | ||
186 | 2840 | } | ||
187 | 2782 | } | 2841 | } |
188 | 2783 | } | 2842 | } |
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:/