From 5e3e9ba8240ebbb7ac85410137e30a6e5791d558 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 22 May 2024 03:36:24 +0400 Subject: [PATCH] Ensure Qt doesn't prevent quit due to ignored widget close events --- Telegram/SourceFiles/core/sandbox.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 3daf91784..4110a73a7 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -255,7 +255,10 @@ void Sandbox::setupScreenScale() { Sandbox::~Sandbox() = default; bool Sandbox::event(QEvent *e) { - if (e->type() == QEvent::Quit && !Quitting()) { + if (e->type() == QEvent::Quit) { + if (Quitting()) { + return QCoreApplication::event(e); + } Quit(QuitReason::QtQuitEvent); e->ignore(); return false;