fix [#30087] operator_context is different for popup and submenu's *TODO, after 2.62*

having context different for menu vs submenu is quite confusing, now they are both: WM_OP_INVOKE_REGION_WIN
this changes WM_menu_invoke behavior.
This commit is contained in:
2012-10-26 06:22:54 +00:00
parent 2d39533da8
commit dbde62d124
5 changed files with 19 additions and 1 deletions

View File

@@ -674,6 +674,8 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
else {
pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE);
layout = uiPupMenuLayout(pup);
/* set this so the default execution context is the same as submenus */
uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
uiItemsFullEnumO(layout, op->type->idname, RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup);
}