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.
This commit is contained in:
parent
c0fbbc53e8
commit
06b183d1ca
Notes:
blender-bot
2023-02-14 03:34:17 +01:00
Referenced by issue #91507, Blender crashes if user right clicks on confirm button ('Save Startup File' dialog)
|
@ -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 :
|
||||
|
|
Loading…
Reference in New Issue