From 0434e520fdbfdf69246c2be0a220ae9eb2ecfbbc Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 15 Jun 2022 19:59:16 +0400 Subject: [PATCH] Don't quit on secondary window destroy by the system. --- Telegram/SourceFiles/platform/win/main_window_win.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/win/main_window_win.cpp b/Telegram/SourceFiles/platform/win/main_window_win.cpp index ee1cfc5c6..02f59c7cf 100644 --- a/Telegram/SourceFiles/platform/win/main_window_win.cpp +++ b/Telegram/SourceFiles/platform/win/main_window_win.cpp @@ -216,7 +216,13 @@ void MainWindow::shadowsDeactivate() { } void MainWindow::destroyedFromSystem() { - Core::Quit(); + if (isPrimary()) { + Core::Quit(); + } else { + crl::on_main(this, [=] { + Core::App().closeWindow(&controller()); + }); + } } int32 MainWindow::screenNameChecksum(const QString &name) const {