diff options
| author | Eran Mizrahi <erasmux@gmail.com> | 2017-12-13 17:39:59 +0200 |
|---|---|---|
| committer | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2017-12-13 16:53:20 -0600 |
| commit | 8839e116360caddc15ddeac57307d11197b50af1 (patch) | |
| tree | 235f1cad320f73e6b22cdf330d9a14d42bd33092 /src | |
| parent | 240cbd6a27addf46943cda1d016ec9c14089fb27 (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();
|
