diff --git a/frontend/widgets/OBSBasic_Clipboard.cpp b/frontend/widgets/OBSBasic_Clipboard.cpp index b663d6ff2b9d22..2407e1014a87f0 100644 --- a/frontend/widgets/OBSBasic_Clipboard.cpp +++ b/frontend/widgets/OBSBasic_Clipboard.cpp @@ -278,6 +278,7 @@ OBS::ItemPasteType OBSBasic::getItemPasteType() return OBS::ItemPasteType::Invalid; } + bool allowPastingReference = true; bool allowPastingDuplicate = true; for (size_t i = clipboard.size(); i > 0; i--) { const size_t idx = i - 1; @@ -290,6 +291,19 @@ OBS::ItemPasteType OBSBasic::getItemPasteType() if (allowPastingDuplicate && obs_source_get_output_flags(strong) & OBS_SOURCE_DO_NOT_DUPLICATE) { allowPastingDuplicate = false; } + + if (allowPastingReference && obs_source_is_group(strong)) { + allowPastingReference = false; + } } - return allowPastingDuplicate ? OBS::ItemPasteType::Both : OBS::ItemPasteType::Reference; + + if (allowPastingReference && allowPastingDuplicate) { + return OBS::ItemPasteType::Both; + } else if (allowPastingReference) { + return OBS::ItemPasteType::Reference; + } else if (allowPastingDuplicate) { + return OBS::ItemPasteType::Duplicate; + } + + return OBS::ItemPasteType::Invalid; } diff --git a/libobs/obs-scene.c b/libobs/obs-scene.c index 02fa144a26b63d..703b24d5660edc 100644 --- a/libobs/obs-scene.c +++ b/libobs/obs-scene.c @@ -1961,7 +1961,8 @@ obs_scene_t *obs_scene_duplicate(obs_scene_t *scene, const char *name, enum obs_ for (size_t i = 0; i < items.num; i++) { item = items.array[i]; - source = make_unique ? dup_child(&items, i, new_scene, make_private) : new_ref(item->source); + source = (make_unique || item->is_group) ? dup_child(&items, i, new_scene, make_private) + : new_ref(item->source); if (source) { struct obs_scene_item *new_item = obs_scene_add(new_scene, source);