mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-25 04:38:23 +00:00
Fix possible assertion violation in PeerListBox.
Very long stack in crash reports leads to something like that: - PeerListBox::prepare - PeerListBox::createMultiSelect - PeerListBox::updateScrollSkips - BoxContent::setInnerTopSkip - _scroll->scrollToY - sendSynteticMouseEvent - ChatHelpers::TabbedPanel::showAnimated - QWidget::render - QWidgetPrivate::sendPendingMoveAndResizeEvents - PeerListBox::resizeEvent - _select->resizeToWidth(0) - MultiSelect::Inner::computeItemsGeometry(0) Workaround: - Don't scrollToY if PeerListBox width was not yet set. - Initial _scrollBottomFixed is false (at first createMultiSelect).
This commit is contained in:
parent
a27ea2d631
commit
6295d85ef2
@ -148,7 +148,7 @@ void BoxContent::setInnerTopSkip(int innerTopSkip, bool scrollBottomFixed) {
|
||||
if (_innerTopSkip != innerTopSkip) {
|
||||
auto delta = innerTopSkip - _innerTopSkip;
|
||||
_innerTopSkip = innerTopSkip;
|
||||
if (_scroll) {
|
||||
if (_scroll && width() > 0) {
|
||||
auto scrollTopWas = _scroll->scrollTop();
|
||||
updateScrollAreaGeometry();
|
||||
if (scrollBottomFixed) {
|
||||
|
@ -807,6 +807,6 @@ private:
|
||||
|
||||
std::unique_ptr<PeerListController> _controller;
|
||||
base::lambda<void(PeerListBox*)> _init;
|
||||
bool _scrollBottomFixed = true;
|
||||
bool _scrollBottomFixed = false;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user