From 0be3524658f1e31570b52ab8aaecc5a9faae0696 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 7 Dec 2021 20:52:45 -0800 Subject: [PATCH] UI: Don't show properties on creation if no properties If a source doesn't have any properties, don't show properties on creation --- UI/window-basic-main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 8168668bb..93c372af4 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5599,12 +5599,23 @@ void OBSBasic::on_scenes_itemDoubleClicked(QListWidgetItem *witem) } } +static inline bool should_show_properties(obs_source_t *source, const char *id) +{ + if (!source) + return false; + if (strcmp(id, "group") == 0) + return false; + if (!obs_source_configurable(source)) + return false; + return true; +} + void OBSBasic::AddSource(const char *id) { if (id && *id) { OBSBasicSourceSelect sourceSelect(this, id, undo_s); sourceSelect.exec(); - if (sourceSelect.newSource && strcmp(id, "group") != 0) { + if (should_show_properties(sourceSelect.newSource, id)) { CreatePropertiesWindow(sourceSelect.newSource); } }