mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-06-25 08:09:53 -04:00
frontend: Fix pasting scene item on not the current scene
This commit is contained in:
@@ -148,15 +148,17 @@ void setupSceneItem(void *_data, obs_scene_t *scene)
|
||||
}
|
||||
|
||||
std::optional<OBSSceneItem> setupExistingSource(std::string_view uuid, bool visible, bool duplicate,
|
||||
SourceCopyInfo *info = nullptr)
|
||||
SourceCopyInfo *info = nullptr, OBSScene scene = nullptr)
|
||||
{
|
||||
OBSSourceAutoRelease temp = obs_get_source_by_uuid(uuid.data());
|
||||
if (!temp) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
OBSScene scene = main->GetCurrentScene();
|
||||
if (!scene) {
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
scene = main->GetCurrentScene();
|
||||
}
|
||||
if (!scene) {
|
||||
return std::nullopt;
|
||||
}
|
||||
@@ -310,7 +312,7 @@ void OBSBasicSourceSelect::obsSourceRemoved(void *data, calldata_t *params)
|
||||
Qt::QueuedConnection, Q_ARG(QString, QString::fromUtf8(uuidPointer)));
|
||||
}
|
||||
|
||||
void OBSBasicSourceSelect::sourcePaste(SourceCopyInfo &info, bool duplicate)
|
||||
void OBSBasicSourceSelect::sourcePaste(SourceCopyInfo &info, bool duplicate, OBSScene scene)
|
||||
{
|
||||
OBSSource source = OBSGetStrongRef(info.weak_source);
|
||||
if (!source) {
|
||||
@@ -319,7 +321,7 @@ void OBSBasicSourceSelect::sourcePaste(SourceCopyInfo &info, bool duplicate)
|
||||
|
||||
std::string uuid = obs_source_get_uuid(source);
|
||||
|
||||
setupExistingSource(uuid, info.visible, duplicate, &info);
|
||||
setupExistingSource(uuid, info.visible, duplicate, &info, scene);
|
||||
}
|
||||
|
||||
void OBSBasicSourceSelect::showEvent(QShowEvent *)
|
||||
|
||||
Reference in New Issue
Block a user