diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index ee1dbc596..46267020a 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -94,7 +94,7 @@ inline bool in_range(Value &&value, From &&from, Till &&till) { #define for_const(range_declaration, range_expression) for (range_declaration : std::as_const(range_expression)) template -inline void InvokeQueued(QObject *context, Lambda &&lambda) { +inline void InvokeQueued(const QObject *context, Lambda &&lambda) { QObject proxy; QObject::connect(&proxy, &QObject::destroyed, context, std::forward(lambda), Qt::QueuedConnection); } diff --git a/Telegram/SourceFiles/ui/effects/animations.cpp b/Telegram/SourceFiles/ui/effects/animations.cpp index 982f60ecb..20193d0f6 100644 --- a/Telegram/SourceFiles/ui/effects/animations.cpp +++ b/Telegram/SourceFiles/ui/effects/animations.cpp @@ -121,7 +121,7 @@ void Manager::updateQueued() { Expects(_timerId == 0); _timerId = -1; - crl::on_main(delayedCallGuard(), [=] { + InvokeQueued(delayedCallGuard(), [=] { Expects(_timerId < 0); _timerId = 0; @@ -142,7 +142,7 @@ void Manager::schedule() { _forceImmediateUpdate = false; updateQueued(); } else { - const auto next = _lastUpdateTime + kAnimationTimeout; + const auto next = _lastUpdateTime + kAnimationTick; const auto now = crl::now(); if (now < next) { _timerId = startTimer(next - now, Qt::PreciseTimer);