mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
UI: Don't update text source when nothing changed
(cherry picked from commit e830043851
)
This commit is contained in:
parent
850df1058f
commit
0be3b3b845
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue