[Bf-blender-cvs] [31d5fcd2a72] blender2.8: UI: run redo poll check in operators context

Campbell Barton noreply at git.blender.org
Wed May 2 11:35:40 CEST 2018


Commit: 31d5fcd2a7271568b1f70713267185c4601c7f41
Author: Campbell Barton
Date:   Wed May 2 11:33:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB31d5fcd2a7271568b1f70713267185c4601c7f41

UI: run redo poll check in operators context

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

M	source/blender/editors/space_topbar/space_topbar.c

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

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)



More information about the Bf-blender-cvs mailing list