From 9773563926440ba980f7dbbb790a55512832086c Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Oct 2019 13:25:05 +0300 Subject: [PATCH] Fix history geometry update being lost. Fixes #6629. --- Telegram/SourceFiles/history/history_widget.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index d7de50fde..320d11a64 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3163,8 +3163,8 @@ void HistoryWidget::doneShow() { updateControlsVisibility(); if (!_historyInited) { updateHistoryGeometry(true); - } else if (hasPendingResizedItems()) { - updateHistoryGeometry(); + } else { + handlePendingHistoryUpdate(); } preloadHistoryIfNeeded(); if (App::wnd()) { @@ -5006,11 +5006,15 @@ int HistoryWidget::countAutomaticScrollTop() { return qMin(result, _scroll->scrollTopMax()); } -void HistoryWidget::updateHistoryGeometry(bool initial, bool loadedDown, const ScrollChange &change) { +void HistoryWidget::updateHistoryGeometry( + bool initial, + bool loadedDown, + const ScrollChange &change) { if (!_history || (initial && _historyInited) || (!initial && !_historyInited)) { return; } if (_firstLoadRequest || _a_show.animating()) { + _updateHistoryGeometryRequired = true; return; // scrollTopMax etc are not working after recountHistoryGeometry() }