Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-08-06 00:36:16 +0300
committerHans Goudey <h.goudey@me.com>2020-08-06 00:36:16 +0300
commitc5b6b3d82f56b6da1fce19b961fa444745dbc269 (patch)
treee44772310f74c23f3ae29e7d1455159eb92a7dfd /source
parent59861db763ebb8d031bd768504fbd485da7ea75f (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_panel.c12
1 files changed, 6 insertions, 6 deletions
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, &region->uiblocks) {
if (STREQ(block->name, block_name)) {
BLI_remlink(&region->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, &region->panels, panel);
+ panel_delete(C, region, &region->panels, panel);
}
}
}