diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 601b0d5ec..235bd6ed7 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -1103,6 +1103,21 @@ void OBSBasic::SaveProject() if (disableSaving) return; + projectChanged = true; + QMetaObject::invokeMethod(this, "SaveProjectDeferred", + Qt::QueuedConnection); +} + +void OBSBasic::SaveProjectDeferred() +{ + if (disableSaving) + return; + + if (!projectChanged) + return; + + projectChanged = false; + const char *sceneCollection = config_get_string(App()->GlobalConfig(), "Basic", "SceneCollectionFile"); char savePath[512]; diff --git a/obs/window-basic-main.hpp b/obs/window-basic-main.hpp index bd475f569..e81f3d5e6 100644 --- a/obs/window-basic-main.hpp +++ b/obs/window-basic-main.hpp @@ -75,6 +75,7 @@ private: bool loaded = false; long disableSaving = 1; + bool projectChanged = false; QPointer updateCheckThread; QPointer logUploadThread; @@ -197,6 +198,7 @@ public slots: void RecordingStart(); void RecordingStop(int code); + void SaveProjectDeferred(); void SaveProject(); private slots: