[Bf-blender-cvs] [5b2b5a42581] master: Fix ED_OT_undo_redo operator
Aleksandr Zinovev
noreply at git.blender.org
Sat Jul 1 09:53:12 CEST 2017
Commit: 5b2b5a425810e1e9aa185a0e93d99a8c127df023
Author: Aleksandr Zinovev
Date: Sat Jul 1 10:50:29 2017 +0300
Branches: master
https://developer.blender.org/rB5b2b5a425810e1e9aa185a0e93d99a8c127df023
Fix ED_OT_undo_redo operator
===================================================================
M source/blender/editors/util/undo.c
===================================================================
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 4e021d4833e..419c15bf83f 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -334,6 +334,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);
+}
/* ********************** */
@@ -385,7 +391,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 */
More information about the Bf-blender-cvs
mailing list