From 31d5fcd2a7271568b1f70713267185c4601c7f41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 May 2018 11:33:24 +0200 Subject: UI: run redo poll check in operators context --- source/blender/editors/space_topbar/space_topbar.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_topbar/space_topbar.c b/source/blender/editors/space_topbar/space_topbar.c index 4c40353618b..8cf27d86cfe 100644 --- a/source/blender/editors/space_topbar/space_topbar.c +++ b/source/blender/editors/space_topbar/space_topbar.c @@ -45,6 +45,7 @@ #include "ED_screen.h" #include "ED_space_api.h" +#include "ED_undo.h" #include "UI_interface.h" #include "UI_resources.h" @@ -297,8 +298,14 @@ static int topbar_panel_operator_redo_poll(const bContext *C, PanelType *UNUSED( return false; } - return (WM_operator_poll((bContext *)C, op->type) && - WM_operator_check_ui_empty(op->type) == false); + bool success = false; + if (!WM_operator_check_ui_empty(op->type)) { + const OperatorRepeatContextHandle *context_info; + context_info = ED_operator_repeat_prepare_context((bContext *)C, op); + success = WM_operator_poll((bContext *)C, op->type); + ED_operator_repeat_reset_context((bContext *)C, context_info); + } + return success; } static void topbar_panel_operator_redo(const bContext *C, Panel *pa) -- cgit v1.2.3