Delivering the killing blow to libgnome

Getting rid of the libgnome[ui] dependency and of all the legacy stuff that it brings in has been a work in progress for many gnome applications. While replacing some old cruft has been very easy as soon as a proper replacement was put into GTK+ itself, there are a bunch of things for which figuring out what to do is not so clear… Now that we are at the start of the 2.22 cycle I’d like to get some feedback on the status of these things.

As you can probably guess I’ll take gedit as a case, but I think it is pretty much the same for many other applications. In order of importance, libgnome is still needed for:

  1. Bug-Buddy integration: gnome-program offers integration with our automated bug reporting infrastructure. This is something we cannot do without. I seem to understand that there has been work to make bug-buddy work as a gtk module or something, but it is absolutely not clear to me what is the current status. Is it already in gnome 2.20? How does it work? Do apps need to do something? Can I just drop gnome-program and things will work?
  2. gnome_authentication_manager_init() is another thing that we cannot absolutely avoid, otherwise remote file access will not work. I guess gio/GVFS comes into the picture here, but once again an executive summary on what to do for applications developers would be nice.
  3. gnome_accelerators_sync(): this may look pretty trivial (and in fact the function itself is pretty simple and easily reimplementable with gtk calls, however it is not clear to me what kind of magic gnome-program does on initialization to restore the edited shortcuts. Any suggestion is welcome.
  4. Displaying the Online Help: as far as I know gnome_help_display() is just a function that spawns yelp with the proper arguments, however it’s a bit silly to manually reimplement that in every app… what are the plans of Yelp/Rarian developers in this area?
  5. gnome_icon_lookup() is used to lookup an icon for a given file/mime type. Once again this fairly easily cut&pasted locally however I think we really need to put it somewhere our library stack: it is a common operation for many apps. GTK+ itself reimplements it internally for the file chooser and the recent manager, though unfortunately for some files it gives different results (as far as I recall libgnome does some special casing for some files).
  6. gnome-session: I know there is a new implementation of session saving in libegg, but it is not clear if it is still developed and targeted at gtk inclusion.

Unless I am missing some other magic feature that gnome-program provides, that is everything that libgnome[ui] is needed for (I am intentionally leaving out migration from gnome-print to gtk print stuff and from gnome-vfs to gvfs, since they are separate issues).

Will we manage to put the nails in libgnome’s coffin for 2.22?

15 Responses to “Delivering the killing blow to libgnome”

  1. jhs Says:

    Yes, you miss something: BonoboDockItem

    It’s deprecated but it’s the only supported way to create multiple, dockable toolbars!

  2. ovitters Says:

    Bug-Buddy: It uses a GTK module now. It requires some environment variable to be set (gnome-session does this on login). This means if your app runs under GNOME, it works, but not otherwise. However, suddenly all GTK+ apps now have bug-buddy support (it’ll save the backtrace to a file).
    Note that Bug-Buddy 2.20 has some weirdness compared to the previous version (it wants debug symbols). The non-debug symbols part is not really done (we need to install a Socorro server + make bug-buddy submit to it). Further, Breakpad doesn’t support minidumps on x86_64 yet.

  3. Jani Monoses Says:

    gnome_help_display() has already been replaced by code from libgnome in a handful of apps during 2.20 and before.
    Same for gnome_url_show().

    the gnome-games module uses libgnome extensively and has examples for almost all APIs that would need to be replaced.
    file-roller has a few as well.

  4. Dan Winship Says:

    > gnome-session: I know there is a new implementation
    > of session saving in libegg, but it is not clear if it is still
    > developed and targeted at gtk inclusion.

    It’s not being actively developed, but it’s basically done. It just needs people to port to it now to make sure there are no subtle bugs (and for the gedit case, there’s already a patch in libegg/libegg/smclient/gedit.diff, as an example of how to use it.)

    (Also, EggSMClient also introduces a replacement for GnomeDesktopItem, which is also its own bug 415070, which needs to be finished up.)

    The real thing blocking EggSMClient from inclusion right now is that there are a handful of people who are strongly opposed to having session saving in GNOME, and I have no interest in arguing about it any more. I suppose an easy fix for that problem would be to just remove the session saving support from EggSMClient, but there needs to be a consensus among app authors that that’s the right thing to do, because if the app authors still want session saving and we introduce a GtkSMClient that doesn’t support it, then people will just keep using GnomeClient. (See also: GtkStatusIcon vs EggTrayIcon.)

  5. Oded Says:

    As far as edited shortcuts reloading works, in gedit for gnome 2.20 it doesn’t. When one edits shortcuts and then closes and reopens gedit – all edited shortcuts are reverted (i’m on ubuntu 7.10)

  6. alexl Says:

    I haven’t figured out the gnome_icon_lookup story fully, but its gio will to a large degree replace it. You can get the “icon” attribute for files.

  7. pbor Says:

    @jhs: well, the average gnome app has no dockable toolbars… I am sure there are other things still missing, but I was just concerned with the ones that affect 90% of our applications

    @olav: awesome! Maybe it was just me not paying enough attention…

    @Jani: yes, I know many apps replaced gnome_help_display(), and I still think that cut&paste is a suboptimal solution

    @Dan: great! I didn’t know about that patch… If the code is there I think that session saving should stay: if someone doesn’t want to save he can just ignore the signal.

    @Oded: works for me here on ubuntu 7.10 and it works for everyone I asked… if it really doesn’t work for you then file a bug

    @alex: sounds good!

  8. Mikael Hermansson Says:

    how the status replace libglade with gtkbuilder API in gedit?

  9. pbor Says:

    @Mikael: there is a patch in bugzilla (though it needs some updating). We decided it was a bit too late for 2.20 but it will definately go in 2.22, especially if tools to edit GtkBuilder files show up

  10. Marko Anastasov Says:

    There is also gnome_thumbnail_factory_*. Which module would that belong to?

  11. Don Scorgie Says:

    Regarding the help stuff:
    We are working on a replacement as I speak. The idea will be to have either a dbus signal:
    and org.gnome.open_help_page ()
    or similar

    as well as command-line access, for those who don’t like dbus:
    yelp ghelp:gedit
    (which you can do at the moment, but is slightly messy for various reasons)

    I’ve also considered a small library to link against, but it seems like overkill since there will only be 1-2 functions in it.

    Hopefully, we’ll have a solution in place early this release cycle so everyone can start the migration.

    Hope this helps
    You’re friendly yelp hacker.

  12. ken Says:

    I’ve written a few (unofficial) GNOME apps, and I still don’t know what “sessions” are, or what they’re good for.

    All I know is that they’re an extra boolean question you get asked whenever you log out from GNOME, and if you answer wrong you get 5 xchats next time you log in.

    So I agree that “sessions” shouldn’t be in GNOME … they probably shouldn’t exist at all. Die, sessions, die!

  13. Dennis Says:

    You missed gnome_entry_new(). Gtk+ does not offer a widget with auto-saved history.

  14. Emmanuele Bassi Says:

    @Marko: either gtk+ or gio/gvfs. the problematic bit is the fact that the thumbnailers (the actual programs creating the thumbnails) are stored inside gconf; hence, we need a migration path for that as well.

  15. pbor Says:

    @Don: yes, d-bus sounds like a good solution… especially if pressing the help button in different dialogs makes yelp switch page instead of spawning new instances

    @ken: I do not agree, session saving is useful IMHO… the problem you see are due to bad implementation, which is in turn due to 1) sloppy application programmers and 2) bad and undocumented session saving API

    @Dennis: gedit uses it’s own gedit-history-entry implementation (since gnome_entry_new didn’t use GtkComboBox), feel free to steal it :)