From 5755afc4ea1b17e9a620049b5674c970dccc8011 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 4 Sep 2020 22:38:54 -0700 Subject: [PATCH] Fix app window not hiding when streaming starts --- app/streaming/session.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 3457a207..930e35d9 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -529,6 +529,7 @@ void Session::emitLaunchWarning(QString text) // Pump the UI loop while we wait SDL_Delay(5); QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + QCoreApplication::sendPostedEvents(); } } @@ -1071,8 +1072,14 @@ void Session::exec(int displayOriginX, int displayOriginY) asyncConnThread.start(); while (!asyncConnThread.wait(10)) { QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + QCoreApplication::sendPostedEvents(); } + // Pump the event loop one last time to ensure we pick up any events from + // the thread that happened while it was in the final successful QThread::wait(). + QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + QCoreApplication::sendPostedEvents(); + // If the connection failed, clean up and abort the connection. if (!m_AsyncConnectionSuccess) { delete m_InputHandler;