Bug 32839 - gtk_quit_add removed in GTK+ 3.0
Summary: gtk_quit_add removed in GTK+ 3.0
Status: NEW
Alias: None
Product: libcanberra
Classification: Unclassified
Component: Unspecified (show other bugs)
Version: unspecified
Hardware: Other All
: medium blocker
Assignee: Lennart Poettering
QA Contact:
URL: https://bugzilla.gnome.org/show_bug.c...
Depends on:
Reported: 2011-01-04 20:50 UTC by Craig Keogh
Modified: 2011-08-18 11:14 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:

Patch (441 bytes, patch)
2011-01-05 04:56 UTC, Vibha Yadav
Details | Splinter Review
Patch that uses g_atexit instead (794 bytes, patch)
2011-01-17 08:56 UTC, Rodrigo Moya
Details | Splinter Review

Description Craig Keogh 2011-01-04 20:50:04 UTC
gtk_quit_add removed in GTK+ 3.0 as per this GTK+ commit:

libcanberra 0.26 uses it here:

src/canberra-gtk-module.c:967:        gtk_quit_add(1, quit_handler, NULL);

Interestingly libcanberra 0.26 compiles fine, but when attempt to run gnome-session:

gnome-session: symbol lookup error: /opt/gnome/lib64/gtk-3.0/modules/libcanberra-gtk-module.so: undefined symbol: gtk_quit_add

Setting as blocker as prevents gnome-session running and subsequently blocks testing of GNOME 3.0. Adjust if I'm misinformed.
Comment 1 Vibha Yadav 2011-01-05 04:56:56 UTC
Created attachment 41663 [details] [review]

This is affecting Evolution - mail client too. 

It is not able to come up and throws warning as,

/home/gtk3-branch/opt/gnome/bin/evolution: symbol lookup error: /home/gtk3-branch/opt/gnome/lib/gtk-3.0/modules/libcanberra-gtk-module.so: undefined symbol: gtk_quit_add

Program exited with code 0177.

I have removed the gtk_quit_add api call and then it seems evolution is working fine.
Comment 2 Craig Keogh 2011-01-11 14:30:32 UTC
GNOME 3.0 via JHBuild patches libcanberra as follows:
Patch by Matthias Clasen.
Comment 3 Lennart Poettering 2011-01-13 10:11:23 UTC
Nah, that patch is not acceptable. We must be able to flush the sound event queue before we go down. If gtk_quit_add() got removed some replacement in glib or gtk must be used. As long as that doesn't exist this bug cannot be fixed properly and I will not merge this patch.
Comment 4 Rodrigo Moya 2011-01-17 08:56:26 UTC
Created attachment 42123 [details] [review]
Patch that uses g_atexit instead
Comment 5 Lennart Poettering 2011-01-17 09:48:03 UTC
Unfortunately atexit() isn't really suitable either since it is not clear from which thread context and in which order it is called. While atexit() will work for this in the trivial cases, it won't in the general cases, since the code we execute during this shutdown routine is relying on some other libraries which must be initialized still but which is not guaranteed by atexit().

This shutdown code must be called from GLib/Gtk context in some way. And unless some gtk_quit_add()-like feature is readded into Glib or Gtk this cannot be fixed properly.

GCC destructors/C++ static destructors are equally unusable for this.
Comment 6 Lennart Poettering 2011-01-17 10:02:47 UTC
I have now filed a bug against gtk3 about this:

Comment 7 Lennart Poettering 2011-02-24 15:49:28 UTC
BTW lc .27 disable the gtk_quit_add(9 for now, but this does not actually fix the problem and event sounds will be eaten unless gtk3 is fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.