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
+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;
}