From dd9d604966767cc66c1ee87e5560505d6b6bdcb9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 8 Aug 2017 20:23:32 +0200 Subject: [PATCH] Fix incorrect scroll jumps. If we invoke showHistory(h, msgId) several times we call forgetScrollState() for this history being on the same scroll place. To compute it again we need to call visibleAreaUpdated() even if the real scroll position was not changed. --- Telegram/SourceFiles/history/history_widget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 764f0443b..9fe1e553b 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -6587,7 +6587,11 @@ bool HistoryWidget::touchScroll(const QPoint &delta) { void HistoryWidget::synteticScrollToY(int y) { _synteticScrollEvent = true; - _scroll->scrollToY(y); + if (_scroll->scrollTop() == y) { + visibleAreaUpdated(); + } else { + _scroll->scrollToY(y); + } _synteticScrollEvent = false; }