From 924cf3b9665e346f1fa64f7eb18000afef8d2184 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 11 Mar 2022 22:49:47 +1100 Subject: Fix out of order event handling when calling operators from gizmos Activating a gizmo used the windows eventstate which may have values newer than the event used to activate the gizmo. This meant transforms check for the key that activated transform could be incorrect. Support passing an event when calling operators to avoid this problem. --- source/blender/editors/space_outliner/outliner_dragdrop.cc | 2 +- source/blender/editors/space_outliner/outliner_edit.cc | 6 +++--- source/blender/editors/space_outliner/outliner_tools.cc | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.cc b/source/blender/editors/space_outliner/outliner_dragdrop.cc index ba4c3b0e595..30b81b2ecb2 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.cc +++ b/source/blender/editors/space_outliner/outliner_dragdrop.cc @@ -1434,7 +1434,7 @@ static int outliner_item_drag_drop_invoke(bContext *C, PointerRNA op_ptr; WM_operator_properties_create_ptr(&op_ptr, ot); RNA_float_set(&op_ptr, "outside_padding", OUTLINER_DRAG_SCOLL_OUTSIDE_PAD); - WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_ptr); + WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_ptr, event); WM_operator_properties_free(&op_ptr); } diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc index 8a02c3b64f2..a60e082f6a5 100644 --- a/source/blender/editors/space_outliner/outliner_edit.cc +++ b/source/blender/editors/space_outliner/outliner_edit.cc @@ -729,7 +729,7 @@ void id_remap_fn(bContext *C, RNA_enum_set(&op_props, "id_type", GS(tselem->id->name)); RNA_enum_set_identifier(C, &op_props, "old_id", tselem->id->name + 2); - WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props); + WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props, nullptr); WM_operator_properties_free(&op_props); } @@ -875,10 +875,10 @@ static int lib_relocate( RNA_string_set(&op_props, "directory", dir); RNA_string_set(&op_props, "filename", filename); - ret = WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &op_props); + ret = WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &op_props, nullptr); } else { - ret = WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props); + ret = WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props, nullptr); } WM_operator_properties_free(&op_props); diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 71a22d76f15..8fe40dde118 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -2216,14 +2216,14 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op) } case OUTLINER_IDOP_COPY: { wm->op_undo_depth++; - WM_operator_name_call(C, "OUTLINER_OT_id_copy", WM_OP_INVOKE_DEFAULT, nullptr); + WM_operator_name_call(C, "OUTLINER_OT_id_copy", WM_OP_INVOKE_DEFAULT, nullptr, nullptr); wm->op_undo_depth--; /* No need for undo, this operation does not change anything... */ break; } case OUTLINER_IDOP_PASTE: { wm->op_undo_depth++; - WM_operator_name_call(C, "OUTLINER_OT_id_paste", WM_OP_INVOKE_DEFAULT, nullptr); + WM_operator_name_call(C, "OUTLINER_OT_id_paste", WM_OP_INVOKE_DEFAULT, nullptr, nullptr); wm->op_undo_depth--; ED_outliner_select_sync_from_all_tag(C); ED_undo_push(C, "Paste"); @@ -2595,7 +2595,8 @@ static int outliner_animdata_operation_exec(bContext *C, wmOperator *op) case OUTLINER_ANIMOP_SET_ACT: /* delegate once again... */ wm->op_undo_depth++; - WM_operator_name_call(C, "OUTLINER_OT_action_set", WM_OP_INVOKE_REGION_WIN, nullptr); + WM_operator_name_call( + C, "OUTLINER_OT_action_set", WM_OP_INVOKE_REGION_WIN, nullptr, nullptr); wm->op_undo_depth--; ED_undo_push(C, "Set active action"); break; -- cgit v1.2.3