@@ -335,6 +335,8 @@ Rectangle {
335335 Row {
336336 CheckBox {
337337 id: fullscreeAppCheck
338+ activeFocusOnPress: false
339+ activeFocusOnTab: false
338340
339341 onTriggered: {
340342 if (!topLevelSurfaceList.focusedWindow) return;
@@ -2779,5 +2781,62 @@ Rectangle {
27792781 }
27802782 tryCompareFunction(function() { return drawer.visible; }, false);
27812783 }
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+ }
27822841 }
27832842}