Quick and dirty hack to make class closures use the same marshalers as
signal handlers.

No header prototype for gperl_signal_set_marshaller_for(), so there's
a compiler warning.


Index: GSignal.xs
===================================================================
RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GSignal.xs,v
retrieving revision 1.31
diff -p -u -r1.31 GSignal.xs
--- GSignal.xs	7 Jan 2008 18:50:06 -0000	1.31
+++ GSignal.xs	9 Jan 2008 07:54:25 -0000
@@ -249,6 +249,31 @@ gperl_signal_set_marshaller_for (GType i
 	G_UNLOCK (marshallers);
 }
 
+GClosure *
+gperl_signal_create_closure_for (GType instance_type,
+                                 const char * detailed_signal,
+				 SV * callback,
+				 SV * data,
+				 GConnectFlags flags)
+{
+	GClosureMarshal marshaller = NULL;
+
+	G_LOCK (marshallers);
+	if (marshallers) {
+		MarshallerData * data = (MarshallerData*)
+			g_hash_table_lookup (marshallers, detailed_signal);
+		if (data) {
+			if (g_type_is_a (instance_type, data->instance_type))
+				marshaller = data->marshaller;
+		}
+	}
+	G_UNLOCK (marshallers);
+
+	return gperl_closure_new_with_marshaller (callback, data,
+						  flags & G_CONNECT_SWAPPED,
+						  marshaller);
+}
+
 =item gulong gperl_signal_connect (SV * instance, char * detailed_signal, SV * callback, SV * data, GConnectFlags flags)
 
 The actual workhorse behind GObject::signal_connect, the binding for
@@ -269,27 +294,13 @@ gperl_signal_connect (SV * instance,
 {
 	GObject * object;
 	GPerlClosure * closure;
-	GClosureMarshal marshaller = NULL;
 
 	object = gperl_get_object (instance);
 
-	G_LOCK (marshallers);
-	if (marshallers) {
-		MarshallerData * data = (MarshallerData*)
-			g_hash_table_lookup (marshallers, detailed_signal);
-		if (data) {
-			if (g_type_is_a (G_OBJECT_TYPE (object),
-			                 data->instance_type))
-				marshaller = data->marshaller;
-		}
-	}
-	G_UNLOCK (marshallers);
-
 	closure = (GPerlClosure *)
-			gperl_closure_new_with_marshaller
-			                     (callback, data,
-			                      flags & G_CONNECT_SWAPPED,
-			                      marshaller);
+		gperl_signal_create_closure_for (G_OBJECT_TYPE (object),
+						 detailed_signal,
+						 callback, data, flags);
 
 	/* after is true only if we're called as signal_connect_after */
 	closure->id =
@@ -301,7 +312,7 @@ gperl_signal_connect (SV * instance,
 	if (closure->id > 0)
 		remember_closure (closure);
 	
-	return ((GPerlClosure*)closure)->id;
+	return closure->id;
 }
 
 /*
Index: GType.xs
===================================================================
RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GType.xs,v
retrieving revision 1.84
diff -p -u -r1.84 GType.xs
--- GType.xs	9 Jan 2008 06:10:34 -0000	1.84
+++ GType.xs	9 Jan 2008 07:54:26 -0000
@@ -1218,7 +1218,10 @@ add_signals (GType instance_type, HV * s
 			if (!signal_id)
 				croak ("can't override class closure for "
 				       "unknown signal %s", signal_name);
-			closure = gperl_closure_new (value, NULL, FALSE);
+//			closure = gperl_closure_new (value, NULL, FALSE);
+			closure = gperl_signal_create_closure_for
+						(instance_type, signal_name,
+						 value, NULL, 0);
 			g_signal_override_class_closure (signal_id,
 			                                 instance_type,
 			                                 closure);
