diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-07-03 16:07:14 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-07-03 16:18:46 +0300 |
commit | d97c3bc7ad13cb9e3ec2248ce035a62c28ac70f8 (patch) | |
tree | 6dc5b6169e1398b4dc53f5aefc7304cb13ccbcda /source/blender/editors/util/undo.c | |
parent | 871325e26fe12efe8bf8a7042d94896f2f7faf6c (diff) | |
parent | eb1532a86094ba5d59bf62b1fbd50f74a639d0a8 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/util/undo.c')
-rw-r--r-- | source/blender/editors/util/undo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index f5830e451e3..ff328a28ee9 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -335,6 +335,12 @@ static int ed_undo_redo_exec(bContext *C, wmOperator *UNUSED(op)) return ret ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } +static int ed_undo_redo_poll(bContext *C) +{ + wmOperator *last_op = WM_operator_last_redo(C); + return last_op && ED_operator_screenactive(C) && + WM_operator_check_ui_enabled(C, last_op->type->name); +} /* ********************** */ @@ -386,7 +392,7 @@ void ED_OT_undo_redo(wmOperatorType *ot) /* api callbacks */ ot->exec = ed_undo_redo_exec; - ot->poll = ED_operator_screenactive; + ot->poll = ed_undo_redo_poll; } /* ui callbacks should call this rather than calling WM_operator_repeat() themselves */ |