Merge lp:~lukas-kde/unity8/minimized-and-fullscreen-window-fixes into lp:unity8

Proposed by Lukáš Tinkl on 2017-01-24
Status: Merged
Approved by: Michael Zanetti on 2017-01-27
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
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Abstain on 2017-02-07
Michael Zanetti (community) 2017-01-24 Approve on 2017-01-27
Unity8 CI Bot continuous-integration Approve on 2017-01-27
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

To post a comment you must log in.
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 on 2017-01-25

add a note about the longterm TODO

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2774
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3022/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3932
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2304
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2304
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3960
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3805/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3022/rebuild

review: Approve (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2775
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3027/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3938
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2306
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2306
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3966
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3811
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3811/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3811
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3811/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3811
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3811/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3811
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3811/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3811
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3811/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3811
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3811/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3027/rebuild

review: Approve (continuous-integration)
2776. By Lukáš Tinkl on 2017-01-26

merge trunk

2777. By Lukáš Tinkl on 2017-01-26

add a test for normal -> maximizedRight -> fullscreen -> maximizedRight

Michael Zanetti (mzanetti) wrote :

changes look good to me, and fixes seem to work fine.

waiting for CI for top approval

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2777
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3060/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3980
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2327
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2327
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4008
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3852
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3852/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3852
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3852/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3852
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3852/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3852
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3852/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3852
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3852/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3852
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3852/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3060/rebuild

review: Approve (continuous-integration)
2778. By Lukáš Tinkl on 2017-01-26

raise the surface when focusing it; fixes alt-tabbing to a minimized window

2779. By Lukáš Tinkl on 2017-01-26

add a test for alt-tabbing to a minimized window

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2778
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3062/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3982
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2329
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2329
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4010
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3854
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3854/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3854
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3854/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3854
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3854/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3854
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3854/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3854
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3854/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3854
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3854/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3062/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2779
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3063/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3983
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2330
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2330
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4011
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3855
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3855/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3855
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3855/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3855
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3855/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3855
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3855/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3855
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3855/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3855
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3855/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3063/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2779
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3065/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2333
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2333
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4015
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3859/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3065/rebuild

review: Approve (continuous-integration)
Michael Zanetti (mzanetti) wrote :

still good, CI finally green

review: Approve
Albert Astals Cid (aacid) wrote :

Text conflict in qml/Stage/Stage.qml
1 conflicts encountered.

review: Needs Fixing
2780. By Lukáš Tinkl on 2017-02-07

merge trunk, resolve conflict

Lukáš Tinkl (lukas-kde) wrote :

> Text conflict in qml/Stage/Stage.qml
> 1 conflicts encountered.

Fixed

Albert Astals Cid (aacid) :
review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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 }

Subscribers

People subscribed via source and target branches