From 0fe4688a349e8c10af7f972290ef178cc6b246a5 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Sat, 14 Oct 2017 01:49:37 -0400 Subject: [PATCH] UI: Disallow pasting duplicates of sources with DO_NOT_DUPLICATE This commit prevents users from being able to use the "Paste (Duplicate)" context menu option after copying a source that has the OBS_SOURCE_DO_NOT_DUPLICATE flag set. Though OBS would correctly paste the source as a reference, it seems that this behavior was confusing some users. This fixes Mantis Bug 1034. --- UI/window-basic-main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index f2126f10d..946dd5d08 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5757,7 +5757,12 @@ void OBSBasic::on_actionCopySource_triggered() copyVisible = obs_sceneitem_visible(item); ui->actionPasteRef->setEnabled(true); - ui->actionPasteDup->setEnabled(true); + + uint32_t output_flags = obs_source_get_output_flags(source); + if ((output_flags & OBS_SOURCE_DO_NOT_DUPLICATE) == 0) + ui->actionPasteDup->setEnabled(true); + else + ui->actionPasteDup->setEnabled(false); } void OBSBasic::on_actionPasteRef_triggered()