GNOME Bugzilla – Bug 783578
Introspection problem, an opaque object.
Last modified: 2019-03-20 10:37:46 UTC
Not way to access to the profiles for gjs, this work on python very well with the Mint fork, but not with gjs: Gjs-WARNING **: JS ERROR: Error: Can't create a Javascript object for MixerCardProfile; no way to copy This appear to be an opaque object.
I don't know what you're trying to do, or how you're trying to integrate this. My guess is that you're doing it wrongly as the API is already successfully used in gnome-shell and a number of extensions.
What I'm doing is not directly relate with the shell but is related with the gnome-setting instead. So, I'm doing another complete different thing, not present or used by gnome shell currently. The gnome shell developers don't need to access to an instance of the MixerCardProfile object, because they used gnome-settings to configure the audio, and that's then not matter form him, at less for now. I'm porting the Cinnamon settings from Python+Gtk to Gjs+Gtk. Mint migrate the audio control of the gnome-settings to python from the c original code (https://github.com/linuxmint/Cinnamon/commit/9fabe6df5a6cba68acae2c0abfa7dcc3b94aabb0) and they create a fork of libgnome-volume-control (https://lazka.github.io/pgi-docs/Cvc-1.0/index.html) as a share library, to be possible use the library outside the shell-muffin (mutter) process. What I'm doing is porting again the code, but now from python to gjs as i'm porting cinnamon to be running inside gnome shell, that include the cinnamon settings and i will not used of course the Mint fork (as i'm on gnome), but also the Mint fork have this problem, so not way. This issue about opaque objects with the gjs introspection is know by gnome shell developers. You can find some relate issues with other libraries. The error come from here: https://github.com/GNOME/gjs/blob/master/gi/boxed.cpp#L1235-L1246 The issues is because to export the object, the object need to be represented in a way that can be copy by gjs to then be shared. In most commond escenarios this is associate with an struct https://github.com/GNOME/libgnome-volume-control/blob/master/gvc-mixer-card.h#L52 I'm also read your comments when Giovanni port the library as a separate module of the shell. So, i understand that probably, this is a thing with a low priority to you. I don't know how can i provide more information, but you can tell me, what is needed. Thanks.
(In reply to Lester Carballo from comment #2) > What I'm doing is not directly relate with the shell but is related with the > gnome-setting instead. So, I'm doing another complete different thing, not > present or used by gnome shell currently. The gnome shell developers don't > need to access to an instance of the MixerCardProfile object, because they > used gnome-settings to configure the audio, and that's then not matter form > him, at less for now. We don't use "gnome-settings" to configure audio. We don't use gnome-settings-daemon for that either. <snip> It would be easier if you provided a minimal test program, though a patch would be better. You probably just need to make it a boxed type, and add the necessary annotations.
Thanks for trust, but a patch is too much for me... This type of issue could be resolved changing the interface of the struct to let copy the object and this will impact inside three big areas of gnome. I do not have the knowledge to know that I will break.
Created attachment 353577 [details] An extension to visualized the instrospection issue The libgnome-volume-control is used as a submodule of gnome-shell, so this is a gnome shell extension that try to access to the MixerCardProfile of a device. Just enable the extension as a normal shell extension and see the output (journalctl -f) of gnome shell, when we request the profiles from the device.
Just to reference this bug from where is detecting in the gjs side: https://gitlab.gnome.org/GNOME/gjs/issues/109 Also please, see the Giovanni Campagna recommendation in this thread, about a possible solution to this problematic from inside this library: https://gitlab.gnome.org/GNOME/gjs/issues/109#note_47332
-- 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/libgnome-volume-control/issues/5.