Handler of GtkEditable::insert-text signal is not run
Here's a test program that reproduces the problem:
imports.gi.versions.Gtk = '3.0';
const {Gtk} = imports.gi;
Gtk.init(null);
const w = new Gtk.Window();
const entry = new Gtk.Entry();
w.add(entry);
w.connect('destroy', () => Gtk.main_quit());
entry.connect_after('insert-text', (instance, new_text, len, pos) => {
print(`insert-text handler: |${new_text}|, ${len} char(s) at ${pos}`);
});
w.show_all();
Gtk.main();
Run the program and type anything in the box:
$ GJS_DEBUG_TOPICS='JS G CLSR' gjs bug.js
** (gjs:65): CRITICAL **: 21:10:19.997: g_object_info_get_n_signals: assertion 'GI_IS_OBJECT_INFO (info)' failed
JS G CLSR: Unable to convert arg 3 in order to invoke closure
(gjs:65): Gjs-WARNING **: 21:10:19.997: JS ERROR: Error: Unknown signal.
@bug.js:15:1
Argument 3 of GtkEditable::insert-text
has the following annotation:
* @position: (inout) (type int): the position, in characters,
* at which to insert the new text. this is an in-out
* parameter. After the signal emission is finished, it
* should point after the newly inserted text.
It seems we are ignoring the (type int)
annotation, and giving up on marshalling that argument because it's a bare pointer.
Edited by Philip Chimento