GNOME Bugzilla – Bug 729263
GtkBuilder should provide an easy way to disconnect signals connected with connect_signals
Last modified: 2018-04-15 00:31:40 UTC
Right now it seems that the only way to disconnect the handlers associated to these signals is to use connect_signals_full and store the handler id at the application level. This is extremely fragile and code that I'd better not have in my application, would be great to have a nice upstream solution for that.
There's no need to disconnect signal handlers, if they remain connected for the entire lifetime of the object. The signal handler will be cleaned up when the object is disposed. That is really the situation that GtkBuilder's signal support is meant for. If you have signals that need to be dynamically disconnected and connected at runtime, you should do it from code.
Hi Mathias ! I'm not sure I agree with you there: if signals were meant to be connected for the whole lifetime of the builder, then why doesn't it take the object as a construct_only parameter ? As the API offers a way to connect to signals at any time, I would find it convenient to offer a way to disconnect from them at any time too. Reclassifying as enhancement though :)
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new