Skip to content

Commit fb5140d

Browse files
Warchamp7RytoEX
authored andcommitted
frontend: Only send event when scene list changed
1 parent 68984b4 commit fb5140d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/widgets/OBSBasic_Scenes.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ void OBSBasic::RemoveScene(OBSSource source)
168168
{
169169
obs_scene_t *scene = obs_scene_from_source(source);
170170

171+
bool foundItem = false;
171172
QListWidgetItem *sel = nullptr;
172173
int count = ui->scenes->count();
173174

@@ -177,6 +178,7 @@ void OBSBasic::RemoveScene(OBSSource source)
177178
if (cur_scene != scene)
178179
continue;
179180

181+
foundItem = true;
180182
sel = item;
181183
break;
182184
}
@@ -195,7 +197,9 @@ void OBSBasic::RemoveScene(OBSSource source)
195197
OBSProjector::UpdateMultiviewProjectors();
196198
}
197199

198-
OnEvent(OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED);
200+
if (foundItem) {
201+
OnEvent(OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED);
202+
}
199203
}
200204

201205
static bool select_one(obs_scene_t * /* scene */, obs_sceneitem_t *item, void *param)

0 commit comments

Comments
 (0)