diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-25 03:29:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-25 03:29:41 +0300 |
commit | e63c360bcdc04ab9c3009e89b0904e501b18e320 (patch) | |
tree | b2eed0a6bfb7947330e3acd4132772a051cf5efd | |
parent | b5a2dc16fc4853f45be289a435f5e1fff2c74c9e (diff) |
WM: don't set repeat flag w/ interactive repeat
This allows operators to distinguish between redo and executing
repeat last operator, needed for T60777 fix.
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 16 |
3 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 6d332f8e427..8736664d23c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3359,7 +3359,7 @@ static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op)) if (lastop) { WM_operator_free_all_after(wm, lastop); - WM_operator_repeat(C, lastop); + WM_operator_repeat_interactive(C, lastop); } return OPERATOR_CANCELLED; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 4f73e731457..bfd555abb9a 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -322,6 +322,7 @@ int WM_operator_call_ex(struct bContext *C, struct wmOperator *op, const int WM_operator_call (struct bContext *C, struct wmOperator *op); int WM_operator_call_notest(struct bContext *C, struct wmOperator *op); int WM_operator_repeat (struct bContext *C, struct wmOperator *op); +int WM_operator_repeat_interactive(struct bContext *C, struct wmOperator *op); bool WM_operator_repeat_check(const struct bContext *C, struct wmOperator *op); bool WM_operator_is_repeat(const struct bContext *C, const struct wmOperator *op); int WM_operator_name_call_ptr(struct bContext *C, struct wmOperatorType *ot, short context, struct PointerRNA *properties); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 0362f393bdb..64b3ca6a300 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -940,7 +940,9 @@ static void wm_operator_finished(bContext *C, wmOperator *op, const bool repeat, } /* if repeat is true, it doesn't register again, nor does it free */ -static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, const bool store) +static int wm_operator_exec( + bContext *C, wmOperator *op, + const bool repeat, const bool use_repeat_op_flag, const bool store) { wmWindowManager *wm = CTX_wm_manager(C); int retval = OPERATOR_CANCELLED; @@ -958,12 +960,12 @@ static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, cons wm->op_undo_depth++; } - if (repeat) { + if (repeat && use_repeat_op_flag) { op->flag |= OP_IS_REPEAT; } retval = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(retval); - if (repeat) { + if (repeat && use_repeat_op_flag) { op->flag &= ~OP_IS_REPEAT; } @@ -1015,7 +1017,7 @@ static int wm_operator_exec_notest(bContext *C, wmOperator *op) int WM_operator_call_ex(bContext *C, wmOperator *op, const bool store) { - return wm_operator_exec(C, op, false, store); + return wm_operator_exec(C, op, false, false, store); } int WM_operator_call(bContext *C, wmOperator *op) @@ -1038,7 +1040,11 @@ int WM_operator_call_notest(bContext *C, wmOperator *op) */ int WM_operator_repeat(bContext *C, wmOperator *op) { - return wm_operator_exec(C, op, true, true); + return wm_operator_exec(C, op, true, true, true); +} +int WM_operator_repeat_interactive(bContext *C, wmOperator *op) +{ + return wm_operator_exec(C, op, true, false, true); } /** * \return true if #WM_operator_repeat can run |