mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-30 17:58:37 +08:00
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:
@@ -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
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user