diff options
| author | Eran Mizrahi <erasmux@gmail.com> | 2017-12-13 17:39:59 +0200 |
|---|---|---|
| committer | Eran Mizrahi <erasmux@gmail.com> | 2017-12-13 22:27:11 +0200 |
| commit | 604d86ed07711651bc71871f6d37a794d916da6a (patch) | |
| tree | 235f1cad320f73e6b22cdf330d9a14d42bd33092 /src | |
| parent | a5bb70f53bc20f36f695ac5cd9f8b91163f694eb (diff) | |
Improve responsiveness of unlock button
Diffstat (limited to 'src')
| -rw-r--r-- | src/organizercore.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index c4bcaf3d..dd77f19a 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1340,16 +1340,17 @@ bool OrganizerCore::waitForProcessCompletion(HANDLE handle, LPDWORD exitCode, IL newHandle = false;
}
- // keep processing events so the app doesn't appear dead
- QCoreApplication::processEvents();
-
// Wait for a an event on the handle, a key press, mouse click or timeout
- res = MsgWaitForMultipleObjects(1, &handle, FALSE, 500, QS_KEY | QS_MOUSEBUTTON);
+ res = MsgWaitForMultipleObjects(1, &handle, FALSE, 200, QS_KEY | QS_MOUSEBUTTON);
if (res == WAIT_FAILED) {
qWarning() << "Failed waiting for process completion : MsgWaitForMultipleObjects WAIT_FAILED" << GetLastError();
break;
}
+ // keep processing events so the app doesn't appear dead
+ QCoreApplication::sendPostedEvents();
+ QCoreApplication::processEvents();
+
if (uilock && uilock->unlockForced()) {
uiunlocked = true;
break;
@@ -1364,7 +1365,11 @@ bool OrganizerCore::waitForProcessCompletion(HANDLE handle, LPDWORD exitCode, IL originalHandle = false;
// if the previous process spawned a child process and immediately exits we may miss it if we check immediately
- QThread::msleep(500);
+ for (int i = 0; i < 3; ++i) {
+ QThread::msleep(200);
+ QCoreApplication::sendPostedEvents();
+ QCoreApplication::processEvents();
+ }
// search if there is another usvfs process active and if so wait for it
handle = findAndOpenAUSVFSProcess();
|
