on xenial help sign in
fix tests
8666e6cMichael Zanetti
qml/Stages/DesktopStage.qml+3−1
@@ -70,8 +70,8 @@ Rectangle {
70 onFocusRequested: {
70 onFocusRequested: {
71 var appIndex = priv.indexOf(appId);
71 var appIndex = priv.indexOf(appId);
72 var appDelegate = appRepeater.itemAt(appIndex);
72 var appDelegate = appRepeater.itemAt(appIndex);
73− print("focus requested", appDelegate.minimized, appDelegate.maximized)
74 appDelegate.minimized = false;
73 appDelegate.minimized = false;
74+ appDelegate.focus = true;
75 ApplicationManager.focusApplication(appId);
75 ApplicationManager.focusApplication(appId);
76 }
76 }
77 }
77 }
@@ -125,6 +125,7 @@ Rectangle {
125
125
126 FocusScope {
126 FocusScope {
127 id: appContainer
127 id: appContainer
128+ objectName: "appContainer"
128 anchors.fill: parent
129 anchors.fill: parent
129
130
130 Keys.onPressed: {
131 Keys.onPressed: {
@@ -201,6 +202,7 @@ Rectangle {
201 onFocusChanged: {
202 onFocusChanged: {
202 if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
203 if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
203 ApplicationManager.requestFocusApplication(model.appId);
204 ApplicationManager.requestFocusApplication(model.appId);
205+ decoratedWindow.forceActiveFocus();
204 }
206 }
205 }
207 }
206 Component.onCompleted: {
208 Component.onCompleted: {
tests/qmltests/tst_Shell.qml+4−4
@@ -806,7 +806,6 @@ Rectangle {
806 // check that the desktop stage and window have been loaded
806 // check that the desktop stage and window have been loaded
807 {
807 {
808 var desktopWindow = findChild(shell, "appWindow_webbrowser-app");
808 var desktopWindow = findChild(shell, "appWindow_webbrowser-app");
809− print("have desktopWindow", desktopWindow)
810 verify(desktopWindow);
809 verify(desktopWindow);
811 }
810 }
812
811
@@ -1317,7 +1316,6 @@ Rectangle {
1317 waitForRendering(root)
1316 waitForRendering(root)
1318
1317
1319 var desktopStage = findChild(shell, "stage");
1318 var desktopStage = findChild(shell, "stage");
1320− print("desktopStage", desktopStage)
1321 verify(desktopStage != null)
1319 verify(desktopStage != null)
1322
1320
1323 var app1 = ApplicationManager.startApplication("dialer-app")
1321 var app1 = ApplicationManager.startApplication("dialer-app")
@@ -1354,6 +1352,9 @@ Rectangle {
1354 var desktopStage = findChild(shell, "stage");
1352 var desktopStage = findChild(shell, "stage");
1355 verify(desktopStage !== null)
1353 verify(desktopStage !== null)
1356
1354
1355+ var appContainer = findInvisibleChild(shell, "appContainer")
1356+ verify(appContainer !== null)
1357+
1357 var appRepeater = findInvisibleChild(shell, "appRepeater")
1358 var appRepeater = findInvisibleChild(shell, "appRepeater")
1358 verify(appRepeater !== null)
1359 verify(appRepeater !== null)
1359
1360
@@ -1373,7 +1374,7 @@ Rectangle {
1373 // We can't simulate a pressed key with keyPress() currently, so let's inject the events
1374 // We can't simulate a pressed key with keyPress() currently, so let's inject the events
1374 // at API level. Jump for 10 times, verify that it's still at the last one and didn't wrap around.
1375 // at API level. Jump for 10 times, verify that it's still at the last one and didn't wrap around.
1375 for (var i = 0; i < 10; i++) {
1376 for (var i = 0; i < 10; i++) {
1376− desktopStage.altTabNext(true);
1377+ appContainer.selectNext(true); // true == isAutoRepeat
1377 wait(0); // Trigger the event loop to make sure all the things happen
1378 wait(0); // Trigger the event loop to make sure all the things happen
1378 }
1379 }
1379 tryCompare(appRepeater, "highlightedIndex", 6)
1380 tryCompare(appRepeater, "highlightedIndex", 6)
@@ -1516,7 +1517,6 @@ Rectangle {
1516 var y = shell.height * (data.tileInfo ? .5 : 0.95)
1517 var y = shell.height * (data.tileInfo ? .5 : 0.95)
1517 mouseMove(shell, x, y)
1518 mouseMove(shell, x, y)
1518 while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1519 while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1519− print("y is", y)
1520 x+=10;
1520 x+=10;
1521 mouseMove(shell, x, y)
1521 mouseMove(shell, x, y)
1522 waitForRendering(shell)
1522 waitForRendering(shell)