mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-05 09:05:14 +00:00
Refactored checking of last input while notifications are displayed.
- Removed condition for Windows platform only. - Added smooth hiding of notifications in case video is watched or voice message is recorded. - psUserActionDone() was completely replaced with Core::App().updateNonIdle().
This commit is contained in:
@@ -505,9 +505,7 @@ Notification::Notification(
|
||||
int shift,
|
||||
Direction shiftDirection)
|
||||
: Widget(manager, startPosition, shift, shiftDirection)
|
||||
#ifdef Q_OS_WIN
|
||||
, _started(GetTickCount())
|
||||
#endif // Q_OS_WIN
|
||||
, _started(crl::now())
|
||||
, _history(history)
|
||||
, _peer(peer)
|
||||
, _author(author)
|
||||
@@ -588,14 +586,7 @@ void Notification::prepareActionsCache() {
|
||||
bool Notification::checkLastInput(bool hasReplyingNotifications) {
|
||||
if (!_waitingForInput) return true;
|
||||
|
||||
auto wasUserInput = true; // TODO
|
||||
#ifdef Q_OS_WIN
|
||||
LASTINPUTINFO lii;
|
||||
lii.cbSize = sizeof(LASTINPUTINFO);
|
||||
BOOL res = GetLastInputInfo(&lii);
|
||||
wasUserInput = (!res || lii.dwTime >= _started);
|
||||
#endif // Q_OS_WIN
|
||||
if (wasUserInput) {
|
||||
if (Core::App().lastNonIdleTime() > _started) {
|
||||
_waitingForInput = false;
|
||||
if (!hasReplyingNotifications) {
|
||||
_hideTimer.start(st::notifyWaitLongHide);
|
||||
|
Reference in New Issue
Block a user