on xenial help sign in
Make it work the second time
commitf47d0f30a793071386f97e0d2589dd4800c8e13f authorAlbert Astals Cid <albert.astals@canonical.com> dateMon 9 Jan 2017, 16:58 (10 years ago) parent423a50d
2 files changed+12−1
qml/Components/Dialogs.qml+2−1 tests/qmltests/tst_OrientedShell.qml+10
qml/Components/Dialogs.qml+2−1
@@ -151,11 +151,12 @@ MouseArea {
151151 active: false
152152 onActiveChanged: {
153153 if (!active) {
154− previousSourceComponent = undefined;
155154 if (previousFocusedItem) {
156155 previousFocusedItem.forceActiveFocus(Qt.OtherFocusReason);
157156 previousFocusedItem = undefined;
158157 }
158+ previousSourceComponent = undefined;
159+ sourceComponent = undefined;
159160 }
160161 }
161162 onSourceComponentChanged: {
tests/qmltests/tst_OrientedShell.qml+10
@@ -1620,6 +1620,16 @@ Rectangle {
16201620
16211621 tryCompare(dialogLoader, "item", null);
16221622 compare(window.activeFocusItem, surfaceItem);
1623+
1624+ // Do it twice, our previous solution failed the second time ^_^
1625+ testCase.showPowerDialog();
1626+
1627+ tryCompareFunction(function() { return dialogLoader.item !== null }, true);
1628+
1629+ keyClick(Qt.Key_Escape);
1630+
1631+ tryCompare(dialogLoader, "item", null);
1632+ compare(window.activeFocusItem, surfaceItem);
16231633 }
16241634 }
16251635}