Fix #146993: Select tree view elements in popup menu
It seems `ui_handler_region_menu/ui_handle_menu_event` doesn't handle any events other than press/double-click as they return `WM_UI_HANDLER_BREAK`. `KM_CLICK` event is not possible due to above case. i.e. clicked element can't be set active inside `ui_handle_view_item_event()`. (Guess `HANDLER_BREAK` also prevents from looping over keymap to find relevant keyitem pair to invoke the operator? Didn't check in details). To fix this, add a condition that checks whether button is in popup menu. If yes, force active the pressed button and keep the popup open. Pull Request: https://projects.blender.org/blender/blender/pulls/147047
This commit is contained in:
committed by
Pratik Borhade
parent
88f6efc686
commit
bc5ab4526a
@@ -5150,6 +5150,12 @@ static int ui_do_but_VIEW_ITEM(bContext *C,
|
||||
return WM_UI_HANDLER_BREAK;
|
||||
}
|
||||
|
||||
if (ui_block_is_popup_any(but->block)) {
|
||||
/* TODO(!147047): This should be handled in selection operator. */
|
||||
force_activate_view_item_but(C, data->region, view_item_but, false);
|
||||
return WM_UI_HANDLER_BREAK;
|
||||
}
|
||||
|
||||
if (UI_view_item_supports_drag(*view_item_but->view_item)) {
|
||||
button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG);
|
||||
data->dragstartx = event->xy[0];
|
||||
|
||||
Reference in New Issue
Block a user