From c62b39e287a41a202a87e8f180e41ba425d80c13 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 17 Jul 2020 08:32:51 +0400 Subject: [PATCH] Fix possible crash in call top bar hiding. --- Telegram/SourceFiles/mainwidget.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index fb50ffd1d5..6cf9d13fd9 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2090,7 +2090,12 @@ void MainWidget::showAll() { } if (_callTopBar) { _callTopBar->setVisible(true); - _callTopBarHeight = _callTopBar->height(); + + // show() could've send pending resize event that would update + // the height value and destroy the top bar if it was hiding. + if (_callTopBar) { + _callTopBarHeight = _callTopBar->height(); + } } updateControlsGeometry(); floatPlayerCheckVisibility(); @@ -2172,9 +2177,9 @@ void MainWidget::updateControlsGeometry() { const auto shadowTop = _controller->window().verticalShadowTop(); const auto shadowHeight = height() - shadowTop; _sideShadow->setGeometryToLeft( - dialogsWidth, + dialogsWidth, shadowTop, - st::lineWidth, + st::lineWidth, shadowHeight); if (_thirdShadow) { _thirdShadow->setGeometryToLeft(