@@ -2156,14 +2156,14 @@ Rectangle {
2157 // Popup must be gone now
2157 // Popup must be gone now
2158 popup = findChild(root, "modeSwitchWarningDialog");
2158 popup = findChild(root, "modeSwitchWarningDialog");
2159− compare(popup === null, true);
2159+ tryCompareFunction(function() { return popup === null}, true);
2161 if (data.replug) {
2161 if (data.replug) {
2162 // Libreoffice must still be running
2162 // Libreoffice must still be running
2163 compare(ApplicationManager.findApplication("libreoffice") !== null, true);
2163 compare(ApplicationManager.findApplication("libreoffice") !== null, true);
2164 } else {
2164 } else {
2165− // Libreoffice must be gone now
2165+ // Libreoffice must be gone now (or soon at least)
2166− compare(ApplicationManager.findApplication("libreoffice") === null, true);
2166+ tryCompareFunction(function() { return ApplicationManager.findApplication("libreoffice") === null}, true);