Skip to content

Commit

Permalink
UI: Fix closing OBS with floating docks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cg2121 authored and RytoEX committed Mar 12, 2024
1 parent 9488bb2 commit 140abfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions UI/window-basic-main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ private slots:
void SetDisplayAffinity(QWindow *window);

QColor GetSelectionColor() const;
inline bool Closing() { return closing; }

protected:
virtual void closeEvent(QCloseEvent *event) override;
Expand Down
3 changes: 2 additions & 1 deletion UI/window-dock.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "window-dock.hpp"
#include "obs-app.hpp"
#include "window-basic-main.hpp"

#include <QMessageBox>
#include <QCheckBox>
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit 140abfe

Please sign in to comment.