Fix #28404: certain keyboard shortcuts not shown in menus, e.g. move operators
in graph editor > channel menu. Problem was these did not inherit operator execution context correctly. Fix found by Sergey, also needed to fix logic operators which were not working when invoked instead of executed.
This commit is contained in:
@@ -1526,7 +1526,7 @@ static void menu_item_enum_opname_menu(bContext *UNUSED(C), uiLayout *layout, vo
|
||||
{
|
||||
MenuItemLevel *lvl= (MenuItemLevel*)(((uiBut*)arg)->func_argN);
|
||||
|
||||
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
|
||||
uiLayoutSetOperatorContext(layout, lvl->opcontext);
|
||||
uiItemsEnumO(layout, lvl->opname, lvl->propname);
|
||||
}
|
||||
|
||||
|
@@ -322,7 +322,7 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
|
||||
ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
|
||||
RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
|
||||
RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Sensor to add");
|
||||
RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Sensor to");
|
||||
@@ -437,7 +437,7 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
|
||||
ot->prop= RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
|
||||
RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Controller to add");
|
||||
RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Controller to");
|
||||
}
|
||||
@@ -539,7 +539,7 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
|
||||
ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
|
||||
RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
|
||||
RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Actuator to add");
|
||||
RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Actuator to");
|
||||
|
@@ -886,8 +886,8 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
|
||||
CTX_wm_region_set(C, NULL);
|
||||
CTX_wm_area_set(C, NULL);
|
||||
retval= wm_operator_invoke(C, ot, event, properties, reports, poll_only);
|
||||
CTX_wm_region_set(C, ar);
|
||||
CTX_wm_area_set(C, area);
|
||||
CTX_wm_region_set(C, ar);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user