@@ -2156,14 +2156,14 @@ Rectangle {
21562156
21572157 // Popup must be gone now
21582158 popup = findChild(root, "modeSwitchWarningDialog");
2159− compare(popup === null, true);
2159+ tryCompareFunction(function() { return popup === null}, true);
21602160
21612161 if (data.replug) {
21622162 // Libreoffice must still be running
21632163 compare(ApplicationManager.findApplication("libreoffice") !== null, true);
21642164 } else {
2165− // Libreoffice must be gone now
2166− compare(ApplicationManager.findApplication("libreoffice") === null, true);
2165+ // Libreoffice must be gone now (or soon at least)
2166+ tryCompareFunction(function() { return ApplicationManager.findApplication("libreoffice") === null}, true);
21672167 }
21682168 }
21692169