@@ -414,7 +414,7 @@ Rectangle {
414414 // Open an application and focus
415415 waitUntilApplicationWindowIsFullyVisible(app);
416416 ApplicationManager.focusApplication(app);
417− tryCompare(app.session.surface, "activeFocus", true);
417+ tryCompare(app.session.lastSurface, "activeFocus", true);
418418
419419 notifications.model = mockNotificationsModel;
420420
@@ -436,7 +436,7 @@ Rectangle {
436436 waitForRendering(notification);
437437
438438 // Make sure activeFocus went away from the app window
439− tryCompare(app.session.surface, "activeFocus", false);
439+ tryCompare(app.session.lastSurface, "activeFocus", false);
440440 tryCompare(stage, "interactive", false);
441441
442442 // Clicking the button should dismiss the notification and return focus
@@ -444,7 +444,7 @@ Rectangle {
444444 mouseClick(buttonAccept);
445445
446446 // Make sure we're back to normal
447− tryCompare(app.session.surface, "activeFocus", true);
447+ tryCompare(app.session.lastSurface, "activeFocus", true);
448448 compare(stage.interactive, true, "Stages not interactive again after modal notification has closed");
449449 }
450450
@@ -776,7 +776,7 @@ Rectangle {
776776 var app = ApplicationManager.startApplication("dialer-app");
777777 waitUntilAppWindowIsFullyLoaded(app);
778778
779− tryCompare(app.session.surface, "activeFocus", true);
779+ tryCompare(app.session.lastSurface, "activeFocus", true);
780780
781781 // Drag the indicators panel half-open
782782 var touchX = shell.width / 2;
@@ -787,7 +787,7 @@ Rectangle {
787787 true /* beginTouch */, false /* endTouch */);
788788 verify(indicators.partiallyOpened);
789789
790− tryCompare(app.session.surface, "activeFocus", false);
790+ tryCompare(app.session.lastSurface, "activeFocus", false);
791791
792792 // And finish getting it open
793793 touchFlick(indicators,
@@ -796,11 +796,11 @@ Rectangle {
796796 false /* beginTouch */, true /* endTouch */);
797797 tryCompare(indicators, "fullyOpened", true);
798798
799− tryCompare(app.session.surface, "activeFocus", false);
799+ tryCompare(app.session.lastSurface, "activeFocus", false);
800800
801801 dragToCloseIndicatorsPanel();
802802
803− tryCompare(app.session.surface, "activeFocus", true);
803+ tryCompare(app.session.lastSurface, "activeFocus", true);
804804 }
805805
806806 function test_launchedAppHasActiveFocus_data() {
@@ -821,9 +821,9 @@ Rectangle {
821821 verify(webApp);
822822 waitUntilAppSurfaceShowsUp("webbrowser-app")
823823
824− verify(webApp.session.surface);
824+ verify(webApp.session.lastSurface);
825825
826− tryCompare(webApp.session.surface, "activeFocus", true);
826+ tryCompare(webApp.session.lastSurface, "activeFocus", true);
827827 }
828828
829829 function test_launchedAppKeepsActiveFocusOnUsageModeChange() {
@@ -834,9 +834,9 @@ Rectangle {
834834 verify(webApp);
835835 waitUntilAppSurfaceShowsUp("webbrowser-app")
836836
837− verify(webApp.session.surface);
837+ verify(webApp.session.lastSurface);
838838
839− tryCompare(webApp.session.surface, "activeFocus", true);
839+ tryCompare(webApp.session.lastSurface, "activeFocus", true);
840840
841841 shell.usageScenario = "desktop";
842842
@@ -846,7 +846,7 @@ Rectangle {
846846 verify(desktopWindow);
847847 }
848848
849− tryCompare(webApp.session.surface, "activeFocus", true);
849+ tryCompare(webApp.session.lastSurface, "activeFocus", true);
850850
851851 shell.usageScenario = "tablet";
852852
@@ -856,7 +856,7 @@ Rectangle {
856856 verify(desktopWindow);
857857 }
858858
859− tryCompare(webApp.session.surface, "activeFocus", true);
859+ tryCompare(webApp.session.lastSurface, "activeFocus", true);
860860 }
861861
862862 function waitUntilAppSurfaceShowsUp(appId) {
@@ -977,7 +977,7 @@ Rectangle {
977977
978978 var app = ApplicationManager.startApplication("dialer-app");
979979 // wait until the app is fully loaded (ie, real surface replaces splash screen)
980− tryCompareFunction(function() { return app.session !== null && app.session.surface !== null }, true);
980+ tryCompareFunction(function() { return app.session !== null && app.session.lastSurface !== null }, true);
981981
982982 // Minimize the application we just launched
983983 swipeFromLeftEdge(shell.width * 0.75);
@@ -1414,9 +1414,9 @@ Rectangle {
14141414 waitUntilAppWindowIsFullyLoaded(app3);
14151415
14161416 // Do a quick alt-tab and see if focus changes
1417− tryCompare(app3.session.surface, "activeFocus", true)
1417+ tryCompare(app3.session.lastSurface, "activeFocus", true)
14181418 keyClick(Qt.Key_Tab, Qt.ControlModifier)
1419− tryCompare(app2.session.surface, "activeFocus", true)
1419+ tryCompare(app2.session.lastSurface, "activeFocus", true)
14201420
14211421 var desktopSpread = findChild(shell, "spread")
14221422
@@ -1432,7 +1432,7 @@ Rectangle {
14321432 tryCompare(desktopSpread, "state", "")
14331433
14341434 // Focus should have switched back now
1435− tryCompare(app3.session.surface, "activeFocus", true)
1435+ tryCompare(app3.session.lastSurface, "activeFocus", true)
14361436 }
14371437
14381438 function test_altTabWrapAround() {
@@ -1481,7 +1481,7 @@ Rectangle {
14811481 tryCompare(desktopSpread, "state", "")
14821482
14831483 // Make sure that after wrapping around once, we have the same one focused as at the beginning
1484− tryCompare(focused.session.surface, "activeFocus", true)
1484+ tryCompare(focused.session.lastSurface, "activeFocus", true)
14851485 }
14861486
14871487 function test_altBackTabNavigation() {
@@ -1863,7 +1863,7 @@ Rectangle {
18631863 waitUntilAppWindowIsFullyLoaded(app2);
18641864
18651865 // Make sure app1 is unfocused but still running
1866− compare(app1.session.surface.activeFocus, false);
1866+ compare(app1.session.lastSurface.activeFocus, false);
18671867 compare(app1.isTouchApp, false); // sanity check our mock, which sets this for us
18681868 compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
18691869 }
@@ -1887,7 +1887,7 @@ Rectangle {
18871887 waitUntilAppWindowIsFullyLoaded(app2);
18881888
18891889 // Make sure app1 is unfocused but still running
1890− compare(app1.session.surface.activeFocus, false);
1890+ compare(app1.session.lastSurface.activeFocus, false);
18911891 compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
18921892 }
18931893