UI: Don't update text source when nothing changed

(cherry picked from commit e830043851)
This commit is contained in:
Exeldro 2023-06-09 09:15:19 +02:00 committed by Ryan Foster
parent 850df1058f
commit 0be3b3b845

View file

@ -728,12 +728,15 @@ void TextSourceToolbar::on_text_textChanged()
if (!source) {
return;
}
std::string newText = QT_TO_UTF8(ui->text->text());
OBSDataAutoRelease settings = obs_source_get_settings(source);
if (newText == obs_data_get_string(settings, "text")) {
return;
}
SaveOldProperties(source);
OBSDataAutoRelease settings = obs_data_create();
obs_data_set_string(settings, "text", QT_TO_UTF8(ui->text->text()));
obs_source_update(source, settings);
obs_data_set_string(settings, "text", newText.c_str());
obs_source_update(source, nullptr);
SetUndoProperties(source, true);
}