From c3c46f8e2921c21436122f6ed126614d81d815da Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 4 Apr 2019 19:20:28 +0400 Subject: [PATCH] Fix new animations engine bug. --- Telegram/SourceFiles/mtproto/facade.cpp | 4 ++-- Telegram/SourceFiles/ui/effects/animations.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/facade.cpp b/Telegram/SourceFiles/mtproto/facade.cpp index 36a1a1d69..6f1f0ec48 100644 --- a/Telegram/SourceFiles/mtproto/facade.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -12,11 +12,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace MTP { namespace internal { -//namespace { +namespace { int PauseLevel = 0; -//} // namespace +} // namespace bool paused() { return PauseLevel > 0; diff --git a/Telegram/SourceFiles/ui/effects/animations.cpp b/Telegram/SourceFiles/ui/effects/animations.cpp index d16340821..d41c1a15e 100644 --- a/Telegram/SourceFiles/ui/effects/animations.cpp +++ b/Telegram/SourceFiles/ui/effects/animations.cpp @@ -53,7 +53,9 @@ void Basic::markStopped() { Manager::Manager() { Core::Sandbox::Instance().widgetUpdateRequests( - ) | rpl::start_with_next([=] { + ) | rpl::filter([=] { + return (_lastUpdateTime + kIgnoreUpdatesTimeout < crl::now()); + }) | rpl::start_with_next([=] { update(); }, _lifetime); } @@ -92,11 +94,9 @@ void Manager::update() { return; } const auto now = crl::now(); - if (!_forceImmediateUpdate - && (_lastUpdateTime + kIgnoreUpdatesTimeout >= now)) { - return; + if (_forceImmediateUpdate) { + _forceImmediateUpdate = false; } - _forceImmediateUpdate = false; schedule(); _updating = true;