mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Refactored counting idle time.
- psIdleTime() was replaced with Platform::LastUserInputTime(). - _lastTimeVideoPlayedAt was moved to Application as _lastNonIdleTime. - Call of updateNonIdle() was added while voice is recording. - Fixed #5695. - Thanks Preston. =)
This commit is contained in:
@@ -145,12 +145,6 @@ bool psIdleSupported() {
|
||||
return GetLastInputInfo(&lii);
|
||||
}
|
||||
|
||||
crl::time psIdleTime() {
|
||||
LASTINPUTINFO lii;
|
||||
lii.cbSize = sizeof(LASTINPUTINFO);
|
||||
return GetLastInputInfo(&lii) ? (GetTickCount() - lii.dwTime) : (crl::now() - _lastUserAction);
|
||||
}
|
||||
|
||||
QStringList psInitLogs() {
|
||||
return _initLogs;
|
||||
}
|
||||
@@ -350,6 +344,12 @@ QString CurrentExecutablePath(int argc, char *argv[]) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
crl::time LastUserInputTime() {
|
||||
LASTINPUTINFO lii;
|
||||
lii.cbSize = sizeof(LASTINPUTINFO);
|
||||
return GetLastInputInfo(&lii) ? (crl::now() + lii.dwTime - GetTickCount()) : _lastUserAction;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
QString GetLangCodeById(unsigned lngId) {
|
||||
|
Reference in New Issue
Block a user