diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index b9fa4c52e..b8bd743cd 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -4076,6 +4076,16 @@ void OBSBasic::EnumDialogs() } } +void OBSBasic::ClearProjectors() +{ + for (size_t i = 0; i < projectors.size(); i++) { + if (projectors[i]) + delete projectors[i]; + } + + projectors.clear(); +} + void OBSBasic::ClearSceneData() { disableSaving++; @@ -4088,12 +4098,7 @@ void OBSBasic::ClearSceneData() ClearQuickTransitions(); ui->transitions->clear(); - for (size_t i = 0; i < projectors.size(); i++) { - if (projectors[i]) - delete projectors[i]; - } - - projectors.clear(); + ClearProjectors(); obs_set_output_source(0, nullptr); obs_set_output_source(1, nullptr); @@ -8264,6 +8269,15 @@ void OBSBasic::UpdateProjectorAlwaysOnTop(bool top) SetAlwaysOnTop(projectors[i], top); } +void OBSBasic::ResetProjectors() +{ + obs_data_array_t *savedProjectorList = SaveProjectors(); + ClearProjectors(); + LoadSavedProjectors(savedProjectorList); + OpenSavedProjectors(); + obs_data_array_release(savedProjectorList); +} + void OBSBasic::on_sourcePropertiesButton_clicked() { on_actionSourceProperties_triggered(); diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index 289664538..c70dc8e08 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -347,6 +347,7 @@ private: void CloseDialogs(); void ClearSceneData(); + void ClearProjectors(); void Nudge(int dist, MoveDir dir); @@ -530,6 +531,7 @@ private: void UpdateProjectorHideCursor(); void UpdateProjectorAlwaysOnTop(bool top); + void ResetProjectors(); QPointer screenshotData; diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index 96453a07a..fd0fb9b9a 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -2958,8 +2958,12 @@ void OBSBasicSettings::SaveGeneralSettings() config_set_bool(GetGlobalConfig(), "BasicWindow", "ProjectorAlwaysOnTop", ui->projectorAlwaysOnTop->isChecked()); +#if defined(_WIN32) || defined(__APPLE__) main->UpdateProjectorAlwaysOnTop( ui->projectorAlwaysOnTop->isChecked()); +#else + main->ResetProjectors(); +#endif } if (WidgetChanged(ui->recordWhenStreaming))