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-02 19:08:10 -06:00
committed by Ryan Foster
parent 9488bb20b6
commit 140abfeb66
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -1042,6 +1042,7 @@ public:
void SetDisplayAffinity(QWindow *window);
QColor GetSelectionColor() const;
inline bool Closing() { return closing; }
protected:
virtual void closeEvent(QCloseEvent *event) override;
+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));
}