diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs
index a107c0b52..7330464dc 100644
--- a/generator/InterfaceGen.cs
+++ b/generator/InterfaceGen.cs
@@ -272,10 +272,10 @@ namespace GtkSharp.Generation {
void GenerateImplementorIface (GenerationInfo gen_info)
{
- StreamWriter sw = gen_info.Writer;
if (IsConsumeOnly)
return;
+ StreamWriter sw = gen_info.Writer;
sw.WriteLine ();
sw.WriteLine ("\t[GLib.GInterface (typeof (" + Name + "Adapter))]");
string access = IsInternal ? "internal" : "public";
diff --git a/generator/InterfaceVM.cs b/generator/InterfaceVM.cs
index 205baab39..cfa9b1476 100644
--- a/generator/InterfaceVM.cs
+++ b/generator/InterfaceVM.cs
@@ -87,7 +87,7 @@ namespace GtkSharp.Generation {
public override bool Validate ()
{
- if (target == null) {
+ if (target == null && !(container_type as InterfaceGen).IsConsumeOnly) {
Console.WriteLine ("Virtual method {0}->{1} has no matching target to invoke", container_type.CName, CName);
return false;
}
diff --git a/generator/ObjectBase.cs b/generator/ObjectBase.cs
index 30d1e94c9..16ee88e56 100644
--- a/generator/ObjectBase.cs
+++ b/generator/ObjectBase.cs
@@ -124,9 +124,10 @@ namespace GtkSharp.Generation {
VirtualMethod vm;
if (is_signal_vm)
vm = new DefaultSignalHandler (vm_elem, this);
- else if (is_interface)
- vm = new InterfaceVM (vm_elem, methods [vm_elem.GetAttribute ("name")] as Method, this);
- else
+ else if (is_interface) {
+ string target_name = vm_elem.HasAttribute ("target_method") ? vm_elem.GetAttribute ("target_method") : vm_elem.GetAttribute ("name");
+ vm = new InterfaceVM (vm_elem, methods [target_name] as Method, this);
+ } else
vm = new GObjectVM (vm_elem, this);
if (vm_elem.GetAttribute ("padding") == "true" || vm_elem.GetAttribute ("hidden") == "1")
diff --git a/gio/Gio.metadata b/gio/Gio.metadata
index 22a84fd65..46703489d 100644
--- a/gio/Gio.metadata
+++ b/gio/Gio.metadata
@@ -15,8 +15,10 @@
GetSupportsFiles
GetSupportsUris
1
+ 1
GetParsedName
1
+ 1
1
GetCanUnmount
GetCanSeek