From cc55e3b027464ff5fd75d1307d7382c717ed5da1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 23 Jul 2017 13:20:11 +0300 Subject: [PATCH] Don't jump in chats list scroll while reordering. While we reorder the pinned chats we move chat rows around which sometimes produces auto scroll event that will try to reorder more. This should probably fix assertion violation that was debugged using additional information from commits 8b96f72, c7e63ff and a935075. --- Telegram/SourceFiles/dialogswidget.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index f0acbecbf..9189b6bfc 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -1049,7 +1049,10 @@ void DialogsInner::createDialog(History *history) { int from = dialogsOffset() + changed.movedFrom * st::dialogsRowHeight; int to = dialogsOffset() + changed.movedTo * st::dialogsRowHeight; - emit dialogMoved(from, to); + if (!_dragging) { + // Don't jump in chats list scroll position while dragging. + emit dialogMoved(from, to); + } if (creating) { refresh(); @@ -1690,7 +1693,10 @@ void DialogsInner::notify_historyMuteUpdated(History *history) { int from = dialogsOffset() + changed.movedFrom * st::dialogsRowHeight; int to = dialogsOffset() + changed.movedTo * st::dialogsRowHeight; - emit dialogMoved(from, to); + if (!_dragging) { + // Don't jump in chats list scroll position while dragging. + emit dialogMoved(from, to); + } if (creating) { refresh();