mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:45:44 +00:00
UI: Don't use SetThreadExecutionState()
.. because it works correctly only on Windows 11+. Otherwise it prevents the OS from sleeping.
This commit is contained in:
parent
ea24637337
commit
e5a52a3691
@ -174,7 +174,7 @@ bool ControlManager::processRequest(Control::Command command, const QVariantList
|
||||
|
||||
// DBG: qCDebug(LC) << "Client requested: id:" << w->id() << command << args.size();
|
||||
|
||||
OsUtil::setThreadIsBusy(true);
|
||||
// XXX: OsUtil::setThreadIsBusy(true);
|
||||
|
||||
QString errorMessage;
|
||||
const bool success = processCommand({
|
||||
@ -188,7 +188,7 @@ bool ControlManager::processRequest(Control::Command command, const QVariantList
|
||||
qCWarning(LC) << "Bad command" << errorMessage << ':' << command << args;
|
||||
}
|
||||
|
||||
OsUtil::setThreadIsBusy(false);
|
||||
// XXX: OsUtil::setThreadIsBusy(false);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ void LogManager::processLogBuffer(LogBuffer *logBuffer, bool success, quint32 er
|
||||
|
||||
void LogManager::processLogEntries(LogBuffer *logBuffer)
|
||||
{
|
||||
OsUtil::setThreadIsBusy(true);
|
||||
// XXX: OsUtil::setThreadIsBusy(true);
|
||||
|
||||
for (;;) {
|
||||
const FortLogType logType = logBuffer->peekEntryType();
|
||||
@ -133,7 +133,7 @@ void LogManager::processLogEntries(LogBuffer *logBuffer)
|
||||
break;
|
||||
}
|
||||
|
||||
OsUtil::setThreadIsBusy(false);
|
||||
// XXX: OsUtil::setThreadIsBusy(false);
|
||||
}
|
||||
|
||||
bool LogManager::processLogEntry(LogBuffer *logBuffer, FortLogType logType)
|
||||
|
@ -36,7 +36,7 @@ inline bool sendCommandDataToClients(
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
OsUtil::setThreadIsBusy(true);
|
||||
// XXX: OsUtil::setThreadIsBusy(true);
|
||||
|
||||
for (ControlWorker *w : clients) {
|
||||
if (!w->isServiceClient())
|
||||
@ -48,7 +48,7 @@ inline bool sendCommandDataToClients(
|
||||
}
|
||||
}
|
||||
|
||||
OsUtil::setThreadIsBusy(false);
|
||||
// XXX: OsUtil::setThreadIsBusy(false);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
@ -158,5 +158,6 @@ void OsUtil::writeToConsole(const QString &line)
|
||||
|
||||
void OsUtil::setThreadIsBusy(bool on)
|
||||
{
|
||||
// Works correct only on Windows 11+
|
||||
SetThreadExecutionState(ES_CONTINUOUS | (on ? ES_SYSTEM_REQUIRED : 0));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user