GNOME Bugzilla – Bug 645978
Should use g-i annotations for signal
Last modified: 2018-01-27 11:46:51 UTC
I tried to use a C signal having a GList of GObject as one of his argument and failed. I've been told that's because gjs doesn't use g-i annotations for signals; it should.
*** Bug 657328 has been marked as a duplicate of this bug. ***
Created attachment 194798 [details] [review] Use GISignalInfo to marshal signal arguments Fixes bug #645978
This patch fails for "notify" signal because it's not found on the GIObjectInfo here... Any idea why?
For gjs_g_value_to_g_argument() had the idea of something like GValue *gval = ...; GArgument arg; g_memmove(&arg, &gval->data[0], sizeof(GArgument)); That would in theory cover all types magically, but seems big hack to me...
Or even just GArgument *arg = (GArgument*) gvalue->data; but it's playing with the ABI, dunno if we want that to avoid going through all known GType :)
Created attachment 194845 [details] [review] object.c: Use GISignalInfo to marshal signal arguments Keeps the GValue-based marshaller as fallback because GI info does not exists for GObject::notify signal (bug #657446).
Created attachment 195185 [details] [review] object.c: Use GISignalInfo to marshal signal arguments
This 2nd patch reuse the code for callbacks in function.c with libffi candy. But unit tests fails because of leaks and gnome-shell crash... I don't understand why and I probably won't have much time to investigate.
Created attachment 195186 [details] [review] GICallableInfo: Special case for signals g_callable_info_prepare_closure() should add an extra arg for self object if callable is a signal.
(In reply to comment #3) > This patch fails for "notify" signal because it's not found on the GIObjectInfo > here... Any idea why? This is now fixed: commit c3da3d46ffa9c3b53e7f7132eaa9c9c722ebc859 Author: Colin Walters <walters@verbum.org> Date: Fri Sep 9 18:07:19 2011 -0400 scanner: Add "notify" signal to GObject For gjs we want to switch to using introspection data for signals, and the "notify" signal being missing from GObject was a problem.
Do we need introspection data for a GList of GObject? Now that we have custom classes, we can't be guaranteed introspection data for every object. I've been hacking on this today, and boy is it more complicated now. WIP patch stack in: http://github.com/magcius/gobject-introspection http://github.com/magcius/gjs GDBus tests requires bug #673803
gobject-introspection patches filed as bug #673804 and bug #673805
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gjs/issues/57.