From 336405b3c772735aae6c1ccac60005f946131f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Molinari?= Date: Wed, 14 Apr 2021 22:06:56 +0200 Subject: [PATCH] Fix voice record button infinite animation Enabling animations triggers an animation of the voice record button that keeps firing uselessly at ~120 calls per second until the button is manually toggled. The animation callback cannot stop itself since it expects the button to be visible. This commit fixes the issue by preventing spawning the animation if the widget is hidden. --- .../history/view/controls/history_view_voice_record_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_button.cpp b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_button.cpp index fb9a4551ca..b0789ec81d 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_button.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_button.cpp @@ -87,7 +87,7 @@ void VoiceRecordButton::init() { _blobs->setLevel(0.); } _blobsHideLastTime = hide ? crl::now() : 0; - if (!hide && !_animation.animating()) { + if (!hide && !_animation.animating() && isVisible()) { _animation.start(); } }, lifetime());