diff options
author | David Friedli <hlorus> | 2020-09-28 07:24:29 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-28 07:28:28 +0300 |
commit | b1bdfb6e32b9371048677196ac256290cfd35d0b (patch) | |
tree | 1133dc257fe4202338361280b6429167fbe46e87 /source/blender/editors/screen/area.c | |
parent | 8c81b3fb8b9c857626c037fe0c95c5d48a3ca20f (diff) |
Fix T79275: Missing redraw for pinned active tool settings panels
In the 3D view sidebar, the active tool settings panel can be pinned to other
categories, and in those other categories it doesn't redraw when the active
tool changes. This commit checks for pinned panels from the "Tool" category
when checking whether to redraw.
Note that the relatively expensive string comparison is only done for
currently visible pinned panels.
Differential Revision: https://developer.blender.org/D9012
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 2e9f297b705..7b41b1df0ab 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -450,8 +450,25 @@ void ED_area_do_mgs_subscribe_for_tool_ui( struct wmMsgBus *mbus) { BLI_assert(region->regiontype == RGN_TYPE_UI); + const char *panel_category_tool = "Tool"; const char *category = UI_panel_category_active_get(region, false); - if (category && STREQ(category, "Tool")) { + + bool update_region = false; + if (category && STREQ(category, panel_category_tool)) { + update_region = true; + } + else { + /* Check if a tool category panel is pinned and visible in another category. */ + LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { + if (UI_panel_is_active(panel) && panel->flag & PNL_PIN && + STREQ(panel->type->category, panel_category_tool)) { + update_region = true; + break; + } + } + } + + if (update_region) { wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, .user_data = region, |