Bugfix #25652
[blender.git] / source / blender / windowmanager / intern / wm_operators.c
index 0aaa308814269a4c62878c76ac3145de0190f4e5..5aa2f6c1c5060203e796888e9b11aaf5d0d5ab09 100644 (file)
@@ -981,25 +981,21 @@ static uiBlock *wm_operator_create_ui(bContext *C, ARegion *ar, void *userData)
        return block;
 }
 
+/* operator menu needs undo, for redo callback */
 int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
-       int retval= OPERATOR_CANCELLED;
        
        if((op->type->flag & OPTYPE_REGISTER)==0) {
                BKE_reportf(op->reports, RPT_ERROR, "Operator '%s' does not have register enabled, incorrect invoke function.", op->type->idname);
                return OPERATOR_CANCELLED;
        }
        
-       if(op->type->exec) {
-               retval= op->type->exec(C, op);
+       ED_undo_push_op(C, op);
+       wm_operator_register(C, op);
 
-               /* ED_undo_push_op(C, op), called by wm_operator_finished now. */
-       }
-
-       if(retval != OPERATOR_CANCELLED)
-               uiPupBlock(C, wm_block_create_redo, op);
+       uiPupBlock(C, wm_block_create_redo, op);
 
-       return retval;
+       return OPERATOR_RUNNING_MODAL;
 }
 
 int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int height)