Commit: c5b6b3d82f56b6da1fce19b961fa444745dbc269
Author: Julian Eisel
Date: Wed Aug 5 17:36:16 2020 -0400
Branches: blender-v2.90-release
https://developer.blender.org/rBc5b6b3d82f56b6da1fce19b961fa444745dbc269
Fix T78698: Move cursor stuck after removing modifier
The panels are rebuilt when a modifier is removed so the button handlers need
to properly finish. By adding a context argument to the panel_delete function
this will happen properly.
===================================================================
M source/blender/editors/interface/interface_panel.c
===================================================================
diff --git a/source/blender/editors/interface/interface_panel.c
b/source/blender/editors/interface/interface_panel.c
index dd3074d6258..799a3b7fd5e 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -321,7 +321,7 @@ void UI_list_panel_unique_str(Panel *panel, char *r_name)
* Remove the #uiBlock corresponding to a panel. The lookup is needed because
panels don't store
* a reference to their corresponding #uiBlock.
*/
-static void panel_free_block(ARegion *region, Panel *panel)
+static void panel_free_block(const bContext *C, ARegion *region, Panel *panel)
{
BLI_assert(panel->type);
@@ -334,7 +334,7 @@ static void panel_free_block(ARegion *region, Panel *panel)
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
if (STREQ(block->name, block_name)) {
BLI_remlink(®ion->uiblocks, block);
- UI_block_free(NULL, block);
+ UI_block_free(C, block);
break; /* Only delete one block for this panel. */
}
}
@@ -347,15 +347,15 @@ static void panel_free_block(ARegion *region, Panel
*panel)
* \note The only panels that should need to be deleted at runtime are panels
with the
* #PNL_INSTANCED flag set.
*/
-static void panel_delete(ARegion *region, ListBase *panels, Panel *panel)
+static void panel_delete(const bContext *C, ARegion *region, ListBase *panels,
Panel *panel)
{
/* Recursively delete children. */
LISTBASE_FOREACH_MUTABLE (Panel *, child, &panel->children) {
- panel_delete(region, &panel->children, child);
+ panel_delete(C, region, &panel->children, child);
}
BLI_freelistN(&panel->children);
- panel_free_block(region, panel);
+ panel_free_block(C, region, panel);
BLI_remlink(panels, panel);
if (panel->activedata) {
@@ -386,7 +386,7 @@ void UI_panels_free_instanced(bContext *C, ARegion *region)
}
/* Free the panel and its sub-panels. */
- panel_delete(region, ®ion->panels, panel);
+ panel_delete(C, region, ®ion->panels, panel);
}
}
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs