[wayland] Don't use waitForFinished on the Xwayland QProcess

WaitForFinished blocks our main thread, but Xwayland wants to talk
to Wayland and blocks as well. So let's ensure events are processed
while terminating Xwayland.
This commit is contained in:
Martin Gräßlin 2015-11-12 15:15:44 +01:00
parent 240e7ba337
commit f6ef9e8d8c
2 changed files with 6 additions and 2 deletions

View file

@ -68,7 +68,9 @@ WaylandTestApplication::~WaylandTestApplication()
}
if (m_xwaylandProcess) {
m_xwaylandProcess->terminate();
m_xwaylandProcess->waitForFinished();
while (m_xwaylandProcess->state() != QProcess::NotRunning) {
processEvents(QEventLoop::WaitForMoreEvents);
}
waylandServer()->destroyXWaylandConnection();
}
waylandServer()->destroyInternalConnection();

View file

@ -92,7 +92,9 @@ ApplicationWayland::~ApplicationWayland()
}
if (m_xwaylandProcess) {
m_xwaylandProcess->terminate();
m_xwaylandProcess->waitForFinished();
while (m_xwaylandProcess->state() != QProcess::NotRunning) {
processEvents(QEventLoop::WaitForMoreEvents);
}
waylandServer()->destroyXWaylandConnection();
}
waylandServer()->destroyInternalConnection();