diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-01-20 19:33:10 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-01-20 19:33:10 +0300 |
commit | 89b6a7bae9160d762f085eff8e927bdac1a60801 (patch) | |
tree | c0a9985e5902d91d19d6341e537d737bbb76526d /source/blender/windowmanager/intern | |
parent | 587ca9e69b85195827fea372c880f6ba45ca83b7 (diff) | |
parent | 31e2786707049c40b9d8639639fd16a5cc0dce13 (diff) |
Merge remote-tracking branch 'origin/blender-v2.82-release'
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operator_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_utils.c b/source/blender/windowmanager/intern/wm_operator_utils.c index 856c85d4554..44afa708136 100644 --- a/source/blender/windowmanager/intern/wm_operator_utils.c +++ b/source/blender/windowmanager/intern/wm_operator_utils.c @@ -148,6 +148,7 @@ static bool interactive_value_update(ValueInteraction *inter, * \{ */ struct ObCustomData_ForEditMode { + int launch_event; bool wait_for_input; bool is_active; bool is_first; @@ -211,6 +212,7 @@ static int op_generic_value_invoke(bContext *C, wmOperator *op, const wmEvent *e } struct ObCustomData_ForEditMode *cd = MEM_callocN(sizeof(*cd), __func__); + cd->launch_event = WM_userdef_event_type_from_keymap_type(event->type); cd->wait_for_input = RNA_boolean_get(op->ptr, "wait_for_input"); cd->is_active = !cd->wait_for_input; cd->is_first = true; @@ -239,6 +241,15 @@ static int op_generic_value_invoke(bContext *C, wmOperator *op, const wmEvent *e static int op_generic_value_modal(bContext *C, wmOperator *op, const wmEvent *event) { struct ObCustomData_ForEditMode *cd = op->customdata; + + /* Special case, check if we release the event that activated this operator. */ + if ((event->type == cd->launch_event) && (event->val == KM_RELEASE)) { + if (cd->wait_for_input == false) { + op_generic_value_exit(op); + return OPERATOR_FINISHED; + } + } + switch (event->type) { case MOUSEMOVE: case LEFTCTRLKEY: |