diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index c3f9f9004d..3bafea1cd0 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -196,7 +196,6 @@ void MainWindow::finishFirstShow() { } void MainWindow::clearWidgetsHook() { - destroyLayer(); _mediaPreview.destroy(); _main.destroy(); _intro.destroy(); @@ -284,10 +283,17 @@ void MainWindow::setupIntro(Intro::EnterPoint point) { void MainWindow::setupMain() { Expects(account().sessionExists()); - auto animated = (_intro || _passcodeLock); - auto bg = animated ? grabInner() : QPixmap(); - - destroyLayer(); + const auto animated = (_intro || _passcodeLock); + const auto bg = animated ? grabInner() : QPixmap(); + const auto weak = (_main && _layer) + ? Ui::MakeWeak(_layer.get()) + : nullptr; + if (weak) { + Assert(!animated); + _layer->hideAllAnimatedPrepare(); + } else { + destroyLayer(); + } auto created = object_ptr(bodyWidget(), sessionController()); clearWidgets(); _main = std::move(created); @@ -304,6 +310,9 @@ void MainWindow::setupMain() { Core::App().checkStartUrl(); } fixOrder(); + if (const auto strong = weak.data()) { + strong->hideAllAnimatedRun(); + } } void MainWindow::showSettings() { diff --git a/Telegram/SourceFiles/window/window_controller.cpp b/Telegram/SourceFiles/window/window_controller.cpp index 7ea10b35aa..f39310739b 100644 --- a/Telegram/SourceFiles/window/window_controller.cpp +++ b/Telegram/SourceFiles/window/window_controller.cpp @@ -45,6 +45,7 @@ Controller::Controller() Controller::~Controller() { // We want to delete all widgets before the _sessionController. + _widget.ui_hideSettingsAndLayer(anim::type::instant); _widget.clearWidgets(); } diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 2a0d189ee2..d6e7aa6f63 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 2a0d189ee22d8573bd4f9f0971ef1aa27a12f02d +Subproject commit d6e7aa6f63febb6f7fd6e0a80a469fb86dc17e6e