GNOME Bugzilla – Bug 579838
url opened twice in the gtk about dialogs
Last modified: 2009-04-22 16:17:24 UTC
The bug has been described on https://bugs.launchpad.net/bugs/334378 The clickable URL in about dialogs are opening 2 webbrowser when used in most of GNOME softwares (gedit, totem, etc) The reason is that gtk seems to install a default handler when gtk_about_dialog_set_url_hook() is used and those applications also set a callback calling gtk_show_uri(), the behaviour changed in the GNOME 2.26 cycle since that used to work correctly before gtk-demo which uses gtk_about_dialog_set_url_hook() but only does a print in the callback dialog get one dialog opened only, not sure if that's the expected behaviour either since the callback doesn't call gtk_show_uri() there
Ah, this problem is with the website button. GtkAboutDialog uses a link button for this, but still connects to clicked and handles it itself. So this was a latent bug that just came to the light because we now have a default hook for link buttons. Easy fix is just to drop the clicked handler in GtkAboutDialog.
Created attachment 133122 [details] [review] drop obsolete click handler (activate_url) in gtkaboutdialog Dropping the clicked handler (activate_url) in GtkAboutDialog as suggested. I tested with gedit that it fixed the "double open" issue, let me know if it needs more love.
Fixe pushed to gtk-2-16. Will merge to master in a bit.
Won't this render gtk_about_dialog_set_url_hook() useless? It seems like to cover all bases that function should be deprecated, and maybe have a function that returns the GtkLinkButton so you can set your own link handler for that.
the url hook is also used for links in the text in the secondary dialog, so not entirely useless. But certainly, I'd expect most apps should be fine with the default handlers.