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

Proposed by Lukáš Tinkl
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
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

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
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

Revision history for this message
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)
Revision history for this message
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

merge trunk

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
2777. By Lukáš Tinkl

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

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

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

waiting for CI for top approval

review: Approve
Revision history for this message
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

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

Revision history for this message
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)
Revision history for this message
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)
Revision history for this message
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)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

still good, CI finally green

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

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

review: Needs Fixing
2780. By Lukáš Tinkl

merge trunk, resolve conflict

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

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

Fixed

Revision history for this message
Albert Astals Cid (aacid) :
review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2017-01-24 07:43:54 +0000
+++ qml/Shell.qml 2017-02-07 16:21:44 +0000
@@ -523,12 +523,13 @@
523 hides: [launcher]523 hides: [launcher]
524 available: (!greeter || !greeter.shown)524 available: (!greeter || !greeter.shown)
525 && !shell.waitingOnGreeter525 && !shell.waitingOnGreeter
526 && !stage.spreadShown
526 }527 }
527528
528 readonly property bool focusedSurfaceIsFullscreen: topLevelSurfaceList.focusedWindow529 readonly property bool focusedSurfaceIsFullscreen: topLevelSurfaceList.focusedWindow
529 ? topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState530 ? topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState
530 : false531 : false
531 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0)532 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0 && !stage.spreadShown)
532 || greeter.hasLockedApp533 || greeter.hasLockedApp
533 greeterShown: greeter && greeter.shown534 greeterShown: greeter && greeter.shown
534 }535 }
535536
=== modified file 'qml/Stage/Stage.qml'
--- qml/Stage/Stage.qml 2017-01-26 11:10:01 +0000
+++ qml/Stage/Stage.qml 2017-02-07 16:21:44 +0000
@@ -101,6 +101,8 @@
101 // No we didn't, do a quick alt-tab101 // No we didn't, do a quick alt-tab
102 if (appRepeater.count > 1) {102 if (appRepeater.count > 1) {
103 appRepeater.itemAt(1).activate();103 appRepeater.itemAt(1).activate();
104 } else if (appRepeater.count > 0) {
105 appRepeater.itemAt(0).activate(); // quick alt-tab to the only (minimized) window should still activate it
104 }106 }
105 }107 }
106 }108 }
@@ -811,7 +813,7 @@
811 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight813 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
812814
813 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized815 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
814 readonly property bool fullscreen: window.state === Mir.FullscreenState816 readonly property bool fullscreen: windowState === WindowStateStorage.WindowStateFullscreen
815817
816 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically818 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
817 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&819 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
@@ -822,7 +824,10 @@
822 readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height824 readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height
823 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled825 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled
824826
827 // TODO drop our own windowType once Mir/Miral/Qtmir gets in sync with ours
825 property int windowState: WindowStateStorage.WindowStateNormal828 property int windowState: WindowStateStorage.WindowStateNormal
829 property int prevWindowState: WindowStateStorage.WindowStateRestored
830
826 property bool animationsEnabled: true831 property bool animationsEnabled: true
827 property alias title: decoratedWindow.title832 property alias title: decoratedWindow.title
828 readonly property string appName: model.application ? model.application.name : ""833 readonly property string appName: model.application ? model.application.name : ""
@@ -877,9 +882,6 @@
877 }882 }
878 priv.updateMainAndSideStageIndexes();883 priv.updateMainAndSideStageIndexes();
879 }884 }
880 if (root.mode == "windowed") {
881 appDelegate.restore(true /* animated */, appDelegate.windowState);
882 }
883 appDelegate.focus = true;885 appDelegate.focus = true;
884 }886 }
885887
@@ -929,7 +931,14 @@
929 } else if (model.window.state === Mir.MaximizedBottomRightState) {931 } else if (model.window.state === Mir.MaximizedBottomRightState) {
930 appDelegate.maximizeBottomRight();932 appDelegate.maximizeBottomRight();
931 } else if (model.window.state === Mir.RestoredState) {933 } else if (model.window.state === Mir.RestoredState) {
932 appDelegate.restore();934 if (appDelegate.fullscreen && appDelegate.prevWindowState != WindowStateStorage.WindowStateRestored) {
935 model.window.requestState(WindowStateStorage.toMirState(appDelegate.prevWindowState));
936 } else {
937 appDelegate.restore();
938 }
939 } else if (model.window.state === Mir.FullscreenState) {
940 appDelegate.prevWindowState = appDelegate.windowState;
941 appDelegate.windowState = WindowStateStorage.WindowStateFullscreen;
933 }942 }
934 }943 }
935 }944 }
@@ -1031,6 +1040,7 @@
1031 animationsEnabled = (animated === undefined) || animated;1040 animationsEnabled = (animated === undefined) || animated;
1032 windowState = state || WindowStateStorage.WindowStateRestored;1041 windowState = state || WindowStateStorage.WindowStateRestored;
1033 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit1042 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
1043 prevWindowState = windowState;
1034 }1044 }
10351045
1036 function playFocusAnimation() {1046 function playFocusAnimation() {
10371047
=== modified file 'tests/mocks/Unity/Application/SurfaceManager.cpp'
--- tests/mocks/Unity/Application/SurfaceManager.cpp 2017-01-26 11:10:01 +0000
+++ tests/mocks/Unity/Application/SurfaceManager.cpp 2017-02-07 16:21:44 +0000
@@ -211,8 +211,6 @@
211211
212void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state)212void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state)
213{213{
214 Q_ASSERT(!m_underModification);
215
216 DEBUG_MSG("("<<surface<<","<<state<<") started");214 DEBUG_MSG("("<<surface<<","<<state<<") started");
217 Q_EMIT modificationsStarted();215 Q_EMIT modificationsStarted();
218 m_underModification = true;216 m_underModification = true;
@@ -266,9 +264,10 @@
266 if (m_focusedSurface) {264 if (m_focusedSurface) {
267 m_focusedSurface->setFocused(false);265 m_focusedSurface->setFocused(false);
268 }266 }
269 if (chosenSurface) {267
270 chosenSurface->setFocused(true);268 chosenSurface->setFocused(true);
271 }269 doRaise(chosenSurface);
270
272 m_focusedSurface = chosenSurface;271 m_focusedSurface = chosenSurface;
273}272}
274273
275274
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2017-01-24 07:43:54 +0000
+++ tests/qmltests/tst_Shell.qml 2017-02-07 16:21:44 +0000
@@ -335,6 +335,8 @@
335 Row {335 Row {
336 CheckBox {336 CheckBox {
337 id: fullscreeAppCheck337 id: fullscreeAppCheck
338 activeFocusOnPress: false
339 activeFocusOnTab: false
338340
339 onTriggered: {341 onTriggered: {
340 if (!topLevelSurfaceList.focusedWindow) return;342 if (!topLevelSurfaceList.focusedWindow) return;
@@ -2779,5 +2781,62 @@
2779 }2781 }
2780 tryCompareFunction(function() { return drawer.visible; }, false);2782 tryCompareFunction(function() { return drawer.visible; }, false);
2781 }2783 }
2784
2785 function test_restoreFromFullscreen() {
2786 loadShell("desktop");
2787 shell.usageScenario = "desktop";
2788 waitForRendering(shell);
2789 swipeAwayGreeter();
2790
2791 var appSurfaceId = topLevelSurfaceList.nextId;
2792 var app = ApplicationManager.startApplication("dialer-app")
2793 waitUntilAppWindowIsFullyLoaded(appSurfaceId);
2794
2795 // start dialer
2796 var appContainer = findChild(shell, "appContainer");
2797 var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId);
2798 verify(appDelegate);
2799 tryCompare(appDelegate, "state", "normal");
2800
2801 // now maximize to right
2802 appDelegate.requestMaximizeRight();
2803 tryCompare(appDelegate, "state", "maximizedRight");
2804
2805 // switch to fullscreen
2806 app.surfaceList.get(0).requestState(Mir.FullscreenState);
2807 tryCompare(appDelegate, "state", "fullscreen");
2808
2809 // restore, should go back to maximizedRight, not restored
2810 appDelegate.requestRestore();
2811 tryCompare(appDelegate, "state", "maximizedRight");
2812 }
2813
2814 function test_altTabToMinimizedApp() {
2815 loadShell("desktop");
2816 shell.usageScenario = "desktop";
2817 waitForRendering(shell);
2818 swipeAwayGreeter();
2819
2820 var appSurfaceId = topLevelSurfaceList.nextId;
2821 var app = ApplicationManager.startApplication("dialer-app")
2822 waitUntilAppWindowIsFullyLoaded(appSurfaceId);
2823
2824 // start dialer
2825 var appContainer = findChild(shell, "appContainer");
2826 var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId);
2827 verify(appDelegate);
2828 tryCompare(appDelegate, "state", "normal");
2829
2830 // minimize dialer
2831 appDelegate.requestMinimize();
2832 tryCompare(appDelegate, "state", "minimized");
2833
2834 // try to bring dialer back from minimized by doing alt-tab
2835 keyClick(Qt.Key_Tab, Qt.AltModifier);
2836 tryCompare(appDelegate, "visible", true);
2837 tryCompare(appDelegate, "focus", true);
2838 tryCompare(topLevelSurfaceList.focusedWindow, "surface", appDelegate.surface);
2839 tryCompare(topLevelSurfaceList.applicationAt(0), "appId", "dialer-app");
2840 }
2782 }2841 }
2783}2842}

Subscribers

People subscribed via source and target branches