diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_scene.h | 5 | ||||
-rw-r--r-- | source/blender/editors/scene/scene_edit.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/include/ED_scene.h b/source/blender/editors/include/ED_scene.h index 99a9693ad19..832f40d22aa 100644 --- a/source/blender/editors/include/ED_scene.h +++ b/source/blender/editors/include/ED_scene.h @@ -29,10 +29,7 @@ struct Scene *ED_scene_add(struct Main *bmain, struct bContext *C, struct wmWindow *win, enum eSceneCopyMethod method) ATTR_NONNULL(); -bool ED_scene_delete(struct bContext *C, - struct Main *bmain, - struct wmWindow *win, - struct Scene *scene) ATTR_NONNULL(); +bool ED_scene_delete(struct bContext *C, struct Main *bmain, struct Scene *scene) ATTR_NONNULL(); void ED_scene_change_update(struct Main *bmain, struct Scene *scene, struct ViewLayer *layer) ATTR_NONNULL(); bool ED_scene_view_layer_delete(struct Main *bmain, diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index 8834d243d4a..b04719d7782 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -86,7 +86,7 @@ Scene *ED_scene_add(Main *bmain, bContext *C, wmWindow *win, eSceneCopyMethod me * \note Only call outside of area/region loops * \return true if successful */ -bool ED_scene_delete(bContext *C, Main *bmain, wmWindow *win, Scene *scene) +bool ED_scene_delete(bContext *C, Main *bmain, Scene *scene) { Scene *scene_new; @@ -104,7 +104,14 @@ bool ED_scene_delete(bContext *C, Main *bmain, wmWindow *win, Scene *scene) return false; } - WM_window_set_active_scene(bmain, C, win, scene_new); + for (wmWindow *win = wm->windows.first; win; win = win->next) { + if (win->parent != NULL) { /* We only care about main windows here... */ + continue; + } + if (win->scene == scene) { + WM_window_set_active_scene(bmain, C, win, scene_new); + } + } BKE_id_delete(bmain, scene); @@ -244,7 +251,7 @@ static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - if (ED_scene_delete(C, CTX_data_main(C), CTX_wm_window(C), scene) == false) { + if (ED_scene_delete(C, CTX_data_main(C), scene) == false) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index d8057a0ea28..e1e7bf49606 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -399,7 +399,7 @@ static bool scene_cb(bContext *C, Scene *scene = (Scene *)tselem->id; if (event == OL_SCENE_OP_DELETE) { - if (ED_scene_delete(C, CTX_data_main(C), CTX_wm_window(C), scene)) { + if (ED_scene_delete(C, CTX_data_main(C), scene)) { WM_event_add_notifier(C, NC_SCENE | NA_REMOVED, scene); } else { |