From 0cddc7e300fd90cdc6dd8ca8dafca21e8ccfa8a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 19 Jan 2018 21:07:43 +1100 Subject: WM: operator flag to check repeat/redo execution --- source/blender/windowmanager/intern/wm_event_system.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index ed56586711d..61c144a63d4 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -802,14 +802,22 @@ static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, cons return retval; if (op->type->exec) { - if (op->type->flag & OPTYPE_UNDO) + if (op->type->flag & OPTYPE_UNDO) { wm->op_undo_depth++; + } + if (repeat) { + op->flag |= OP_IS_REPEAT; + } retval = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(retval); + if (repeat) { + op->flag &= ~OP_IS_REPEAT; + } - if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) + if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) { wm->op_undo_depth--; + } } /* XXX Disabled the repeat check to address part 2 of #31840. -- cgit v1.2.3