diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-14 18:37:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-14 19:57:01 +0300 |
commit | 1208792adb30f1a2a4833b0503ce240f5f349501 (patch) | |
tree | 616ed5a2e92ed88d868973118cdc66561da2a3d8 /source/blender/editors/screen/screen_ops.c | |
parent | 582f9ddeb7aa4d2139cef4d0b0f53be32adcf852 (diff) |
WM: store operators with undo flag
This is needed so we can tell if operators are executed repeatedly.
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index a7a0a240259..1c17f8c12ff 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2904,9 +2904,20 @@ static void SCREEN_OT_spacedata_cleanup(wmOperatorType *ot) static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op)) { wmOperator *lastop = CTX_wm_manager(C)->operators.last; - - if (lastop) + + /* Seek last registered operator */ + while (lastop) { + if (lastop->type->flag & OPTYPE_REGISTER) { + break; + } + else { + lastop = lastop->prev; + } + } + + if (lastop) { WM_operator_repeat(C, lastop); + } return OPERATOR_CANCELLED; } @@ -2941,8 +2952,9 @@ static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNU layout = UI_popup_menu_layout(pup); for (i = items - 1, lastop = wm->operators.last; lastop; lastop = lastop->prev, i--) - if (WM_operator_repeat_check(C, lastop)) + if ((lastop->type->flag & OPTYPE_REGISTER) && WM_operator_repeat_check(C, lastop)) { uiItemIntO(layout, RNA_struct_ui_name(lastop->type->srna), ICON_NONE, op->type->idname, "index", i); + } UI_popup_menu_end(C, pup); |