From 789b1617f70e07f1c9bcb5253f1233acacbf6c8a 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/object/object_modes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object/object_modes.c') diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index 8e9e8558016..cc6aa34d39d 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -158,7 +158,7 @@ bool ED_object_mode_compat_set(bContext *C, Object *ob, eObjectMode mode, Report if (!ELEM(ob->mode, mode, OB_MODE_OBJECT)) { const char *opstring = object_mode_op_string(ob->mode); - WM_operator_name_call(C, opstring, WM_OP_EXEC_REGION_WIN, NULL); + WM_operator_name_call(C, opstring, WM_OP_EXEC_REGION_WIN, NULL, NULL); ok = ELEM(ob->mode, mode, OB_MODE_OBJECT); if (!ok) { wmOperatorType *ot = WM_operatortype_find(opstring, false); @@ -209,7 +209,7 @@ bool ED_object_mode_set_ex(bContext *C, eObjectMode mode, bool use_undo, ReportL if (!use_undo) { wm->op_undo_depth++; } - WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_REGION_WIN, NULL); + WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_REGION_WIN, NULL, NULL); if (!use_undo) { wm->op_undo_depth--; } -- cgit v1.2.3