From 0f1eff08ad4f2aef173df828ef9577089255bdd9 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 31 Aug 2023 10:10:49 +0200 Subject: [PATCH] Outliner: listen to collection change in the header region Changing the active collection redraws many regions, not the Outliner header though (blender itself does not need a redraw there -- it does not present anything related to active collection in the header). This was requested from Addon devs in #109995 (placing active collection related buttons there). --- .../blender/editors/space_outliner/space_outliner.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index 52cbcba093a..4dc5bc142c7 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -311,8 +311,16 @@ static void outliner_header_region_listener(const wmRegionListenerParams *params /* context changes */ switch (wmn->category) { case NC_SCENE: - if (wmn->data == ND_KEYINGSET) { - ED_region_tag_redraw(region); + switch (wmn->data) { + case ND_KEYINGSET: + ED_region_tag_redraw(region); + break; + case ND_LAYER: + /* Not needed by blender itself, request from Addon devs. */ + if ((wmn->subtype == NS_LAYER_COLLECTION) && (wmn->action == NA_ACTIVATED)) { + ED_region_tag_redraw(region); + } + break; } break; case NC_SPACE: -- 2.30.2