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
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-11-01 18:30:40 +0300
committerJulian Eisel <julian@blender.org>2021-11-01 18:42:46 +0300
commit06b183d1ca48ea638b8c54102c0c9adf55cef76f (patch)
tree185bd301dc80841e98a0cf4669adf6af9b9f5648 /source/blender/editors/interface
parentc0fbbc53e8fe6e58a1d6029754a2e1da1f9acfcc (diff)
Fix T91507: Crash when calling context menu from confirmation popup
A typical issue with popup handling: We have to respect the menu-region and give it priority over the regular region for handling. In this case there isn't a regular region in context even.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_context_menu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index 516fd4fc7fc..72e7203c6ea 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -926,7 +926,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
}
{
- const ARegion *region = CTX_wm_region(C);
+ const ARegion *region = CTX_wm_menu(C) ? CTX_wm_menu(C) : CTX_wm_region(C);
uiButTreeRow *treerow_but = (uiButTreeRow *)ui_tree_row_find_mouse_over(region, event->xy);
if (treerow_but) {
BLI_assert(treerow_but->but.type == UI_BTYPE_TREEROW);
@@ -1212,7 +1212,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
}
/* UI List item context menu. Scripts can add items to it, by default there's nothing shown. */
- ARegion *region = CTX_wm_region(C);
+ const ARegion *region = CTX_wm_menu(C) ? CTX_wm_menu(C) : CTX_wm_region(C);
const bool is_inside_listbox = ui_list_find_mouse_over(region, event) != NULL;
const bool is_inside_listrow = is_inside_listbox ?
ui_list_row_find_mouse_over(region, event->xy) != NULL :