From 3b870985081a0d477c9cf6477625d4f67ca06e18 Mon Sep 17 00:00:00 2001 From: tytan652 Date: Thu, 11 Apr 2024 10:57:24 +0200 Subject: [PATCH] UI: Fix double confirmation dialog while discarding source change QDialog::closeEvent() already calls the reject() function, the override of the former function was actually allowing a first confirmation dialog which once discarded gets re-openned by QDialog::closeEvent(). Removing most of the closeEvent() override code is enough to fix the issue since reject() will be called showing the confirmation dialog. --- UI/window-basic-properties.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/UI/window-basic-properties.cpp b/UI/window-basic-properties.cpp index 9064ef8a3..a10475f23 100644 --- a/UI/window-basic-properties.cpp +++ b/UI/window-basic-properties.cpp @@ -476,18 +476,9 @@ void OBSBasicProperties::reject() void OBSBasicProperties::closeEvent(QCloseEvent *event) { - if (!acceptClicked && (CheckSettings() != 0)) { - if (!ConfirmQuit()) { - event->ignore(); - return; - } - } - QDialog::closeEvent(event); - if (!event->isAccepted()) - return; - - Cleanup(); + if (event->isAccepted()) + Cleanup(); } bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message,