UI: Fix closing OBS with floating docks

When OBS is closed and there is a floating dock, a Windows system
sound is emitted. This fixes that by not executing the close dock
dialog when OBS is closing.
This commit is contained in:
cg2121
2024-03-11 20:38:04 -04:00
committed by Ryan Foster
parent 9488bb20b6
commit 140abfeb66
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
#include "window-dock.hpp"
#include "obs-app.hpp"
#include "window-basic-main.hpp"
#include <QMessageBox>
#include <QCheckBox>
@@ -27,7 +28,7 @@ void OBSDock::closeEvent(QCloseEvent *event)
bool warned = config_get_bool(App()->GlobalConfig(), "General",
"WarnedAboutClosingDocks");
if (!warned) {
if (!OBSBasic::Get()->Closing() && !warned) {
QMetaObject::invokeMethod(App(), "Exec", Qt::QueuedConnection,
Q_ARG(VoidFunc, msgBox));
}