After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640042 - GtkApplication's warning about not connecting to the activate signal is annoying
GtkApplication's warning about not connecting to the activate signal is annoying
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-01-20 08:12 UTC by Murray Cumming
Modified: 2011-03-04 14:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-GApplication-Check-more-before-warning-about-a-missi.patch (1.93 KB, patch)
2011-02-28 10:19 UTC, Murray Cumming
committed Details | Review

Description Murray Cumming 2011-01-20 08:12:02 UTC
GtkApplication warns at runtime if you don't connect a signal to the GtkApplication::activate signal. That's the ideal way to do things, but it's not strictly necessary. It's annoying for people to have to connect an empty signal handler just to get rid of that warning.

This warning will also be seen often by people who override the default signal handler (set the vfunc) instead of connecting a signal handler, which is legitimate, and easily done in gtkmm by overriding a virtual method. That's because those people commonly call the base class implementation's default signal handler from their own handler - which I think you call "chaining up".
Comment 1 Matthias Clasen 2011-01-21 04:42:05 UTC
The warning lives in g_application_real_activate
Comment 2 Allison Karlitskaya (desrt) 2011-01-21 15:41:35 UTC
The _real function can verify that it is the function in the vtable before issuing the warning (ie: ensure that it wasn't called just because of a chainup).  We should probably do that.

Would this be sufficient?  Is there a use case where it is even a little bit reasonable to neither override nor connect to the activate signal?  How do you know when a remote activation occurs?
Comment 3 Matthias Clasen 2011-01-21 15:59:48 UTC
I've made it so
Comment 4 Murray Cumming 2011-01-22 20:50:27 UTC
Well maybe I misunderstand what "remote activation is" - I thought it was to do with single instance apps. The documentation assumes that you already know what it's talking about.

I guess that I'm allowed to not care about "remote activation", and that that is valid.
Comment 5 Murray Cumming 2011-02-28 10:19:33 UTC
Created attachment 182076 [details] [review]
0001-GApplication-Check-more-before-warning-about-a-missi.patch

Permission to add the same check for g_application_real_command_line() with this patch?
Comment 6 Murray Cumming 2011-03-04 14:17:07 UTC
Matthias OKed the patch on irc.