From 76ddf6d2ee97bf51290492d4c692dd8ca031182c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 5 Sep 2011 17:57:04 +0000 Subject: 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. --- source/blender/editors/interface/interface_layout.c | 2 +- source/blender/editors/space_logic/logic_ops.c | 6 +++--- source/blender/windowmanager/intern/wm_event_system.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index a2e65f5e4ec..803da55cea6 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -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); } diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index 638bfe57608..60e9595b77a 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -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"); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 5711ec899bf..8861f128c4b 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -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; } -- cgit v1.2.3