1 |
ulm 09/03/28 18:25:12 |
2 |
|
3 |
Added: libcanberra-0.11-dont-crash-without-display.patch |
4 |
Log: |
5 |
Add patch from upstream, fixes bug 259891. Remove old. |
6 |
(Portage version: 2.2_rc27/cvs/Linux i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 media-libs/libcanberra/files/libcanberra-0.11-dont-crash-without-display.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/libcanberra/files/libcanberra-0.11-dont-crash-without-display.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/libcanberra/files/libcanberra-0.11-dont-crash-without-display.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: libcanberra-0.11-dont-crash-without-display.patch |
15 |
=================================================================== |
16 |
From: Lennart Poettering <lennart@××××××××××.net> |
17 |
Date: Mon, 23 Mar 2009 20:55:36 +0000 (+0100) |
18 |
Subject: don't crash if there is no default display on initialization. Fixes #20693 |
19 |
X-Git-Url: http://git.0pointer.de/?p=libcanberra.git;a=commitdiff_plain;h=ac5ac9e486aa33f7be0cd9ddd315c03780676795 |
20 |
|
21 |
don't crash if there is no default display on initialization. Fixes #20693 |
22 |
--- |
23 |
|
24 |
diff --git a/src/canberra-gtk-module.c b/src/canberra-gtk-module.c |
25 |
index b9d8ae0..302eeb4 100644 |
26 |
--- a/src/canberra-gtk-module.c |
27 |
+++ b/src/canberra-gtk-module.c |
28 |
@@ -647,11 +647,15 @@ static gboolean idle_cb(void *userdata) { |
29 |
return FALSE; |
30 |
} |
31 |
|
32 |
+static void connect_settings(void); |
33 |
+ |
34 |
static gboolean emission_hook_cb(GSignalInvocationHint *hint, guint n_param_values, const GValue *param_values, gpointer data) { |
35 |
static SoundEventData *d = NULL; |
36 |
GdkEvent *e; |
37 |
GObject *object; |
38 |
|
39 |
+ connect_settings(); |
40 |
+ |
41 |
if (disabled) |
42 |
return TRUE; |
43 |
|
44 |
@@ -719,15 +723,15 @@ static void enable_input_feedback_sounds_changed(GtkSettings *s, GParamSpec *arg |
45 |
read_enable_input_feedback_sounds(s); |
46 |
} |
47 |
|
48 |
-G_MODULE_EXPORT void gtk_module_init(gint *argc, gchar ***argv[]) { |
49 |
+static void connect_settings(void) { |
50 |
GtkSettings *s; |
51 |
+ static gboolean connected = FALSE; |
52 |
|
53 |
- /* This is the same quark libgnomeui uses! */ |
54 |
- disable_sound_quark = g_quark_from_string("gnome_disable_sound_events"); |
55 |
- was_hidden_quark = g_quark_from_string("canberra_was_hidden"); |
56 |
+ if (connected) |
57 |
+ return; |
58 |
|
59 |
- /* Hook up the gtk setting */ |
60 |
- s = gtk_settings_get_default(); |
61 |
+ if (!(s = gtk_settings_get_default())) |
62 |
+ return; |
63 |
|
64 |
if (g_object_class_find_property(G_OBJECT_GET_CLASS(s), "gtk-enable-input-feedback-sounds")) { |
65 |
g_signal_connect(G_OBJECT(s), "notify::gtk-enable-input-feedback-sounds", G_CALLBACK(enable_input_feedback_sounds_changed), NULL); |
66 |
@@ -735,6 +739,18 @@ G_MODULE_EXPORT void gtk_module_init(gint *argc, gchar ***argv[]) { |
67 |
} else |
68 |
g_debug("This Gtk+ version doesn't have the GtkSettings::gtk-enable-input-feedback-sounds property."); |
69 |
|
70 |
+ connected = TRUE; |
71 |
+} |
72 |
+ |
73 |
+G_MODULE_EXPORT void gtk_module_init(gint *argc, gchar ***argv[]) { |
74 |
+ |
75 |
+ /* This is the same quark libgnomeui uses! */ |
76 |
+ disable_sound_quark = g_quark_from_string("gnome_disable_sound_events"); |
77 |
+ was_hidden_quark = g_quark_from_string("canberra_was_hidden"); |
78 |
+ |
79 |
+ /* Hook up the gtk setting */ |
80 |
+ connect_settings(); |
81 |
+ |
82 |
install_hook(GTK_TYPE_WINDOW, "show", &signal_id_widget_show); |
83 |
install_hook(GTK_TYPE_WINDOW, "hide", &signal_id_widget_hide); |
84 |
install_hook(GTK_TYPE_DIALOG, "response", &signal_id_dialog_response); |
85 |
@@ -749,7 +765,6 @@ G_MODULE_EXPORT void gtk_module_init(gint *argc, gchar ***argv[]) { |
86 |
install_hook(GTK_TYPE_ICON_VIEW, "selection-changed", &signal_id_icon_view_selection_changed); |
87 |
} |
88 |
|
89 |
- |
90 |
G_MODULE_EXPORT gchar* g_module_check_init(GModule *module); |
91 |
|
92 |
G_MODULE_EXPORT gchar* g_module_check_init(GModule *module) { |