Commit: e63c360bcdc04ab9c3009e89b0904e501b18e320
Author: Campbell Barton
Date:   Fri Jan 25 11:29:41 2019 +1100
Branches: master
https://developer.blender.org/rBe63c360bcdc04ab9c3009e89b0904e501b18e320

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.

===================================================================

M       source/blender/editors/screen/screen_ops.c
M       source/blender/windowmanager/WM_api.h
M       source/blender/windowmanager/intern/wm_event_system.c

===================================================================

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

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to