From fd06a407e1f0b541b01e3d73134c20e89c815d67 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 5 Jul 2024 19:33:27 +0200 Subject: [PATCH] Fix #124163: Update SO_DATA_API Outliner When Windows are Removed On Window close send NC_WINDOW | NA_REMOVED notification. If Outliner is in SO_DATA_API mode with this message then refresh. Pull Request: https://projects.blender.org/blender/blender/pulls/124205 --- .../blender/editors/space_outliner/space_outliner.cc | 10 ++++++++++ source/blender/windowmanager/intern/wm_window.cc | 2 ++ 2 files changed, 12 insertions(+) diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index 664522f00b9..01984e02f56 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -103,6 +103,16 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params) /* context changes */ switch (wmn->category) { + case NC_WINDOW: + switch (wmn->action) { + case NA_ADDED: + case NA_REMOVED: + if (space_outliner->outlinevis == SO_DATA_API) { + ED_region_tag_redraw(region); + } + break; + } + break; case NC_WM: switch (wmn->data) { case ND_LIB_OVERRIDE_CHANGED: diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index 73bbae1bbce..3bf6ca3be09 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -477,6 +477,8 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) BKE_workspace_layout_remove(bmain, workspace, layout); WM_event_add_notifier(C, NC_SCREEN | ND_LAYOUTDELETE, nullptr); } + + WM_main_add_notifier(NC_WINDOW | NA_REMOVED, nullptr); } void wm_window_title(wmWindowManager *wm, wmWindow *win)