Codebase list empathy / 9167b7e
Pull in several bugfixes from upstream * d/patches/0001-Ignoring-non-installed-languages.patch + Added. Fix a crash when trying to spell-check using a dictionary that's no longer installed. (from upstream git) * d/patches/0002-empathy-protocol-chooser-don-t-cache-TpConnectionMan.patch + Added. Prevent TpConnectionManager from being cached as it can be freed under out feet. Fixes a crash while managing accounts (Closes: #551265) (from upstream git) * d/patches/0003-empathy-chat-window-Don-t-update-the-Contact-menu-if.patch, d/patches/0004-Fix-crash-when-joining-a-chat-GTK_WIDGET_VISIBLE-is-.patch: + Added. Fixes Empathy blocking when a notication is displayed while the contact menu is open (from upstream git) Sjoerd Simons 14 years ago
5 changed file(s) with 359 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 empathy (2.28.1-2) UNRELEASED; urgency=low
1
2 * d/patches/0001-Ignoring-non-installed-languages.patch
3 + Added. Fix a crash when trying to spell-check using a dictionary that's
4 no longer installed. (from upstream git)
5 * d/patches/0002-empathy-protocol-chooser-don-t-cache-TpConnectionMan.patch
6 + Added. Prevent TpConnectionManager from being cached as it can be freed
7 under out feet. Fixes a crash while managing accounts (Closes: #551265)
8 (from upstream git)
9 * d/patches/0003-empathy-chat-window-Don-t-update-the-Contact-menu-if.patch,
10 d/patches/0004-Fix-crash-when-joining-a-chat-GTK_WIDGET_VISIBLE-is-.patch:
11 + Added. Fixes Empathy blocking when a notication is displayed while the
12 contact menu is open (from upstream git)
13
14 -- Sjoerd Simons <sjoerd@debian.org> Sun, 25 Oct 2009 17:41:42 +0000
15
016 empathy (2.28.1-1) unstable; urgency=low
117
218 * New upstream release.
0 From 709a7b501e242d13719445e18567c9ffa247bc02 Mon Sep 17 00:00:00 2001
1 From: Felix Kaser <f.kaser@gmx.net>
2 Date: Tue, 20 Oct 2009 10:20:02 +0200
3 Subject: [PATCH 1/4] Ignoring non installed languages
4
5 Languages which are in the gconf setting but are not installed any more are ignored, fixes bug #598954
6 ---
7 libempathy-gtk/empathy-spell.c | 7 ++++++-
8 1 files changed, 6 insertions(+), 1 deletions(-)
9
10 diff --git a/libempathy-gtk/empathy-spell.c b/libempathy-gtk/empathy-spell.c
11 index 076e81a..3443fd9 100644
12 --- a/libempathy-gtk/empathy-spell.c
13 +++ b/libempathy-gtk/empathy-spell.c
14 @@ -219,7 +219,12 @@ spell_setup_languages (void)
15 lang->config = enchant_broker_init ();
16 lang->speller = enchant_broker_request_dict (lang->config, strv[i]);
17
18 - languages = g_list_append (languages, lang);
19 + if (lang->speller == NULL) {
20 + DEBUG ("language '%s' has no valid dict", strv[i]);
21 + } else {
22 + languages = g_list_append (languages, lang);
23 + }
24 +
25 i++;
26 }
27
0 From 5d4bbf0d205db82f4f6fdf0ede64a1510979f2e8 Mon Sep 17 00:00:00 2001
1 From: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2 Date: Fri, 23 Oct 2009 11:17:23 +0100
3 Subject: [PATCH 2/4] empathy-protocol-chooser: don't cache TpConnectionManagerProtocol in the store
4
5 TpConnectionManagerProtocol are not garanteed to stay valid so we
6 shouldn't cache them in the store. Instead, we cache the protocol name
7 and call tp_connection_manager_get_protocol each time we need it.
8 This should fix crashers as the ones reported in #599386.
9 ---
10 libempathy-gtk/empathy-protocol-chooser.c | 75 ++++++++++++++++++-----------
11 1 files changed, 47 insertions(+), 28 deletions(-)
12
13 diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
14 index 62fedaf..9c48917 100644
15 --- a/libempathy-gtk/empathy-protocol-chooser.c
16 +++ b/libempathy-gtk/empathy-protocol-chooser.c
17 @@ -76,7 +76,7 @@ enum
18 COL_ICON,
19 COL_LABEL,
20 COL_CM,
21 - COL_PROTOCOL,
22 + COL_PROTOCOL_NAME,
23 COL_IS_GTALK,
24 COL_COUNT
25 };
26 @@ -85,7 +85,7 @@ G_DEFINE_TYPE (EmpathyProtocolChooser, empathy_protocol_chooser,
27 GTK_TYPE_COMBO_BOX);
28
29 static gint
30 -protocol_chooser_sort_protocol_value (TpConnectionManagerProtocol *protocol)
31 +protocol_chooser_sort_protocol_value (const gchar *protocol_name)
32 {
33 guint i;
34 const gchar *names[] = {
35 @@ -97,7 +97,7 @@ protocol_chooser_sort_protocol_value (TpConnectionManagerProtocol *protocol)
36
37 for (i = 0 ; names[i]; i++)
38 {
39 - if (strcmp (protocol->name, names[i]) == 0)
40 + if (strcmp (protocol_name, names[i]) == 0)
41 return i;
42 }
43
44 @@ -110,22 +110,22 @@ protocol_chooser_sort_func (GtkTreeModel *model,
45 GtkTreeIter *iter_b,
46 gpointer user_data)
47 {
48 - TpConnectionManagerProtocol *protocol_a;
49 - TpConnectionManagerProtocol *protocol_b;
50 + gchar *protocol_a;
51 + gchar *protocol_b;
52 gint cmp = 0;
53
54 gtk_tree_model_get (model, iter_a,
55 - COL_PROTOCOL, &protocol_a,
56 + COL_PROTOCOL_NAME, &protocol_a,
57 -1);
58 gtk_tree_model_get (model, iter_b,
59 - COL_PROTOCOL, &protocol_b,
60 + COL_PROTOCOL_NAME, &protocol_b,
61 -1);
62
63 cmp = protocol_chooser_sort_protocol_value (protocol_a);
64 cmp -= protocol_chooser_sort_protocol_value (protocol_b);
65 if (cmp == 0)
66 {
67 - cmp = strcmp (protocol_a->name, protocol_b->name);
68 + cmp = strcmp (protocol_a, protocol_b);
69 /* only happens for jabber where there is one entry for gtalk and one for
70 * non-gtalk */
71 if (cmp == 0)
72 @@ -139,6 +139,8 @@ protocol_chooser_sort_func (GtkTreeModel *model,
73 }
74 }
75
76 + g_free (protocol_a);
77 + g_free (protocol_b);
78 return cmp;
79 }
80
81 @@ -169,7 +171,6 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
82 {
83 GtkTreeIter titer;
84 gboolean valid;
85 - const TpConnectionManagerProtocol *haze_proto;
86 TpConnectionManager *haze_cm;
87
88 /* let's this CM replace the haze implementation */
89 @@ -178,28 +179,26 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
90
91 while (valid)
92 {
93 + gchar *haze_proto_name = NULL;
94 +
95 gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &titer,
96 - COL_PROTOCOL, &haze_proto,
97 + COL_PROTOCOL_NAME, &haze_proto_name,
98 COL_CM, &haze_cm, -1);
99
100 if (haze_cm == NULL)
101 continue;
102
103 - if (haze_proto == NULL)
104 - {
105 - g_object_unref (haze_cm);
106 - continue;
107 - }
108 -
109 if (!tp_strdiff (haze_cm->name, "haze") &&
110 - !tp_strdiff (haze_proto->name, proto->name))
111 + !tp_strdiff (haze_proto_name, proto->name))
112 {
113 gtk_list_store_remove (priv->store, &titer);
114 g_object_unref (haze_cm);
115 + g_free (haze_proto_name);
116 break;
117 }
118
119 g_object_unref (haze_cm);
120 + g_free (haze_proto_name);
121 valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store),
122 &titer);
123 }
124 @@ -219,7 +218,7 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
125 COL_ICON, icon_name,
126 COL_LABEL, display_name,
127 COL_CM, cm,
128 - COL_PROTOCOL, proto,
129 + COL_PROTOCOL_NAME, proto->name,
130 COL_IS_GTALK, FALSE,
131 -1);
132
133 @@ -232,7 +231,7 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
134 COL_ICON, "im-google-talk",
135 COL_LABEL, display_name,
136 COL_CM, cm,
137 - COL_PROTOCOL, proto,
138 + COL_PROTOCOL_NAME, proto->name,
139 COL_IS_GTALK, TRUE,
140 -1);
141 }
142 @@ -278,16 +277,16 @@ protocol_chooser_constructed (GObject *object)
143 G_TYPE_STRING, /* Icon name */
144 G_TYPE_STRING, /* Label */
145 G_TYPE_OBJECT, /* CM */
146 - G_TYPE_POINTER, /* protocol */
147 + G_TYPE_STRING, /* protocol name */
148 G_TYPE_BOOLEAN); /* is gtalk */
149
150 /* Set the protocol sort function */
151 gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (priv->store),
152 - COL_PROTOCOL,
153 + COL_PROTOCOL_NAME,
154 protocol_chooser_sort_func,
155 NULL, NULL);
156 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (priv->store),
157 - COL_PROTOCOL,
158 + COL_PROTOCOL_NAME,
159 GTK_SORT_ASCENDING);
160
161 gtk_combo_box_set_model (GTK_COMBO_BOX (object),
162 @@ -394,17 +393,30 @@ protocol_chooser_filter_visible_func (GtkTreeModel *model,
163 EmpathyProtocolChooser *protocol_chooser = user_data;
164 EmpathyProtocolChooserPriv *priv = GET_PRIV (protocol_chooser);
165 TpConnectionManager *cm = NULL;
166 - TpConnectionManagerProtocol *protocol = NULL;
167 + gchar *protocol_name = NULL;
168 gboolean visible = FALSE;
169
170 - gtk_tree_model_get (model, iter, COL_CM, &cm, COL_PROTOCOL, &protocol, -1);
171 + gtk_tree_model_get (model, iter,
172 + COL_CM, &cm,
173 + COL_PROTOCOL_NAME, &protocol_name,
174 + -1);
175
176 - if (cm != NULL && protocol != NULL)
177 + if (cm != NULL && protocol_name != NULL)
178 {
179 - visible = priv->filter_func (cm, protocol, priv->filter_user_data);
180 - g_object_unref (cm);
181 + TpConnectionManagerProtocol *protocol;
182 +
183 + protocol = (TpConnectionManagerProtocol *)
184 + tp_connection_manager_get_protocol (cm, protocol_name);
185 +
186 + if (protocol != NULL)
187 + {
188 + visible = priv->filter_func (cm, protocol, priv->filter_user_data);
189 + }
190 }
191
192 + if (cm != NULL)
193 + g_object_unref (cm);
194 +
195 return visible;
196 }
197
198 @@ -444,9 +456,16 @@ empathy_protocol_chooser_dup_selected (
199
200 if (protocol != NULL)
201 {
202 + gchar *protocol_name = NULL;
203 +
204 gtk_tree_model_get (GTK_TREE_MODEL (cur_model), &iter,
205 - COL_PROTOCOL, protocol,
206 + COL_PROTOCOL_NAME, &protocol_name,
207 -1);
208 +
209 + *protocol = (TpConnectionManagerProtocol *)
210 + tp_connection_manager_get_protocol (cm, protocol_name);
211 +
212 + g_free (protocol_name);
213 }
214
215 if (is_gtalk != NULL)
0 From d276e3dd0cdf1bb19f212af950463968ddf7dc25 Mon Sep 17 00:00:00 2001
1 From: Rob Bradford <rob@linux.intel.com>
2 Date: Fri, 23 Oct 2009 17:18:05 +0100
3 Subject: [PATCH 3/4] empathy-chat-window: Don't update the Contact menu if visible
4
5 If the Contact menu is currently visible do not update it. Instead update it
6 once the menu is hidden.
7
8 Fixes: #591360
9 ---
10 src/empathy-chat-window.c | 31 ++++++++++++++++++++++++++-----
11 1 files changed, 26 insertions(+), 5 deletions(-)
12
13 diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
14 index 9e89f75..382e293 100644
15 --- a/src/empathy-chat-window.c
16 +++ b/src/empathy-chat-window.c
17 @@ -113,6 +113,8 @@ static const GtkTargetEntry drag_types_dest[] = {
18 { "GTK_NOTEBOOK_TAB", GTK_TARGET_SAME_APP, DND_DRAG_TYPE_TAB },
19 };
20
21 +static void chat_window_update (EmpathyChatWindow *window);
22 +
23 G_DEFINE_TYPE (EmpathyChatWindow, empathy_chat_window, G_TYPE_OBJECT);
24
25 static void
26 @@ -295,6 +297,17 @@ chat_window_create_label (EmpathyChatWindow *window,
27 }
28
29 static void
30 +_submenu_notify_visible_changed_cb (GObject *object,
31 + GParamSpec *pspec,
32 + gpointer userdata)
33 +{
34 + g_signal_handlers_disconnect_by_func (object,
35 + _submenu_notify_visible_changed_cb,
36 + userdata);
37 + chat_window_update (EMPATHY_CHAT_WINDOW (userdata));
38 +}
39 +
40 +static void
41 chat_window_update (EmpathyChatWindow *window)
42 {
43 EmpathyChatWindowPriv *priv = GET_PRIV (window);
44 @@ -311,8 +324,7 @@ chat_window_update (EmpathyChatWindow *window)
45 gboolean avatar_in_icon;
46 GtkWidget *chat;
47 GtkWidget *chat_close_button;
48 - GtkWidget *submenu;
49 - GtkWidget *menu;
50 + GtkWidget *menu, *submenu, *orig_submenu;
51
52 /* Get information */
53 page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
54 @@ -336,9 +348,18 @@ chat_window_update (EmpathyChatWindow *window)
55 /* Update Contact menu */
56 menu = gtk_ui_manager_get_widget (priv->ui_manager,
57 "/chats_menubar/menu_contact");
58 - submenu = empathy_chat_get_contact_menu (priv->current_chat);
59 - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), submenu);
60 - gtk_widget_show (menu);
61 + orig_submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu));
62 + if (!GTK_WIDGET_VISIBLE (orig_submenu))
63 + {
64 + submenu = empathy_chat_get_contact_menu (priv->current_chat);
65 + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), submenu);
66 + gtk_widget_show (menu);
67 + } else {
68 + empathy_signal_connect_weak (orig_submenu,
69 + "notify::visible",
70 + (GCallback)_submenu_notify_visible_changed_cb,
71 + G_OBJECT (window));
72 + }
73
74 /* Update window title */
75 if (n_chats == 1) {
0 From a39915476af1eae4d7c73b664920249172750ceb Mon Sep 17 00:00:00 2001
1 From: Xavier Claessens <xclaesse@gmail.com>
2 Date: Sun, 25 Oct 2009 17:54:49 +0100
3 Subject: [PATCH 4/4] Fix crash when joining a chat, GTK_WIDGET_VISIBLE is not NULL-safe
4
5 ---
6 src/empathy-chat-window.c | 3 +--
7 1 files changed, 1 insertions(+), 2 deletions(-)
8
9 diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
10 index 382e293..985fa88 100644
11 --- a/src/empathy-chat-window.c
12 +++ b/src/empathy-chat-window.c
13 @@ -349,8 +349,7 @@ chat_window_update (EmpathyChatWindow *window)
14 menu = gtk_ui_manager_get_widget (priv->ui_manager,
15 "/chats_menubar/menu_contact");
16 orig_submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu));
17 - if (!GTK_WIDGET_VISIBLE (orig_submenu))
18 - {
19 + if (orig_submenu == NULL || !GTK_WIDGET_VISIBLE (orig_submenu)) {
20 submenu = empathy_chat_get_contact_menu (priv->current_chat);
21 gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), submenu);
22 gtk_widget_show (menu);