mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Fix notifications hiding on Linux.
Regression was introduced in 3372dfcd3e
.
Only when platform-specific code can give us the global time of the
last user input event we rely on idle time for notifications hiding.
Fixes #5791.
This commit is contained in:
@@ -128,12 +128,6 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
bool psIdleSupported() {
|
||||
LASTINPUTINFO lii;
|
||||
lii.cbSize = sizeof(LASTINPUTINFO);
|
||||
return GetLastInputInfo(&lii);
|
||||
}
|
||||
|
||||
QStringList psInitLogs() {
|
||||
return _initLogs;
|
||||
}
|
||||
@@ -333,10 +327,12 @@ QString CurrentExecutablePath(int argc, char *argv[]) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
crl::time LastUserInputTime() {
|
||||
LASTINPUTINFO lii;
|
||||
std::optional<crl::time> LastUserInputTime() {
|
||||
auto lii = LASTINPUTINFO{ 0 };
|
||||
lii.cbSize = sizeof(LASTINPUTINFO);
|
||||
return GetLastInputInfo(&lii) ? (crl::now() + lii.dwTime - GetTickCount()) : 0LL;
|
||||
return GetLastInputInfo(&lii)
|
||||
? std::make_optional(crl::now() + lii.dwTime - GetTickCount())
|
||||
: std::nullopt;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
Reference in New Issue
Block a user