Work around QTBUG-56382 with manual event loop flushing

* See https://bugreports.qt.io/browse/QTBUG-56382 for more details -
  creating DXGI swapchains adds a windows hook, and enough windows hooks
  forces out Qt's internal hook which it relies upon for proper event
  processing.
This commit is contained in:
baldurk
2016-10-05 15:43:55 +02:00
parent d1cda249e2
commit 86623528bf
3 changed files with 17 additions and 4 deletions
+5
View File
@@ -62,6 +62,11 @@ CaptureContext::~CaptureContext()
delete m_MainWindow;
}
bool CaptureContext::isRunning()
{
return m_MainWindow && m_MainWindow->isVisible();
}
void CaptureContext::LoadLogfile(QString logFile, bool temporary)
{
LoadLogfile(-1, "", logFile, temporary);
+2
View File
@@ -56,6 +56,8 @@ public:
CaptureContext(QString paramFilename, QString remoteHost, uint32_t remoteIdent, bool temp);
~CaptureContext();
bool isRunning();
//////////////////////////////////////////////////////////////////////////////
// Control functions
+10 -4
View File
@@ -95,13 +95,19 @@ int main(int argc, char *argv[])
argv_mod[argc - 2] = arg;
argv_mod[argc - 1] = pathChars.data();
QApplication a(argc, argv_mod);
QApplication application(argc, argv_mod);
CaptureContext ctx(filename, remoteHost, remoteIdent, temp);
{
CaptureContext ctx(filename, remoteHost, remoteIdent, temp);
int ret = a.exec();
while(ctx.isRunning())
{
application.processEvents(QEventLoop::WaitForMoreEvents);
QCoreApplication::sendPostedEvents();
}
}
delete[] argv_mod;
return ret;
return 0;
}